@gofynd/fdk-client-javascript 1.6.4 → 3.1.0-beta.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.
- package/README.md +1 -1
- package/package.json +1 -1
- package/sdk/application/ApplicationClient.d.ts +0 -2
- package/sdk/application/ApplicationClient.js +0 -2
- package/sdk/application/Cart/CartApplicationClient.d.ts +100 -80
- package/sdk/application/Cart/CartApplicationClient.js +257 -126
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +110 -110
- package/sdk/application/Catalog/CatalogApplicationClient.js +122 -138
- package/sdk/application/Common/CommonApplicationClient.d.ts +4 -4
- package/sdk/application/Common/CommonApplicationClient.js +3 -3
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +43 -3
- package/sdk/application/Communication/CommunicationApplicationClient.js +190 -3
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +71 -36
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +103 -29
- package/sdk/application/Content/ContentApplicationClient.d.ts +61 -21
- package/sdk/application/Content/ContentApplicationClient.js +250 -36
- package/sdk/application/Lead/LeadApplicationClient.d.ts +3 -3
- package/sdk/application/Lead/LeadApplicationClient.js +3 -3
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +106 -57
- package/sdk/application/Logistic/LogisticApplicationClient.js +326 -208
- package/sdk/application/Order/OrderApplicationClient.d.ts +44 -24
- package/sdk/application/Order/OrderApplicationClient.js +140 -21
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +211 -111
- package/sdk/application/Payment/PaymentApplicationClient.js +610 -109
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +13 -13
- package/sdk/application/Rewards/RewardsApplicationClient.js +7 -7
- package/sdk/application/Share/ShareApplicationClient.d.ts +7 -7
- package/sdk/application/Share/ShareApplicationClient.js +14 -14
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +23 -3
- package/sdk/application/Theme/ThemeApplicationClient.js +103 -5
- package/sdk/application/User/UserApplicationClient.d.ts +13 -23
- package/sdk/application/User/UserApplicationClient.js +9 -57
- package/sdk/application/Webhook/WebhookApplicationClient.d.ts +4 -4
- package/sdk/application/Webhook/WebhookApplicationClient.js +3 -3
- package/sdk/partner/Authorization/AuthorizationPartnerClient.d.ts +66 -0
- package/sdk/partner/Authorization/AuthorizationPartnerClient.js +431 -0
- package/sdk/partner/Authorization/AuthorizationPartnerModel.d.ts +231 -0
- package/sdk/partner/Authorization/AuthorizationPartnerModel.js +152 -0
- package/sdk/partner/Authorization/AuthorizationPartnerValidator.d.ts +8 -0
- package/sdk/partner/Authorization/AuthorizationPartnerValidator.js +39 -0
- package/sdk/partner/Catalog/CatalogPartnerClient.d.ts +26 -0
- package/sdk/partner/Catalog/CatalogPartnerClient.js +173 -0
- package/sdk/partner/Catalog/CatalogPartnerModel.d.ts +238 -0
- package/sdk/partner/Catalog/CatalogPartnerModel.js +248 -0
- package/sdk/partner/Catalog/CatalogPartnerValidator.d.ts +5 -0
- package/sdk/partner/Catalog/CatalogPartnerValidator.js +19 -0
- package/sdk/partner/FileStorage/FileStoragePartnerClient.d.ts +0 -10
- package/sdk/partner/FileStorage/FileStoragePartnerClient.js +0 -75
- package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +1 -54
- package/sdk/partner/FileStorage/FileStoragePartnerModel.js +0 -43
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.d.ts +0 -1
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.js +0 -6
- package/sdk/partner/Lead/LeadPartnerClient.d.ts +5 -5
- package/sdk/partner/Lead/LeadPartnerClient.js +4 -4
- package/sdk/partner/Lead/LeadPartnerModel.d.ts +100 -49
- package/sdk/partner/Lead/LeadPartnerModel.js +100 -74
- package/sdk/partner/Lead/LeadPartnerValidator.js +1 -1
- package/sdk/partner/Logistics/LogisticsPartnerClient.d.ts +33 -160
- package/sdk/partner/Logistics/LogisticsPartnerClient.js +66 -1180
- package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +288 -1685
- package/sdk/partner/Logistics/LogisticsPartnerModel.js +226 -824
- package/sdk/partner/Logistics/LogisticsPartnerValidator.d.ts +1 -13
- package/sdk/partner/Logistics/LogisticsPartnerValidator.js +14 -141
- package/sdk/partner/PartnerClient.d.ts +6 -0
- package/sdk/partner/PartnerClient.js +9 -0
- package/sdk/partner/Payment/PaymentPartnerClient.d.ts +116 -0
- package/sdk/partner/Payment/PaymentPartnerClient.js +857 -0
- package/sdk/partner/Payment/PaymentPartnerModel.d.ts +388 -0
- package/sdk/partner/Payment/PaymentPartnerModel.js +442 -0
- package/sdk/partner/Payment/PaymentPartnerValidator.d.ts +14 -0
- package/sdk/partner/Payment/PaymentPartnerValidator.js +74 -0
- package/sdk/partner/Theme/ThemePartnerClient.d.ts +63 -21
- package/sdk/partner/Theme/ThemePartnerClient.js +396 -71
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +104 -72
- package/sdk/partner/Theme/ThemePartnerModel.js +101 -75
- package/sdk/partner/Theme/ThemePartnerValidator.d.ts +5 -1
- package/sdk/partner/Theme/ThemePartnerValidator.js +42 -12
- package/sdk/partner/Webhook/WebhookPartnerClient.d.ts +18 -18
- package/sdk/partner/Webhook/WebhookPartnerClient.js +18 -18
- package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +191 -670
- package/sdk/partner/Webhook/WebhookPartnerModel.js +159 -268
- package/sdk/partner/Webhook/WebhookPartnerValidator.js +3 -3
- package/sdk/partner/index.d.ts +3 -0
- package/sdk/partner/index.js +6 -0
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +1 -4
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +1 -1
- package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +5 -0
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +3 -1
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +32 -2
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +243 -3
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +145 -49
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +171 -20
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +39 -1
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +35 -0
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +12 -12
- package/sdk/platform/Billing/BillingPlatformClient.js +15 -15
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +388 -443
- package/sdk/platform/Billing/BillingPlatformModel.js +263 -280
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +18 -16
- package/sdk/platform/Billing/BillingPlatformValidator.js +9 -8
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +251 -172
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +639 -521
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +165 -165
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +108 -132
- package/sdk/platform/Cart/CartPlatformModel.d.ts +3150 -4468
- package/sdk/platform/Cart/CartPlatformModel.js +2858 -1867
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +976 -380
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +6475 -2015
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +1083 -162
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +884 -80
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +325 -568
- package/sdk/platform/Catalog/CatalogPlatformClient.js +1162 -1562
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +6008 -7688
- package/sdk/platform/Catalog/CatalogPlatformModel.js +9522 -6892
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +234 -227
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +183 -177
- package/sdk/platform/Common/CommonPlatformClient.d.ts +5 -6
- package/sdk/platform/Common/CommonPlatformClient.js +5 -6
- package/sdk/platform/Common/CommonPlatformModel.d.ts +9 -9
- package/sdk/platform/Common/CommonPlatformModel.js +6 -6
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +374 -238
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +876 -588
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +170 -139
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +145 -126
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +56 -3
- package/sdk/platform/Communication/CommunicationPlatformClient.js +307 -4
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +506 -270
- package/sdk/platform/Communication/CommunicationPlatformModel.js +611 -313
- package/sdk/platform/Communication/CommunicationPlatformValidator.d.ts +62 -3
- package/sdk/platform/Communication/CommunicationPlatformValidator.js +48 -2
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +78 -77
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +97 -91
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +238 -256
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +222 -244
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +31 -20
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +25 -20
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +333 -118
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +1470 -409
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +158 -55
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +163 -41
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +151 -61
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +595 -101
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +1206 -459
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +1011 -320
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +80 -34
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +79 -24
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +255 -140
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +1095 -464
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +221 -178
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +220 -157
- package/sdk/platform/Content/ContentPlatformClient.d.ts +124 -123
- package/sdk/platform/Content/ContentPlatformClient.js +459 -379
- package/sdk/platform/Content/ContentPlatformModel.d.ts +871 -1315
- package/sdk/platform/Content/ContentPlatformModel.js +940 -599
- package/sdk/platform/Content/ContentPlatformValidator.d.ts +140 -150
- package/sdk/platform/Content/ContentPlatformValidator.js +131 -135
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +60 -36
- package/sdk/platform/Discount/DiscountPlatformClient.js +85 -36
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +46 -47
- package/sdk/platform/Discount/DiscountPlatformModel.js +42 -46
- package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +2 -2
- package/sdk/platform/Discount/DiscountPlatformValidator.js +2 -2
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +18 -15
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +24 -22
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +4 -4
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +4 -4
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +8 -8
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +8 -8
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +75 -86
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +60 -74
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +6 -6
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +6 -6
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +320 -0
- package/sdk/platform/Finance/FinancePlatformClient.js +2333 -0
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +2895 -0
- package/sdk/platform/Finance/FinancePlatformModel.js +2150 -0
- package/sdk/platform/Finance/FinancePlatformValidator.d.ts +284 -0
- package/sdk/platform/Finance/FinancePlatformValidator.js +354 -0
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +17 -17
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +33 -33
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +19 -19
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +14 -14
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +4 -24
- package/sdk/platform/Lead/LeadPlatformClient.js +4 -160
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +142 -57
- package/sdk/platform/Lead/LeadPlatformModel.js +162 -79
- package/sdk/platform/Lead/LeadPlatformValidator.d.ts +3 -29
- package/sdk/platform/Lead/LeadPlatformValidator.js +2 -28
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +94 -25
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +600 -57
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +115 -115
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +120 -43
- package/sdk/platform/Order/OrderPlatformClient.d.ts +486 -277
- package/sdk/platform/Order/OrderPlatformClient.js +1491 -938
- package/sdk/platform/Order/OrderPlatformModel.d.ts +4560 -8636
- package/sdk/platform/Order/OrderPlatformModel.js +3604 -4056
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +445 -612
- package/sdk/platform/Order/OrderPlatformValidator.js +316 -326
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -6
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +7 -9
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +9 -9
- package/sdk/platform/Partner/PartnerPlatformModel.js +7 -7
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +382 -135
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +2453 -935
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +306 -93
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +305 -70
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +66 -56
- package/sdk/platform/Payment/PaymentPlatformClient.js +269 -124
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +3531 -1292
- package/sdk/platform/Payment/PaymentPlatformModel.js +3813 -1504
- package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +64 -35
- package/sdk/platform/Payment/PaymentPlatformValidator.js +60 -34
- package/sdk/platform/PlatformClient.d.ts +2 -0
- package/sdk/platform/PlatformClient.js +4 -0
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +2 -2
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +2 -2
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +2 -2
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +2 -2
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +14 -9
- package/sdk/platform/Rewards/RewardsPlatformModel.js +10 -8
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +344 -56
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +2188 -302
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +394 -54
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +342 -37
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +150 -212
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +589 -1238
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +3581 -2960
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +3730 -1779
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +230 -382
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +164 -287
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +4 -16
- package/sdk/platform/Share/SharePlatformApplicationClient.js +8 -86
- package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +6 -23
- package/sdk/platform/Share/SharePlatformApplicationValidator.js +3 -16
- package/sdk/platform/Share/SharePlatformModel.d.ts +11 -50
- package/sdk/platform/Share/SharePlatformModel.js +5 -43
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +36 -16
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +201 -58
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +28 -17
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +33 -16
- package/sdk/platform/Theme/ThemePlatformClient.d.ts +18 -8
- package/sdk/platform/Theme/ThemePlatformClient.js +85 -8
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +425 -17
- package/sdk/platform/Theme/ThemePlatformModel.js +329 -23
- package/sdk/platform/Theme/ThemePlatformValidator.d.ts +7 -3
- package/sdk/platform/Theme/ThemePlatformValidator.js +9 -2
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +18 -71
- package/sdk/platform/User/UserPlatformApplicationClient.js +27 -412
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +10 -114
- package/sdk/platform/User/UserPlatformApplicationValidator.js +7 -80
- package/sdk/platform/User/UserPlatformModel.d.ts +216 -264
- package/sdk/platform/User/UserPlatformModel.js +209 -216
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +78 -25
- package/sdk/platform/Webhook/WebhookPlatformClient.js +470 -75
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +428 -810
- package/sdk/platform/Webhook/WebhookPlatformModel.js +395 -444
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +55 -10
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +72 -12
- package/sdk/platform/index.d.ts +1 -0
- package/sdk/platform/index.js +2 -0
- package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +14 -4
- package/sdk/public/Configuration/ConfigurationPublicClient.js +97 -9
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +102 -40
- package/sdk/public/Configuration/ConfigurationPublicModel.js +111 -29
- package/sdk/public/Configuration/ConfigurationPublicValidator.d.ts +11 -1
- package/sdk/public/Configuration/ConfigurationPublicValidator.js +12 -0
- package/sdk/public/Content/ContentPublicClient.d.ts +22 -0
- package/sdk/public/Content/ContentPublicClient.js +183 -0
- package/sdk/public/Content/ContentPublicModel.d.ts +38 -1
- package/sdk/public/Content/ContentPublicModel.js +47 -1
- package/sdk/public/Content/ContentPublicValidator.d.ts +17 -1
- package/sdk/public/Content/ContentPublicValidator.js +19 -0
- package/sdk/public/PublicClient.d.ts +0 -2
- package/sdk/public/PublicClient.js +0 -4
- package/sdk/public/Webhook/WebhookPublicClient.d.ts +8 -8
- package/sdk/public/Webhook/WebhookPublicClient.js +8 -8
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +67 -215
- package/sdk/public/Webhook/WebhookPublicModel.js +61 -66
- package/sdk/public/Webhook/WebhookPublicValidator.d.ts +4 -4
- package/sdk/public/Webhook/WebhookPublicValidator.js +4 -4
- package/sdk/public/index.d.ts +0 -1
- package/sdk/public/index.js +0 -2
- package/sdk/application/Finance/FinanceApplicationClient.d.ts +0 -29
- package/sdk/application/Finance/FinanceApplicationClient.js +0 -126
- package/sdk/public/Catalog/CatalogPublicClient.d.ts +0 -22
- package/sdk/public/Catalog/CatalogPublicClient.js +0 -138
- package/sdk/public/Catalog/CatalogPublicModel.d.ts +0 -155
- package/sdk/public/Catalog/CatalogPublicModel.js +0 -116
- package/sdk/public/Catalog/CatalogPublicValidator.d.ts +0 -55
- package/sdk/public/Catalog/CatalogPublicValidator.js +0 -35
|
@@ -2,109 +2,104 @@ const Joi = require("joi");
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @typedef EventConfig
|
|
5
|
-
* @property {number} [id]
|
|
6
|
-
* @property {string} [event_name]
|
|
7
|
-
* @property {string} [event_type]
|
|
8
|
-
* @property {string} [event_category]
|
|
9
|
-
* @property {Object} [event_schema]
|
|
10
|
-
* @property {string} [version]
|
|
11
|
-
* @property {string} [display_name]
|
|
12
|
-
* @property {string} [description]
|
|
13
|
-
* @property {string} [created_on]
|
|
14
|
-
*
|
|
15
|
-
* @property {string} [
|
|
16
|
-
* was last updated.
|
|
17
|
-
* @property {string} [group] - The group to which the event belongs.
|
|
5
|
+
* @property {number} [id]
|
|
6
|
+
* @property {string} [event_name]
|
|
7
|
+
* @property {string} [event_type]
|
|
8
|
+
* @property {string} [event_category]
|
|
9
|
+
* @property {Object} [event_schema]
|
|
10
|
+
* @property {string} [version]
|
|
11
|
+
* @property {string} [display_name]
|
|
12
|
+
* @property {string} [description]
|
|
13
|
+
* @property {string} [created_on]
|
|
14
|
+
* @property {string} [updated_on]
|
|
15
|
+
* @property {string} [group]
|
|
18
16
|
*/
|
|
19
17
|
|
|
20
18
|
/**
|
|
21
|
-
* @typedef
|
|
22
|
-
* @property {EventConfig[]} [event_configs]
|
|
19
|
+
* @typedef EventConfigResponse
|
|
20
|
+
* @property {EventConfig[]} [event_configs]
|
|
23
21
|
*/
|
|
24
22
|
|
|
25
23
|
/**
|
|
26
24
|
* @typedef EventConfigBase
|
|
27
|
-
* @property {string} [event_name]
|
|
28
|
-
* @property {string} [event_type]
|
|
29
|
-
* @property {string} [event_category]
|
|
30
|
-
* @property {string} [version]
|
|
25
|
+
* @property {string} [event_name]
|
|
26
|
+
* @property {string} [event_type]
|
|
27
|
+
* @property {string} [event_category]
|
|
28
|
+
* @property {string} [version]
|
|
31
29
|
*/
|
|
32
30
|
|
|
33
31
|
/**
|
|
34
32
|
* @typedef EventNotifier
|
|
35
|
-
* @property {string} [message]
|
|
36
|
-
* @property {string[]} [emails]
|
|
33
|
+
* @property {string} [message]
|
|
34
|
+
* @property {string[]} [emails]
|
|
37
35
|
*/
|
|
38
36
|
|
|
39
37
|
/**
|
|
40
38
|
* @typedef EventSchema
|
|
41
|
-
* @property {Object} [payload]
|
|
42
|
-
* @property {Object} [meta]
|
|
39
|
+
* @property {Object} [payload]
|
|
40
|
+
* @property {Object} [meta]
|
|
43
41
|
*/
|
|
44
42
|
|
|
45
43
|
/**
|
|
46
44
|
* @typedef InternalTransformEvent
|
|
47
|
-
* @property {string[]} [trace_id]
|
|
48
|
-
* @property {string} [name]
|
|
49
|
-
* @property {string} [type]
|
|
50
|
-
* @property {string} [version]
|
|
51
|
-
* @property {number} [created_timestamp]
|
|
45
|
+
* @property {string[]} [trace_id]
|
|
46
|
+
* @property {string} [name]
|
|
47
|
+
* @property {string} [type]
|
|
48
|
+
* @property {string} [version]
|
|
49
|
+
* @property {number} [created_timestamp]
|
|
52
50
|
*/
|
|
53
51
|
|
|
54
52
|
/**
|
|
55
53
|
* @typedef TransformEventData
|
|
56
54
|
* @property {InternalTransformEvent} [event]
|
|
57
|
-
* @property {number} [company_id]
|
|
58
|
-
* @property {string[]} [contains]
|
|
59
|
-
* @property {Object} [payload]
|
|
55
|
+
* @property {number} [company_id]
|
|
56
|
+
* @property {string[]} [contains]
|
|
57
|
+
* @property {Object} [payload]
|
|
60
58
|
*/
|
|
61
59
|
|
|
62
60
|
/**
|
|
63
61
|
* @typedef TransformEventServiceMeta
|
|
64
|
-
* @property {string} [name]
|
|
62
|
+
* @property {string} [name]
|
|
65
63
|
*/
|
|
66
64
|
|
|
67
65
|
/**
|
|
68
66
|
* @typedef TransformEventAssociation
|
|
69
|
-
* @property {number} [company_id]
|
|
67
|
+
* @property {number} [company_id]
|
|
70
68
|
*/
|
|
71
69
|
|
|
72
70
|
/**
|
|
73
|
-
* @typedef
|
|
74
|
-
* @property {string} event_name
|
|
75
|
-
* @property {string} event_type
|
|
76
|
-
* @property {string} event_category
|
|
77
|
-
* @property {string} event_version
|
|
71
|
+
* @typedef TransformEventRequest
|
|
72
|
+
* @property {string} event_name
|
|
73
|
+
* @property {string} event_type
|
|
74
|
+
* @property {string} event_category
|
|
75
|
+
* @property {string} event_version
|
|
78
76
|
* @property {EventSchema} event
|
|
79
77
|
*/
|
|
80
78
|
|
|
81
79
|
/**
|
|
82
|
-
* @typedef
|
|
83
|
-
* @property {string} event_name
|
|
84
|
-
* @property {string} event_type
|
|
85
|
-
* @property {string} event_category
|
|
86
|
-
* @property {string} event_version
|
|
80
|
+
* @typedef ValidateSchemaRequest
|
|
81
|
+
* @property {string} event_name
|
|
82
|
+
* @property {string} event_type
|
|
83
|
+
* @property {string} event_category
|
|
84
|
+
* @property {string} event_version
|
|
87
85
|
* @property {EventSchema} event
|
|
88
|
-
* @property {Object} event_schema
|
|
86
|
+
* @property {Object} event_schema
|
|
89
87
|
*/
|
|
90
88
|
|
|
91
89
|
/**
|
|
92
|
-
* @typedef
|
|
93
|
-
* @property {boolean} [status]
|
|
94
|
-
*
|
|
95
|
-
* @property {string} [message] - A message providing additional details about
|
|
96
|
-
* the validation result.
|
|
90
|
+
* @typedef ValidateSchemaResponse
|
|
91
|
+
* @property {boolean} [status]
|
|
92
|
+
* @property {string} [message]
|
|
97
93
|
*/
|
|
98
94
|
|
|
99
95
|
/**
|
|
100
|
-
* @typedef
|
|
101
|
-
* @property {string[]} [event_trace_id]
|
|
102
|
-
* transformation event.
|
|
96
|
+
* @typedef TransformEventResponse
|
|
97
|
+
* @property {string[]} [event_trace_id]
|
|
103
98
|
* @property {TransformEventData} [data]
|
|
104
|
-
* @property {string} [event_name]
|
|
105
|
-
* @property {string} [version]
|
|
106
|
-
* @property {boolean} [status]
|
|
107
|
-
* @property {string} [event_type]
|
|
99
|
+
* @property {string} [event_name]
|
|
100
|
+
* @property {string} [version]
|
|
101
|
+
* @property {boolean} [status]
|
|
102
|
+
* @property {string} [event_type]
|
|
108
103
|
* @property {TransformEventServiceMeta} [service_meta]
|
|
109
104
|
* @property {TransformEventAssociation} [association]
|
|
110
105
|
*/
|
|
@@ -127,8 +122,8 @@ class WebhookPublicModel {
|
|
|
127
122
|
});
|
|
128
123
|
}
|
|
129
124
|
|
|
130
|
-
/** @returns {
|
|
131
|
-
static
|
|
125
|
+
/** @returns {EventConfigResponse} */
|
|
126
|
+
static EventConfigResponse() {
|
|
132
127
|
return Joi.object({
|
|
133
128
|
event_configs: Joi.array().items(WebhookPublicModel.EventConfig()),
|
|
134
129
|
});
|
|
@@ -195,8 +190,8 @@ class WebhookPublicModel {
|
|
|
195
190
|
});
|
|
196
191
|
}
|
|
197
192
|
|
|
198
|
-
/** @returns {
|
|
199
|
-
static
|
|
193
|
+
/** @returns {TransformEventRequest} */
|
|
194
|
+
static TransformEventRequest() {
|
|
200
195
|
return Joi.object({
|
|
201
196
|
event_name: Joi.string().allow("").required(),
|
|
202
197
|
event_type: Joi.string().allow("").required(),
|
|
@@ -206,8 +201,8 @@ class WebhookPublicModel {
|
|
|
206
201
|
});
|
|
207
202
|
}
|
|
208
203
|
|
|
209
|
-
/** @returns {
|
|
210
|
-
static
|
|
204
|
+
/** @returns {ValidateSchemaRequest} */
|
|
205
|
+
static ValidateSchemaRequest() {
|
|
211
206
|
return Joi.object({
|
|
212
207
|
event_name: Joi.string().allow("").required(),
|
|
213
208
|
event_type: Joi.string().allow("").required(),
|
|
@@ -218,16 +213,16 @@ class WebhookPublicModel {
|
|
|
218
213
|
});
|
|
219
214
|
}
|
|
220
215
|
|
|
221
|
-
/** @returns {
|
|
222
|
-
static
|
|
216
|
+
/** @returns {ValidateSchemaResponse} */
|
|
217
|
+
static ValidateSchemaResponse() {
|
|
223
218
|
return Joi.object({
|
|
224
219
|
status: Joi.boolean(),
|
|
225
220
|
message: Joi.string().allow(""),
|
|
226
221
|
});
|
|
227
222
|
}
|
|
228
223
|
|
|
229
|
-
/** @returns {
|
|
230
|
-
static
|
|
224
|
+
/** @returns {TransformEventResponse} */
|
|
225
|
+
static TransformEventResponse() {
|
|
231
226
|
return Joi.object({
|
|
232
227
|
event_trace_id: Joi.array().items(Joi.string().allow("")),
|
|
233
228
|
data: WebhookPublicModel.TransformEventData(),
|
|
@@ -7,11 +7,11 @@ export = WebhookPublicValidator;
|
|
|
7
7
|
*/
|
|
8
8
|
/**
|
|
9
9
|
* @typedef TestHandlerTransformationParam
|
|
10
|
-
* @property {WebhookPublicModel.
|
|
10
|
+
* @property {WebhookPublicModel.TransformEventRequest} body
|
|
11
11
|
*/
|
|
12
12
|
/**
|
|
13
13
|
* @typedef ValidateSchemaParam
|
|
14
|
-
* @property {WebhookPublicModel.
|
|
14
|
+
* @property {WebhookPublicModel.ValidateSchemaRequest} body
|
|
15
15
|
*/
|
|
16
16
|
declare class WebhookPublicValidator {
|
|
17
17
|
/** @returns {FetchAllWebhookEventsParam} */
|
|
@@ -32,10 +32,10 @@ type QueryWebhookEventDetailsParam = {
|
|
|
32
32
|
body: WebhookPublicModel.EventConfigBase[];
|
|
33
33
|
};
|
|
34
34
|
type TestHandlerTransformationParam = {
|
|
35
|
-
body: WebhookPublicModel.
|
|
35
|
+
body: WebhookPublicModel.TransformEventRequest;
|
|
36
36
|
};
|
|
37
37
|
type ValidateSchemaParam = {
|
|
38
|
-
body: WebhookPublicModel.
|
|
38
|
+
body: WebhookPublicModel.ValidateSchemaRequest;
|
|
39
39
|
};
|
|
40
40
|
type FetchAllWebhookEventsParam = any;
|
|
41
41
|
type NotifyDepricatedEventParam = any;
|
|
@@ -13,12 +13,12 @@ const WebhookPublicModel = require("./WebhookPublicModel");
|
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* @typedef TestHandlerTransformationParam
|
|
16
|
-
* @property {WebhookPublicModel.
|
|
16
|
+
* @property {WebhookPublicModel.TransformEventRequest} body
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* @typedef ValidateSchemaParam
|
|
21
|
-
* @property {WebhookPublicModel.
|
|
21
|
+
* @property {WebhookPublicModel.ValidateSchemaRequest} body
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
24
|
class WebhookPublicValidator {
|
|
@@ -42,14 +42,14 @@ class WebhookPublicValidator {
|
|
|
42
42
|
/** @returns {TestHandlerTransformationParam} */
|
|
43
43
|
static testHandlerTransformation() {
|
|
44
44
|
return Joi.object({
|
|
45
|
-
body: WebhookPublicModel.
|
|
45
|
+
body: WebhookPublicModel.TransformEventRequest().required(),
|
|
46
46
|
}).required();
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
/** @returns {ValidateSchemaParam} */
|
|
50
50
|
static validateSchema() {
|
|
51
51
|
return Joi.object({
|
|
52
|
-
body: WebhookPublicModel.
|
|
52
|
+
body: WebhookPublicModel.ValidateSchemaRequest().required(),
|
|
53
53
|
}).required();
|
|
54
54
|
}
|
|
55
55
|
}
|
package/sdk/public/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export const PublicConfig: typeof import("./PublicConfig");
|
|
2
2
|
export const PublicClient: typeof import("./PublicClient");
|
|
3
3
|
export namespace PublicModel {
|
|
4
|
-
const CatalogPublicModel: typeof import("./Catalog/CatalogPublicModel");
|
|
5
4
|
const ConfigurationPublicModel: typeof import("./Configuration/ConfigurationPublicModel");
|
|
6
5
|
const ContentPublicModel: typeof import("./Content/ContentPublicModel");
|
|
7
6
|
const PartnerPublicModel: typeof import("./Partner/PartnerPublicModel");
|
package/sdk/public/index.js
CHANGED
|
@@ -2,8 +2,6 @@ module.exports = {
|
|
|
2
2
|
PublicConfig: require("./PublicConfig"),
|
|
3
3
|
PublicClient: require("./PublicClient"),
|
|
4
4
|
PublicModel: {
|
|
5
|
-
CatalogPublicModel: require("./Catalog/CatalogPublicModel"),
|
|
6
|
-
|
|
7
5
|
ConfigurationPublicModel: require("./Configuration/ConfigurationPublicModel"),
|
|
8
6
|
|
|
9
7
|
ContentPublicModel: require("./Content/ContentPublicModel"),
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export = Finance;
|
|
2
|
-
declare class Finance {
|
|
3
|
-
constructor(_conf: any);
|
|
4
|
-
_conf: any;
|
|
5
|
-
_relativeUrls: {
|
|
6
|
-
customerCreditBalance: string;
|
|
7
|
-
lockUnlockCreditNote: string;
|
|
8
|
-
};
|
|
9
|
-
_urls: {};
|
|
10
|
-
updateUrls(urls: any): void;
|
|
11
|
-
/**
|
|
12
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
13
|
-
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
14
|
-
* @returns {Promise<CustomerCreditBalanceResponseSchema>} - Success response
|
|
15
|
-
* @name customerCreditBalance
|
|
16
|
-
* @summary: This API will provide customer's credit balance against phone number or email and seller*affiliate id
|
|
17
|
-
* @description: This API will provide customer's credit balance against phone number or email and seller*affiliate id - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/finance/customerCreditBalance/).
|
|
18
|
-
*/
|
|
19
|
-
customerCreditBalance({ body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<CustomerCreditBalanceResponseSchema>;
|
|
20
|
-
/**
|
|
21
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
22
|
-
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
23
|
-
* @returns {Promise<LockUnlockResponseSchema>} - Success response
|
|
24
|
-
* @name lockUnlockCreditNote
|
|
25
|
-
* @summary: Lock or Unlock requested credit note.
|
|
26
|
-
* @description: Used to lock or unlock requested credit note. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/finance/lockUnlockCreditNote/).
|
|
27
|
-
*/
|
|
28
|
-
lockUnlockCreditNote({ body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<LockUnlockResponseSchema>;
|
|
29
|
-
}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
const {
|
|
2
|
-
FDKClientValidationError,
|
|
3
|
-
FDKResponseValidationError,
|
|
4
|
-
} = require("../../common/FDKError");
|
|
5
|
-
|
|
6
|
-
const ApplicationAPIClient = require("../ApplicationAPIClient");
|
|
7
|
-
const constructUrl = require("../constructUrl");
|
|
8
|
-
const Paginator = require("../../common/Paginator");
|
|
9
|
-
|
|
10
|
-
class Finance {
|
|
11
|
-
constructor(_conf) {
|
|
12
|
-
this._conf = _conf;
|
|
13
|
-
this._relativeUrls = {
|
|
14
|
-
customerCreditBalance:
|
|
15
|
-
"/service/application/finance/v1.0/customer-credit-balance",
|
|
16
|
-
lockUnlockCreditNote:
|
|
17
|
-
"/service/application/finance/v1.0/lock-unlock-credit-note",
|
|
18
|
-
};
|
|
19
|
-
this._urls = Object.entries(this._relativeUrls).reduce(
|
|
20
|
-
(urls, [method, relativeUrl]) => {
|
|
21
|
-
urls[method] = `${_conf.domain}${relativeUrl}`;
|
|
22
|
-
return urls;
|
|
23
|
-
},
|
|
24
|
-
{}
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
updateUrls(urls) {
|
|
29
|
-
this._urls = {
|
|
30
|
-
...this._urls,
|
|
31
|
-
...urls,
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
37
|
-
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
38
|
-
* @returns {Promise<CustomerCreditBalanceResponseSchema>} - Success response
|
|
39
|
-
* @name customerCreditBalance
|
|
40
|
-
* @summary: This API will provide customer's credit balance against phone number or email and seller*affiliate id
|
|
41
|
-
* @description: This API will provide customer's credit balance against phone number or email and seller*affiliate id - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/finance/customerCreditBalance/).
|
|
42
|
-
*/
|
|
43
|
-
async customerCreditBalance(
|
|
44
|
-
{ body, requestHeaders } = { requestHeaders: {} },
|
|
45
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
46
|
-
) {
|
|
47
|
-
let invalidInput = [];
|
|
48
|
-
if (invalidInput.length) {
|
|
49
|
-
const error = new Error();
|
|
50
|
-
error.message = "Missing required field";
|
|
51
|
-
error.details = invalidInput;
|
|
52
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const query_params = {};
|
|
56
|
-
|
|
57
|
-
const xHeaders = {};
|
|
58
|
-
|
|
59
|
-
const response = await ApplicationAPIClient.execute(
|
|
60
|
-
this._conf,
|
|
61
|
-
"post",
|
|
62
|
-
constructUrl({
|
|
63
|
-
url: this._urls["customerCreditBalance"],
|
|
64
|
-
params: {},
|
|
65
|
-
}),
|
|
66
|
-
query_params,
|
|
67
|
-
body,
|
|
68
|
-
{ ...xHeaders, ...requestHeaders },
|
|
69
|
-
{ responseHeaders }
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
let responseData = response;
|
|
73
|
-
if (responseHeaders) {
|
|
74
|
-
responseData = response[0];
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
return response;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
82
|
-
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
83
|
-
* @returns {Promise<LockUnlockResponseSchema>} - Success response
|
|
84
|
-
* @name lockUnlockCreditNote
|
|
85
|
-
* @summary: Lock or Unlock requested credit note.
|
|
86
|
-
* @description: Used to lock or unlock requested credit note. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/finance/lockUnlockCreditNote/).
|
|
87
|
-
*/
|
|
88
|
-
async lockUnlockCreditNote(
|
|
89
|
-
{ body, requestHeaders } = { requestHeaders: {} },
|
|
90
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
91
|
-
) {
|
|
92
|
-
let invalidInput = [];
|
|
93
|
-
if (invalidInput.length) {
|
|
94
|
-
const error = new Error();
|
|
95
|
-
error.message = "Missing required field";
|
|
96
|
-
error.details = invalidInput;
|
|
97
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
const query_params = {};
|
|
101
|
-
|
|
102
|
-
const xHeaders = {};
|
|
103
|
-
|
|
104
|
-
const response = await ApplicationAPIClient.execute(
|
|
105
|
-
this._conf,
|
|
106
|
-
"post",
|
|
107
|
-
constructUrl({
|
|
108
|
-
url: this._urls["lockUnlockCreditNote"],
|
|
109
|
-
params: {},
|
|
110
|
-
}),
|
|
111
|
-
query_params,
|
|
112
|
-
body,
|
|
113
|
-
{ ...xHeaders, ...requestHeaders },
|
|
114
|
-
{ responseHeaders }
|
|
115
|
-
);
|
|
116
|
-
|
|
117
|
-
let responseData = response;
|
|
118
|
-
if (responseHeaders) {
|
|
119
|
-
responseData = response[0];
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
return response;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
module.exports = Finance;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export = Catalog;
|
|
2
|
-
declare class Catalog {
|
|
3
|
-
constructor(_conf: any);
|
|
4
|
-
_conf: any;
|
|
5
|
-
_relativeUrls: {
|
|
6
|
-
getTaxonomyByLevel: string;
|
|
7
|
-
};
|
|
8
|
-
_urls: {};
|
|
9
|
-
updateUrls(urls: any): void;
|
|
10
|
-
/**
|
|
11
|
-
* @param {CatalogPublicValidator.GetTaxonomyByLevelParam} arg - Arg object.
|
|
12
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
13
|
-
* @param {import("../PublicAPIClient").Options} - Options
|
|
14
|
-
* @returns {Promise<CatalogPublicModel.TaxonomyResponseSchema>} - Success response
|
|
15
|
-
* @name getTaxonomyByLevel
|
|
16
|
-
* @summary: Get Taxonomy Information by Level
|
|
17
|
-
* @description: Get Taxonomy Details for a given level - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/public/catalog/getTaxonomyByLevel/).
|
|
18
|
-
*/
|
|
19
|
-
getTaxonomyByLevel({ level, l0Slug, l1Slug, l2Slug, l3Slug, limit, requestHeaders }?: CatalogPublicValidator.GetTaxonomyByLevelParam, { responseHeaders }?: object): Promise<CatalogPublicModel.TaxonomyResponseSchema>;
|
|
20
|
-
}
|
|
21
|
-
import CatalogPublicValidator = require("./CatalogPublicValidator");
|
|
22
|
-
import CatalogPublicModel = require("./CatalogPublicModel");
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
const {
|
|
2
|
-
FDKClientValidationError,
|
|
3
|
-
FDKResponseValidationError,
|
|
4
|
-
} = require("../../common/FDKError");
|
|
5
|
-
|
|
6
|
-
const PublicAPIClient = require("../PublicAPIClient");
|
|
7
|
-
const constructUrl = require("../constructUrl");
|
|
8
|
-
const Paginator = require("../../common/Paginator");
|
|
9
|
-
|
|
10
|
-
const CatalogPublicValidator = require("./CatalogPublicValidator");
|
|
11
|
-
const CatalogPublicModel = require("./CatalogPublicModel");
|
|
12
|
-
const Joi = require("joi");
|
|
13
|
-
const { Logger } = require("./../../common/Logger");
|
|
14
|
-
|
|
15
|
-
class Catalog {
|
|
16
|
-
constructor(_conf) {
|
|
17
|
-
this._conf = _conf;
|
|
18
|
-
this._relativeUrls = {
|
|
19
|
-
getTaxonomyByLevel: "/service/public/catalog/v1.0/taxonomy/level/{level}",
|
|
20
|
-
};
|
|
21
|
-
this._urls = Object.entries(this._relativeUrls).reduce(
|
|
22
|
-
(urls, [method, relativeUrl]) => {
|
|
23
|
-
urls[method] = `${_conf.domain}${relativeUrl}`;
|
|
24
|
-
return urls;
|
|
25
|
-
},
|
|
26
|
-
{}
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
updateUrls(urls) {
|
|
31
|
-
this._urls = {
|
|
32
|
-
...this._urls,
|
|
33
|
-
...urls,
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* @param {CatalogPublicValidator.GetTaxonomyByLevelParam} arg - Arg object.
|
|
39
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
40
|
-
* @param {import("../PublicAPIClient").Options} - Options
|
|
41
|
-
* @returns {Promise<CatalogPublicModel.TaxonomyResponseSchema>} - Success response
|
|
42
|
-
* @name getTaxonomyByLevel
|
|
43
|
-
* @summary: Get Taxonomy Information by Level
|
|
44
|
-
* @description: Get Taxonomy Details for a given level - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/public/catalog/getTaxonomyByLevel/).
|
|
45
|
-
*/
|
|
46
|
-
async getTaxonomyByLevel(
|
|
47
|
-
{ level, l0Slug, l1Slug, l2Slug, l3Slug, limit, requestHeaders } = {
|
|
48
|
-
requestHeaders: {},
|
|
49
|
-
},
|
|
50
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
51
|
-
) {
|
|
52
|
-
let invalidInput = [];
|
|
53
|
-
|
|
54
|
-
if (!level) {
|
|
55
|
-
invalidInput.push({
|
|
56
|
-
message: `The 'level' field is required.`,
|
|
57
|
-
path: ["level"],
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
if (invalidInput.length) {
|
|
61
|
-
const error = new Error();
|
|
62
|
-
error.message = "Missing required field";
|
|
63
|
-
error.details = invalidInput;
|
|
64
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const { error } = CatalogPublicValidator.getTaxonomyByLevel().validate(
|
|
68
|
-
{ level, l0Slug, l1Slug, l2Slug, l3Slug, limit },
|
|
69
|
-
{ abortEarly: false, allowUnknown: true }
|
|
70
|
-
);
|
|
71
|
-
if (error) {
|
|
72
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
// Showing warrnings if extra unknown parameters are found
|
|
76
|
-
const {
|
|
77
|
-
error: warrning,
|
|
78
|
-
} = CatalogPublicValidator.getTaxonomyByLevel().validate(
|
|
79
|
-
{ level, l0Slug, l1Slug, l2Slug, l3Slug, limit },
|
|
80
|
-
{ abortEarly: false, allowUnknown: false }
|
|
81
|
-
);
|
|
82
|
-
if (warrning) {
|
|
83
|
-
Logger({
|
|
84
|
-
level: "WARN",
|
|
85
|
-
message: `Parameter Validation warrnings for public > Catalog > getTaxonomyByLevel \n ${warrning}`,
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
const query_params = {};
|
|
90
|
-
query_params["l0_slug"] = l0Slug;
|
|
91
|
-
query_params["l1_slug"] = l1Slug;
|
|
92
|
-
query_params["l2_slug"] = l2Slug;
|
|
93
|
-
query_params["l3_slug"] = l3Slug;
|
|
94
|
-
query_params["limit"] = limit;
|
|
95
|
-
|
|
96
|
-
const xHeaders = {};
|
|
97
|
-
|
|
98
|
-
const response = await PublicAPIClient.execute(
|
|
99
|
-
this._conf,
|
|
100
|
-
"get",
|
|
101
|
-
constructUrl({
|
|
102
|
-
url: this._urls["getTaxonomyByLevel"],
|
|
103
|
-
params: { level },
|
|
104
|
-
}),
|
|
105
|
-
query_params,
|
|
106
|
-
undefined,
|
|
107
|
-
{ ...xHeaders, ...requestHeaders },
|
|
108
|
-
{ responseHeaders }
|
|
109
|
-
);
|
|
110
|
-
|
|
111
|
-
let responseData = response;
|
|
112
|
-
if (responseHeaders) {
|
|
113
|
-
responseData = response[0];
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
const {
|
|
117
|
-
error: res_error,
|
|
118
|
-
} = CatalogPublicModel.TaxonomyResponseSchema().validate(responseData, {
|
|
119
|
-
abortEarly: false,
|
|
120
|
-
allowUnknown: true,
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
if (res_error) {
|
|
124
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
125
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
126
|
-
} else {
|
|
127
|
-
Logger({
|
|
128
|
-
level: "WARN",
|
|
129
|
-
message: `Response Validation Warnings for public > Catalog > getTaxonomyByLevel \n ${res_error}`,
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
return response;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
module.exports = Catalog;
|