@gofynd/fdk-client-javascript 1.4.1 → 1.4.2-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +3 -2
- package/sdk/application/ApplicationClient.js +20 -0
- package/sdk/application/Cart/CartApplicationClient.d.ts +1 -1
- package/sdk/application/Cart/CartApplicationClient.js +3 -5
- package/sdk/application/Cart/CartApplicationModel.d.ts +1634 -1742
- package/sdk/application/Cart/CartApplicationModel.js +1388 -1464
- package/sdk/application/Cart/CartApplicationValidator.d.ts +0 -4
- package/sdk/application/Cart/CartApplicationValidator.js +0 -4
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +6 -3
- package/sdk/application/Catalog/CatalogApplicationClient.js +20 -7
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +1917 -1917
- package/sdk/application/Catalog/CatalogApplicationModel.js +1613 -1613
- package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +14 -0
- package/sdk/application/Catalog/CatalogApplicationValidator.js +6 -0
- package/sdk/application/Common/CommonApplicationModel.d.ts +235 -235
- package/sdk/application/Common/CommonApplicationModel.js +172 -172
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +72 -72
- package/sdk/application/Communication/CommunicationApplicationModel.js +64 -64
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +1492 -1626
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +1038 -1180
- package/sdk/application/Content/ContentApplicationClient.d.ts +0 -36
- package/sdk/application/Content/ContentApplicationClient.js +0 -246
- package/sdk/application/Content/ContentApplicationModel.d.ts +546 -753
- package/sdk/application/Content/ContentApplicationModel.js +565 -817
- package/sdk/application/Content/ContentApplicationValidator.d.ts +1 -40
- package/sdk/application/Content/ContentApplicationValidator.js +0 -41
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +79 -79
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +84 -84
- package/sdk/application/Lead/LeadApplicationModel.d.ts +417 -417
- package/sdk/application/Lead/LeadApplicationModel.js +301 -301
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +0 -67
- package/sdk/application/Logistic/LogisticApplicationClient.js +0 -547
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +257 -712
- package/sdk/application/Logistic/LogisticApplicationModel.js +267 -755
- package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +1 -211
- package/sdk/application/Logistic/LogisticApplicationValidator.js +0 -131
- package/sdk/application/Order/OrderApplicationClient.d.ts +3 -3
- package/sdk/application/Order/OrderApplicationClient.js +8 -32
- package/sdk/application/Order/OrderApplicationModel.d.ts +845 -853
- package/sdk/application/Order/OrderApplicationModel.js +816 -824
- package/sdk/application/Order/OrderApplicationValidator.d.ts +0 -20
- package/sdk/application/Order/OrderApplicationValidator.js +0 -8
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +2 -46
- package/sdk/application/Payment/PaymentApplicationClient.js +10 -341
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +1892 -2199
- package/sdk/application/Payment/PaymentApplicationModel.js +1235 -1506
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +14 -59
- package/sdk/application/Payment/PaymentApplicationValidator.js +10 -64
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +1396 -1429
- package/sdk/application/PosCart/PosCartApplicationModel.js +1233 -1257
- package/sdk/application/Rewards/RewardsApplicationModel.d.ts +214 -214
- package/sdk/application/Rewards/RewardsApplicationModel.js +211 -211
- package/sdk/application/Share/ShareApplicationModel.d.ts +114 -114
- package/sdk/application/Share/ShareApplicationModel.js +121 -121
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +1 -1
- package/sdk/application/Theme/ThemeApplicationClient.js +3 -7
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +783 -969
- package/sdk/application/Theme/ThemeApplicationModel.js +571 -867
- package/sdk/application/Theme/ThemeApplicationValidator.d.ts +0 -10
- package/sdk/application/Theme/ThemeApplicationValidator.js +0 -4
- package/sdk/application/User/UserApplicationClient.d.ts +0 -33
- package/sdk/application/User/UserApplicationClient.js +0 -239
- package/sdk/application/User/UserApplicationModel.d.ts +753 -768
- package/sdk/application/User/UserApplicationModel.js +731 -755
- package/sdk/application/User/UserApplicationValidator.d.ts +1 -34
- package/sdk/application/User/UserApplicationValidator.js +0 -36
- package/sdk/common/Clickstream.d.ts +1 -0
- package/sdk/common/Clickstream.js +254 -0
- package/sdk/common/Utility.js +1 -4
- package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +72 -60
- package/sdk/partner/FileStorage/FileStoragePartnerModel.js +70 -58
- package/sdk/partner/PartnerClient.d.ts +0 -6
- package/sdk/partner/PartnerClient.js +0 -9
- package/sdk/partner/Theme/ThemePartnerClient.d.ts +0 -10
- package/sdk/partner/Theme/ThemePartnerClient.js +0 -80
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +1178 -1153
- package/sdk/partner/Theme/ThemePartnerModel.js +830 -974
- package/sdk/partner/Theme/ThemePartnerValidator.d.ts +0 -1
- package/sdk/partner/Theme/ThemePartnerValidator.js +0 -9
- package/sdk/partner/index.d.ts +0 -3
- package/sdk/partner/index.js +0 -6
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +2 -2
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +123 -123
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +109 -109
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +1 -11
- package/sdk/platform/Billing/BillingPlatformClient.js +3 -110
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +734 -800
- package/sdk/platform/Billing/BillingPlatformModel.js +732 -810
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +4 -43
- package/sdk/platform/Billing/BillingPlatformValidator.js +2 -29
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +11 -1
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +81 -7
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +13 -5
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +12 -4
- package/sdk/platform/Cart/CartPlatformModel.d.ts +3223 -3328
- package/sdk/platform/Cart/CartPlatformModel.js +2875 -2946
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +11 -15
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +21 -52
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +0 -27
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +0 -11
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +15 -27
- package/sdk/platform/Catalog/CatalogPlatformClient.js +93 -189
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +617 -920
- package/sdk/platform/Catalog/CatalogPlatformModel.js +584 -919
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +27 -41
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +19 -31
- package/sdk/platform/Common/CommonPlatformModel.d.ts +255 -255
- package/sdk/platform/Common/CommonPlatformModel.js +187 -187
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +37 -139
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +52 -737
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +3 -133
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +1 -113
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +1079 -1228
- package/sdk/platform/Communication/CommunicationPlatformModel.js +1090 -1262
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +2 -8
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +4 -32
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +629 -658
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +641 -675
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +0 -14
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +0 -6
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +8 -8
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +4 -4
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +2992 -3231
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +2092 -2303
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +2 -2
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +2 -2
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +0 -391
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +1074 -3656
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +1 -351
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +0 -410
- package/sdk/platform/Content/ContentPlatformModel.d.ts +972 -2071
- package/sdk/platform/Content/ContentPlatformModel.js +1039 -2355
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +2 -2
- package/sdk/platform/Discount/DiscountPlatformClient.js +2 -2
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +174 -259
- package/sdk/platform/Discount/DiscountPlatformModel.js +163 -257
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +6 -16
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +8 -117
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +4 -55
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +2 -39
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +821 -892
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +833 -901
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +0 -33
- package/sdk/platform/Finance/FinancePlatformClient.js +0 -240
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +910 -1056
- package/sdk/platform/Finance/FinancePlatformModel.js +884 -1070
- package/sdk/platform/Finance/FinancePlatformValidator.d.ts +1 -38
- package/sdk/platform/Finance/FinancePlatformValidator.js +0 -38
- package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +942 -942
- package/sdk/platform/Inventory/InventoryPlatformModel.js +1003 -1003
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +28 -38
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +56 -137
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +29 -41
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +21 -33
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +601 -610
- package/sdk/platform/Lead/LeadPlatformModel.js +457 -471
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +1 -11
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +1 -93
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -28
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +0 -18
- package/sdk/platform/Order/OrderPlatformClient.d.ts +22 -143
- package/sdk/platform/Order/OrderPlatformClient.js +160 -1190
- package/sdk/platform/Order/OrderPlatformModel.d.ts +4451 -5275
- package/sdk/platform/Order/OrderPlatformModel.js +4039 -4994
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +21 -257
- package/sdk/platform/Order/OrderPlatformValidator.js +15 -216
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +22 -22
- package/sdk/platform/Partner/PartnerPlatformModel.js +22 -22
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +13 -119
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +40 -750
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +7 -143
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +6 -133
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +1 -1
- package/sdk/platform/Payment/PaymentPlatformClient.js +1 -1
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +2067 -2929
- package/sdk/platform/Payment/PaymentPlatformModel.js +1427 -2090
- package/sdk/platform/PlatformApplicationClient.d.ts +2 -2
- package/sdk/platform/PlatformApplicationClient.js +4 -4
- package/sdk/platform/PlatformClient.d.ts +2 -4
- package/sdk/platform/PlatformClient.js +4 -8
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +204 -204
- package/sdk/platform/Rewards/RewardsPlatformModel.js +199 -199
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +66 -142
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +147 -645
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +63 -131
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +47 -126
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +105 -217
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +349 -1138
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +990 -1589
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +986 -1702
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +133 -382
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +102 -266
- package/sdk/platform/Share/SharePlatformModel.d.ts +147 -147
- package/sdk/platform/Share/SharePlatformModel.js +139 -139
- package/sdk/platform/Theme/ThemePlatformClient.d.ts +1 -11
- package/sdk/platform/Theme/ThemePlatformClient.js +3 -87
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +765 -1133
- package/sdk/platform/Theme/ThemePlatformModel.js +561 -1009
- package/sdk/platform/Theme/ThemePlatformValidator.d.ts +4 -28
- package/sdk/platform/Theme/ThemePlatformValidator.js +2 -21
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +1 -116
- package/sdk/platform/User/UserPlatformApplicationClient.js +86 -932
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +7 -224
- package/sdk/platform/User/UserPlatformApplicationValidator.js +5 -173
- package/sdk/platform/User/UserPlatformModel.d.ts +428 -765
- package/sdk/platform/User/UserPlatformModel.js +428 -679
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +37 -45
- package/sdk/platform/Webhook/WebhookPlatformClient.js +57 -61
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +403 -448
- package/sdk/platform/Webhook/WebhookPlatformModel.js +309 -369
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +10 -7
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +6 -6
- package/sdk/platform/index.d.ts +1 -1
- package/sdk/platform/index.js +2 -2
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +237 -237
- package/sdk/public/Configuration/ConfigurationPublicModel.js +174 -174
- package/sdk/public/Inventory/InventoryPublicModel.d.ts +237 -237
- package/sdk/public/Inventory/InventoryPublicModel.js +257 -257
- package/sdk/public/Partner/PartnerPublicModel.d.ts +104 -104
- package/sdk/public/Partner/PartnerPublicModel.js +113 -113
- package/sdk/public/PublicClient.d.ts +0 -4
- package/sdk/public/PublicClient.js +0 -8
- package/sdk/public/Webhook/WebhookPublicClient.d.ts +0 -33
- package/sdk/public/Webhook/WebhookPublicClient.js +0 -242
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +15 -161
- package/sdk/public/Webhook/WebhookPublicModel.js +13 -189
- package/sdk/public/Webhook/WebhookPublicValidator.d.ts +1 -23
- package/sdk/public/Webhook/WebhookPublicValidator.js +0 -31
- package/sdk/public/index.d.ts +0 -2
- package/sdk/public/index.js +0 -4
- package/sdk/partner/Lead/LeadPartnerClient.d.ts +0 -125
- package/sdk/partner/Lead/LeadPartnerClient.js +0 -785
- package/sdk/partner/Lead/LeadPartnerModel.d.ts +0 -1127
- package/sdk/partner/Lead/LeadPartnerModel.js +0 -896
- package/sdk/partner/Lead/LeadPartnerValidator.d.ts +0 -12
- package/sdk/partner/Lead/LeadPartnerValidator.js +0 -67
- package/sdk/partner/Logistics/LogisticsPartnerClient.d.ts +0 -155
- package/sdk/partner/Logistics/LogisticsPartnerClient.js +0 -1195
- package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +0 -372
- package/sdk/partner/Logistics/LogisticsPartnerModel.js +0 -442
- package/sdk/partner/Logistics/LogisticsPartnerValidator.d.ts +0 -16
- package/sdk/partner/Logistics/LogisticsPartnerValidator.js +0 -123
- package/sdk/partner/Webhook/WebhookPartnerClient.d.ts +0 -99
- package/sdk/partner/Webhook/WebhookPartnerClient.js +0 -753
- package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +0 -566
- package/sdk/partner/Webhook/WebhookPartnerModel.js +0 -583
- package/sdk/partner/Webhook/WebhookPartnerValidator.d.ts +0 -12
- package/sdk/partner/Webhook/WebhookPartnerValidator.js +0 -74
- package/sdk/platform/Content/ContentPlatformClient.d.ts +0 -277
- package/sdk/platform/Content/ContentPlatformClient.js +0 -2011
- package/sdk/platform/Content/ContentPlatformValidator.d.ts +0 -247
- package/sdk/platform/Content/ContentPlatformValidator.js +0 -319
- package/sdk/public/Billing/BillingPublicClient.d.ts +0 -23
- package/sdk/public/Billing/BillingPublicClient.js +0 -116
- package/sdk/public/Billing/BillingPublicModel.d.ts +0 -92
- package/sdk/public/Billing/BillingPublicModel.js +0 -96
- package/sdk/public/Billing/BillingPublicValidator.d.ts +0 -18
- package/sdk/public/Billing/BillingPublicValidator.js +0 -19
- package/sdk/public/Content/ContentPublicClient.d.ts +0 -22
- package/sdk/public/Content/ContentPublicClient.js +0 -114
- package/sdk/public/Content/ContentPublicModel.d.ts +0 -53
- package/sdk/public/Content/ContentPublicModel.js +0 -60
- package/sdk/public/Content/ContentPublicValidator.d.ts +0 -18
- package/sdk/public/Content/ContentPublicValidator.js +0 -19
|
@@ -1,1195 +0,0 @@
|
|
|
1
|
-
const PartnerAPIClient = require("../PartnerAPIClient");
|
|
2
|
-
const {
|
|
3
|
-
FDKClientValidationError,
|
|
4
|
-
FDKResponseValidationError,
|
|
5
|
-
} = require("../../common/FDKError");
|
|
6
|
-
const Paginator = require("../../common/Paginator");
|
|
7
|
-
const LogisticsPartnerValidator = require("./LogisticsPartnerValidator");
|
|
8
|
-
const LogisticsPartnerModel = require("./LogisticsPartnerModel");
|
|
9
|
-
const { Logger } = require("./../../common/Logger");
|
|
10
|
-
const Joi = require("joi");
|
|
11
|
-
|
|
12
|
-
class Logistics {
|
|
13
|
-
constructor(config) {
|
|
14
|
-
this.config = config;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* @param {LogisticsPartnerValidator.SampleFileServiceabilityParam} arg - Arg object.
|
|
19
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
20
|
-
* @param {import("../PartnerAPIClient").Options} - Options
|
|
21
|
-
* @returns {Promise<LogisticsPartnerModel.BulkRegionServiceabilityTatResponseItemData>}
|
|
22
|
-
* - Success response
|
|
23
|
-
*
|
|
24
|
-
* @name sampleFileServiceability
|
|
25
|
-
* @summary: Sample File Download
|
|
26
|
-
* @description: Sample File Download - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/partner/logistics/sampleFileServiceability/).
|
|
27
|
-
*/
|
|
28
|
-
async sampleFileServiceability(
|
|
29
|
-
{ body, requestHeaders } = { requestHeaders: {} },
|
|
30
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
31
|
-
) {
|
|
32
|
-
const {
|
|
33
|
-
error,
|
|
34
|
-
} = LogisticsPartnerValidator.sampleFileServiceability().validate(
|
|
35
|
-
{
|
|
36
|
-
body,
|
|
37
|
-
},
|
|
38
|
-
{ abortEarly: false, allowUnknown: true }
|
|
39
|
-
);
|
|
40
|
-
if (error) {
|
|
41
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// Showing warrnings if extra unknown parameters are found
|
|
45
|
-
const {
|
|
46
|
-
error: warrning,
|
|
47
|
-
} = LogisticsPartnerValidator.sampleFileServiceability().validate(
|
|
48
|
-
{
|
|
49
|
-
body,
|
|
50
|
-
},
|
|
51
|
-
{ abortEarly: false, allowUnknown: false }
|
|
52
|
-
);
|
|
53
|
-
if (warrning) {
|
|
54
|
-
Logger({
|
|
55
|
-
level: "WARN",
|
|
56
|
-
message: `Parameter Validation warrnings for partner > Logistics > sampleFileServiceability \n ${warrning}`,
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const query_params = {};
|
|
61
|
-
|
|
62
|
-
const response = await PartnerAPIClient.execute(
|
|
63
|
-
this.config,
|
|
64
|
-
"post",
|
|
65
|
-
`/service/partner/logistics/v1.0/organization/${this.config.organizationId}/localities/bulk-sample`,
|
|
66
|
-
query_params,
|
|
67
|
-
body,
|
|
68
|
-
requestHeaders,
|
|
69
|
-
{ responseHeaders }
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
let responseData = response;
|
|
73
|
-
if (responseHeaders) {
|
|
74
|
-
responseData = response[0];
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const {
|
|
78
|
-
error: res_error,
|
|
79
|
-
} = LogisticsPartnerModel.BulkRegionServiceabilityTatResponseItemData().validate(
|
|
80
|
-
responseData,
|
|
81
|
-
{ abortEarly: false, allowUnknown: true }
|
|
82
|
-
);
|
|
83
|
-
|
|
84
|
-
if (res_error) {
|
|
85
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
86
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
87
|
-
} else {
|
|
88
|
-
Logger({
|
|
89
|
-
level: "WARN",
|
|
90
|
-
message: `Response Validation Warnings for partner > Logistics > sampleFileServiceability \n ${res_error}`,
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
return response;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* @param {LogisticsPartnerValidator.GetSampleFileServiceabilityStatusParam} arg
|
|
100
|
-
* - Arg object.
|
|
101
|
-
*
|
|
102
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
103
|
-
* @param {import("../PartnerAPIClient").Options} - Options
|
|
104
|
-
* @returns {Promise<LogisticsPartnerModel.BulkRegionServiceabilityTatResponse>}
|
|
105
|
-
* - Success response
|
|
106
|
-
*
|
|
107
|
-
* @name getSampleFileServiceabilityStatus
|
|
108
|
-
* @summary: Get Serviceability TAT sample files generator status
|
|
109
|
-
* @description: Get Serviceability TAT sample file generator status - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/partner/logistics/getSampleFileServiceabilityStatus/).
|
|
110
|
-
*/
|
|
111
|
-
async getSampleFileServiceabilityStatus(
|
|
112
|
-
{ pageNo, pageSize, batchId, requestHeaders } = { requestHeaders: {} },
|
|
113
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
114
|
-
) {
|
|
115
|
-
const {
|
|
116
|
-
error,
|
|
117
|
-
} = LogisticsPartnerValidator.getSampleFileServiceabilityStatus().validate(
|
|
118
|
-
{
|
|
119
|
-
pageNo,
|
|
120
|
-
pageSize,
|
|
121
|
-
batchId,
|
|
122
|
-
},
|
|
123
|
-
{ abortEarly: false, allowUnknown: true }
|
|
124
|
-
);
|
|
125
|
-
if (error) {
|
|
126
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// Showing warrnings if extra unknown parameters are found
|
|
130
|
-
const {
|
|
131
|
-
error: warrning,
|
|
132
|
-
} = LogisticsPartnerValidator.getSampleFileServiceabilityStatus().validate(
|
|
133
|
-
{
|
|
134
|
-
pageNo,
|
|
135
|
-
pageSize,
|
|
136
|
-
batchId,
|
|
137
|
-
},
|
|
138
|
-
{ abortEarly: false, allowUnknown: false }
|
|
139
|
-
);
|
|
140
|
-
if (warrning) {
|
|
141
|
-
Logger({
|
|
142
|
-
level: "WARN",
|
|
143
|
-
message: `Parameter Validation warrnings for partner > Logistics > getSampleFileServiceabilityStatus \n ${warrning}`,
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
const query_params = {};
|
|
148
|
-
query_params["page_no"] = pageNo;
|
|
149
|
-
query_params["page_size"] = pageSize;
|
|
150
|
-
query_params["batch_id"] = batchId;
|
|
151
|
-
|
|
152
|
-
const response = await PartnerAPIClient.execute(
|
|
153
|
-
this.config,
|
|
154
|
-
"get",
|
|
155
|
-
`/service/partner/logistics/v1.0/organization/${this.config.organizationId}/localities/bulk-sample`,
|
|
156
|
-
query_params,
|
|
157
|
-
undefined,
|
|
158
|
-
requestHeaders,
|
|
159
|
-
{ responseHeaders }
|
|
160
|
-
);
|
|
161
|
-
|
|
162
|
-
let responseData = response;
|
|
163
|
-
if (responseHeaders) {
|
|
164
|
-
responseData = response[0];
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
const {
|
|
168
|
-
error: res_error,
|
|
169
|
-
} = LogisticsPartnerModel.BulkRegionServiceabilityTatResponse().validate(
|
|
170
|
-
responseData,
|
|
171
|
-
{ abortEarly: false, allowUnknown: true }
|
|
172
|
-
);
|
|
173
|
-
|
|
174
|
-
if (res_error) {
|
|
175
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
176
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
177
|
-
} else {
|
|
178
|
-
Logger({
|
|
179
|
-
level: "WARN",
|
|
180
|
-
message: `Response Validation Warnings for partner > Logistics > getSampleFileServiceabilityStatus \n ${res_error}`,
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
return response;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* @param {LogisticsPartnerValidator.BulkTatParam} arg - Arg object.
|
|
190
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
191
|
-
* @param {import("../PartnerAPIClient").Options} - Options
|
|
192
|
-
* @returns {Promise<LogisticsPartnerModel.BulkRegionResponseItemData>} -
|
|
193
|
-
* Success response
|
|
194
|
-
* @name bulkTat
|
|
195
|
-
* @summary: Region TAT Import or Export
|
|
196
|
-
* @description: Region TAT Import or Export - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/partner/logistics/bulkTat/).
|
|
197
|
-
*/
|
|
198
|
-
async bulkTat(
|
|
199
|
-
{ extensionId, schemeId, body, requestHeaders } = { requestHeaders: {} },
|
|
200
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
201
|
-
) {
|
|
202
|
-
const { error } = LogisticsPartnerValidator.bulkTat().validate(
|
|
203
|
-
{
|
|
204
|
-
extensionId,
|
|
205
|
-
schemeId,
|
|
206
|
-
body,
|
|
207
|
-
},
|
|
208
|
-
{ abortEarly: false, allowUnknown: true }
|
|
209
|
-
);
|
|
210
|
-
if (error) {
|
|
211
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
// Showing warrnings if extra unknown parameters are found
|
|
215
|
-
const { error: warrning } = LogisticsPartnerValidator.bulkTat().validate(
|
|
216
|
-
{
|
|
217
|
-
extensionId,
|
|
218
|
-
schemeId,
|
|
219
|
-
body,
|
|
220
|
-
},
|
|
221
|
-
{ abortEarly: false, allowUnknown: false }
|
|
222
|
-
);
|
|
223
|
-
if (warrning) {
|
|
224
|
-
Logger({
|
|
225
|
-
level: "WARN",
|
|
226
|
-
message: `Parameter Validation warrnings for partner > Logistics > bulkTat \n ${warrning}`,
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
const query_params = {};
|
|
231
|
-
|
|
232
|
-
const response = await PartnerAPIClient.execute(
|
|
233
|
-
this.config,
|
|
234
|
-
"post",
|
|
235
|
-
`/service/partner/logistics/v1.0/organization/${this.config.organizationId}/courier-partner/${extensionId}/scheme/${schemeId}/tat`,
|
|
236
|
-
query_params,
|
|
237
|
-
body,
|
|
238
|
-
requestHeaders,
|
|
239
|
-
{ responseHeaders }
|
|
240
|
-
);
|
|
241
|
-
|
|
242
|
-
let responseData = response;
|
|
243
|
-
if (responseHeaders) {
|
|
244
|
-
responseData = response[0];
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
const {
|
|
248
|
-
error: res_error,
|
|
249
|
-
} = LogisticsPartnerModel.BulkRegionResponseItemData().validate(
|
|
250
|
-
responseData,
|
|
251
|
-
{ abortEarly: false, allowUnknown: true }
|
|
252
|
-
);
|
|
253
|
-
|
|
254
|
-
if (res_error) {
|
|
255
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
256
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
257
|
-
} else {
|
|
258
|
-
Logger({
|
|
259
|
-
level: "WARN",
|
|
260
|
-
message: `Response Validation Warnings for partner > Logistics > bulkTat \n ${res_error}`,
|
|
261
|
-
});
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
return response;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
* @param {LogisticsPartnerValidator.GetBulkTatParam} arg - Arg object.
|
|
270
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
271
|
-
* @param {import("../PartnerAPIClient").Options} - Options
|
|
272
|
-
* @returns {Promise<LogisticsPartnerModel.BulkRegionResponse>} - Success response
|
|
273
|
-
* @name getBulkTat
|
|
274
|
-
* @summary: Get region tat bulk history
|
|
275
|
-
* @description: Get region tat bulk history - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/partner/logistics/getBulkTat/).
|
|
276
|
-
*/
|
|
277
|
-
async getBulkTat(
|
|
278
|
-
{
|
|
279
|
-
extensionId,
|
|
280
|
-
schemeId,
|
|
281
|
-
pageNo,
|
|
282
|
-
pageSize,
|
|
283
|
-
batchId,
|
|
284
|
-
action,
|
|
285
|
-
status,
|
|
286
|
-
country,
|
|
287
|
-
region,
|
|
288
|
-
startDate,
|
|
289
|
-
endDate,
|
|
290
|
-
requestHeaders,
|
|
291
|
-
} = { requestHeaders: {} },
|
|
292
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
293
|
-
) {
|
|
294
|
-
const { error } = LogisticsPartnerValidator.getBulkTat().validate(
|
|
295
|
-
{
|
|
296
|
-
extensionId,
|
|
297
|
-
schemeId,
|
|
298
|
-
pageNo,
|
|
299
|
-
pageSize,
|
|
300
|
-
batchId,
|
|
301
|
-
action,
|
|
302
|
-
status,
|
|
303
|
-
country,
|
|
304
|
-
region,
|
|
305
|
-
startDate,
|
|
306
|
-
endDate,
|
|
307
|
-
},
|
|
308
|
-
{ abortEarly: false, allowUnknown: true }
|
|
309
|
-
);
|
|
310
|
-
if (error) {
|
|
311
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
// Showing warrnings if extra unknown parameters are found
|
|
315
|
-
const { error: warrning } = LogisticsPartnerValidator.getBulkTat().validate(
|
|
316
|
-
{
|
|
317
|
-
extensionId,
|
|
318
|
-
schemeId,
|
|
319
|
-
pageNo,
|
|
320
|
-
pageSize,
|
|
321
|
-
batchId,
|
|
322
|
-
action,
|
|
323
|
-
status,
|
|
324
|
-
country,
|
|
325
|
-
region,
|
|
326
|
-
startDate,
|
|
327
|
-
endDate,
|
|
328
|
-
},
|
|
329
|
-
{ abortEarly: false, allowUnknown: false }
|
|
330
|
-
);
|
|
331
|
-
if (warrning) {
|
|
332
|
-
Logger({
|
|
333
|
-
level: "WARN",
|
|
334
|
-
message: `Parameter Validation warrnings for partner > Logistics > getBulkTat \n ${warrning}`,
|
|
335
|
-
});
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
const query_params = {};
|
|
339
|
-
query_params["page_no"] = pageNo;
|
|
340
|
-
query_params["page_size"] = pageSize;
|
|
341
|
-
query_params["batch_id"] = batchId;
|
|
342
|
-
query_params["action"] = action;
|
|
343
|
-
query_params["status"] = status;
|
|
344
|
-
query_params["country"] = country;
|
|
345
|
-
query_params["region"] = region;
|
|
346
|
-
query_params["start_date"] = startDate;
|
|
347
|
-
query_params["end_date"] = endDate;
|
|
348
|
-
|
|
349
|
-
const response = await PartnerAPIClient.execute(
|
|
350
|
-
this.config,
|
|
351
|
-
"get",
|
|
352
|
-
`/service/partner/logistics/v1.0/organization/${this.config.organizationId}/courier-partner/${extensionId}/scheme/${schemeId}/tat`,
|
|
353
|
-
query_params,
|
|
354
|
-
undefined,
|
|
355
|
-
requestHeaders,
|
|
356
|
-
{ responseHeaders }
|
|
357
|
-
);
|
|
358
|
-
|
|
359
|
-
let responseData = response;
|
|
360
|
-
if (responseHeaders) {
|
|
361
|
-
responseData = response[0];
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
const {
|
|
365
|
-
error: res_error,
|
|
366
|
-
} = LogisticsPartnerModel.BulkRegionResponse().validate(responseData, {
|
|
367
|
-
abortEarly: false,
|
|
368
|
-
allowUnknown: true,
|
|
369
|
-
});
|
|
370
|
-
|
|
371
|
-
if (res_error) {
|
|
372
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
373
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
374
|
-
} else {
|
|
375
|
-
Logger({
|
|
376
|
-
level: "WARN",
|
|
377
|
-
message: `Response Validation Warnings for partner > Logistics > getBulkTat \n ${res_error}`,
|
|
378
|
-
});
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
return response;
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
/**
|
|
386
|
-
* @param {LogisticsPartnerValidator.BulkServiceabilityParam} arg - Arg object.
|
|
387
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
388
|
-
* @param {import("../PartnerAPIClient").Options} - Options
|
|
389
|
-
* @returns {Promise<LogisticsPartnerModel.BulkRegionResponseItemData>} -
|
|
390
|
-
* Success response
|
|
391
|
-
* @name bulkServiceability
|
|
392
|
-
* @summary: Serviceability Import or Export
|
|
393
|
-
* @description: Serviceability Import or Export - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/partner/logistics/bulkServiceability/).
|
|
394
|
-
*/
|
|
395
|
-
async bulkServiceability(
|
|
396
|
-
{ extensionId, schemeId, body, requestHeaders } = { requestHeaders: {} },
|
|
397
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
398
|
-
) {
|
|
399
|
-
const { error } = LogisticsPartnerValidator.bulkServiceability().validate(
|
|
400
|
-
{
|
|
401
|
-
extensionId,
|
|
402
|
-
schemeId,
|
|
403
|
-
body,
|
|
404
|
-
},
|
|
405
|
-
{ abortEarly: false, allowUnknown: true }
|
|
406
|
-
);
|
|
407
|
-
if (error) {
|
|
408
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
// Showing warrnings if extra unknown parameters are found
|
|
412
|
-
const {
|
|
413
|
-
error: warrning,
|
|
414
|
-
} = LogisticsPartnerValidator.bulkServiceability().validate(
|
|
415
|
-
{
|
|
416
|
-
extensionId,
|
|
417
|
-
schemeId,
|
|
418
|
-
body,
|
|
419
|
-
},
|
|
420
|
-
{ abortEarly: false, allowUnknown: false }
|
|
421
|
-
);
|
|
422
|
-
if (warrning) {
|
|
423
|
-
Logger({
|
|
424
|
-
level: "WARN",
|
|
425
|
-
message: `Parameter Validation warrnings for partner > Logistics > bulkServiceability \n ${warrning}`,
|
|
426
|
-
});
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
const query_params = {};
|
|
430
|
-
|
|
431
|
-
const response = await PartnerAPIClient.execute(
|
|
432
|
-
this.config,
|
|
433
|
-
"post",
|
|
434
|
-
`/service/partner/logistics/v1.0/organization/${this.config.organizationId}/courier-partner/${extensionId}/scheme/${schemeId}/serviceability/bulk`,
|
|
435
|
-
query_params,
|
|
436
|
-
body,
|
|
437
|
-
requestHeaders,
|
|
438
|
-
{ responseHeaders }
|
|
439
|
-
);
|
|
440
|
-
|
|
441
|
-
let responseData = response;
|
|
442
|
-
if (responseHeaders) {
|
|
443
|
-
responseData = response[0];
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
const {
|
|
447
|
-
error: res_error,
|
|
448
|
-
} = LogisticsPartnerModel.BulkRegionResponseItemData().validate(
|
|
449
|
-
responseData,
|
|
450
|
-
{ abortEarly: false, allowUnknown: true }
|
|
451
|
-
);
|
|
452
|
-
|
|
453
|
-
if (res_error) {
|
|
454
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
455
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
456
|
-
} else {
|
|
457
|
-
Logger({
|
|
458
|
-
level: "WARN",
|
|
459
|
-
message: `Response Validation Warnings for partner > Logistics > bulkServiceability \n ${res_error}`,
|
|
460
|
-
});
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
return response;
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
/**
|
|
468
|
-
* @param {LogisticsPartnerValidator.GetBulkServiceabilityParam} arg - Arg object.
|
|
469
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
470
|
-
* @param {import("../PartnerAPIClient").Options} - Options
|
|
471
|
-
* @returns {Promise<LogisticsPartnerModel.BulkRegionResponse>} - Success response
|
|
472
|
-
* @name getBulkServiceability
|
|
473
|
-
* @summary: Get Region Serviceability Bulk History
|
|
474
|
-
* @description: Get Region Serviceability Bulk History - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/partner/logistics/getBulkServiceability/).
|
|
475
|
-
*/
|
|
476
|
-
async getBulkServiceability(
|
|
477
|
-
{
|
|
478
|
-
extensionId,
|
|
479
|
-
schemeId,
|
|
480
|
-
pageNo,
|
|
481
|
-
pageSize,
|
|
482
|
-
batchId,
|
|
483
|
-
action,
|
|
484
|
-
status,
|
|
485
|
-
country,
|
|
486
|
-
region,
|
|
487
|
-
startDate,
|
|
488
|
-
endDate,
|
|
489
|
-
requestHeaders,
|
|
490
|
-
} = { requestHeaders: {} },
|
|
491
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
492
|
-
) {
|
|
493
|
-
const {
|
|
494
|
-
error,
|
|
495
|
-
} = LogisticsPartnerValidator.getBulkServiceability().validate(
|
|
496
|
-
{
|
|
497
|
-
extensionId,
|
|
498
|
-
schemeId,
|
|
499
|
-
pageNo,
|
|
500
|
-
pageSize,
|
|
501
|
-
batchId,
|
|
502
|
-
action,
|
|
503
|
-
status,
|
|
504
|
-
country,
|
|
505
|
-
region,
|
|
506
|
-
startDate,
|
|
507
|
-
endDate,
|
|
508
|
-
},
|
|
509
|
-
{ abortEarly: false, allowUnknown: true }
|
|
510
|
-
);
|
|
511
|
-
if (error) {
|
|
512
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
// Showing warrnings if extra unknown parameters are found
|
|
516
|
-
const {
|
|
517
|
-
error: warrning,
|
|
518
|
-
} = LogisticsPartnerValidator.getBulkServiceability().validate(
|
|
519
|
-
{
|
|
520
|
-
extensionId,
|
|
521
|
-
schemeId,
|
|
522
|
-
pageNo,
|
|
523
|
-
pageSize,
|
|
524
|
-
batchId,
|
|
525
|
-
action,
|
|
526
|
-
status,
|
|
527
|
-
country,
|
|
528
|
-
region,
|
|
529
|
-
startDate,
|
|
530
|
-
endDate,
|
|
531
|
-
},
|
|
532
|
-
{ abortEarly: false, allowUnknown: false }
|
|
533
|
-
);
|
|
534
|
-
if (warrning) {
|
|
535
|
-
Logger({
|
|
536
|
-
level: "WARN",
|
|
537
|
-
message: `Parameter Validation warrnings for partner > Logistics > getBulkServiceability \n ${warrning}`,
|
|
538
|
-
});
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
const query_params = {};
|
|
542
|
-
query_params["page_no"] = pageNo;
|
|
543
|
-
query_params["page_size"] = pageSize;
|
|
544
|
-
query_params["batch_id"] = batchId;
|
|
545
|
-
query_params["action"] = action;
|
|
546
|
-
query_params["status"] = status;
|
|
547
|
-
query_params["country"] = country;
|
|
548
|
-
query_params["region"] = region;
|
|
549
|
-
query_params["start_date"] = startDate;
|
|
550
|
-
query_params["end_date"] = endDate;
|
|
551
|
-
|
|
552
|
-
const response = await PartnerAPIClient.execute(
|
|
553
|
-
this.config,
|
|
554
|
-
"get",
|
|
555
|
-
`/service/partner/logistics/v1.0/organization/${this.config.organizationId}/courier-partner/${extensionId}/scheme/${schemeId}/serviceability/bulk`,
|
|
556
|
-
query_params,
|
|
557
|
-
undefined,
|
|
558
|
-
requestHeaders,
|
|
559
|
-
{ responseHeaders }
|
|
560
|
-
);
|
|
561
|
-
|
|
562
|
-
let responseData = response;
|
|
563
|
-
if (responseHeaders) {
|
|
564
|
-
responseData = response[0];
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
const {
|
|
568
|
-
error: res_error,
|
|
569
|
-
} = LogisticsPartnerModel.BulkRegionResponse().validate(responseData, {
|
|
570
|
-
abortEarly: false,
|
|
571
|
-
allowUnknown: true,
|
|
572
|
-
});
|
|
573
|
-
|
|
574
|
-
if (res_error) {
|
|
575
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
576
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
577
|
-
} else {
|
|
578
|
-
Logger({
|
|
579
|
-
level: "WARN",
|
|
580
|
-
message: `Response Validation Warnings for partner > Logistics > getBulkServiceability \n ${res_error}`,
|
|
581
|
-
});
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
return response;
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
/**
|
|
589
|
-
* @param {LogisticsPartnerValidator.CreateCourierPartnerAccountParam} arg
|
|
590
|
-
* - Arg object.
|
|
591
|
-
*
|
|
592
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
593
|
-
* @param {import("../PartnerAPIClient").Options} - Options
|
|
594
|
-
* @returns {Promise<LogisticsPartnerModel.CourierAccount>} - Success response
|
|
595
|
-
* @name createCourierPartnerAccount
|
|
596
|
-
* @summary: Creation of Courier Account
|
|
597
|
-
* @description: This API Creates a new Courier Account - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/partner/logistics/createCourierPartnerAccount/).
|
|
598
|
-
*/
|
|
599
|
-
async createCourierPartnerAccount(
|
|
600
|
-
{ companyId, body, requestHeaders } = { requestHeaders: {} },
|
|
601
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
602
|
-
) {
|
|
603
|
-
const {
|
|
604
|
-
error,
|
|
605
|
-
} = LogisticsPartnerValidator.createCourierPartnerAccount().validate(
|
|
606
|
-
{
|
|
607
|
-
companyId,
|
|
608
|
-
body,
|
|
609
|
-
},
|
|
610
|
-
{ abortEarly: false, allowUnknown: true }
|
|
611
|
-
);
|
|
612
|
-
if (error) {
|
|
613
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
// Showing warrnings if extra unknown parameters are found
|
|
617
|
-
const {
|
|
618
|
-
error: warrning,
|
|
619
|
-
} = LogisticsPartnerValidator.createCourierPartnerAccount().validate(
|
|
620
|
-
{
|
|
621
|
-
companyId,
|
|
622
|
-
body,
|
|
623
|
-
},
|
|
624
|
-
{ abortEarly: false, allowUnknown: false }
|
|
625
|
-
);
|
|
626
|
-
if (warrning) {
|
|
627
|
-
Logger({
|
|
628
|
-
level: "WARN",
|
|
629
|
-
message: `Parameter Validation warrnings for partner > Logistics > createCourierPartnerAccount \n ${warrning}`,
|
|
630
|
-
});
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
const query_params = {};
|
|
634
|
-
|
|
635
|
-
const response = await PartnerAPIClient.execute(
|
|
636
|
-
this.config,
|
|
637
|
-
"post",
|
|
638
|
-
`/service/partner/logistics/v1.0/organization/${this.config.organizationId}/company/${companyId}/courier-partner/account`,
|
|
639
|
-
query_params,
|
|
640
|
-
body,
|
|
641
|
-
requestHeaders,
|
|
642
|
-
{ responseHeaders }
|
|
643
|
-
);
|
|
644
|
-
|
|
645
|
-
let responseData = response;
|
|
646
|
-
if (responseHeaders) {
|
|
647
|
-
responseData = response[0];
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
const {
|
|
651
|
-
error: res_error,
|
|
652
|
-
} = LogisticsPartnerModel.CourierAccount().validate(responseData, {
|
|
653
|
-
abortEarly: false,
|
|
654
|
-
allowUnknown: true,
|
|
655
|
-
});
|
|
656
|
-
|
|
657
|
-
if (res_error) {
|
|
658
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
659
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
660
|
-
} else {
|
|
661
|
-
Logger({
|
|
662
|
-
level: "WARN",
|
|
663
|
-
message: `Response Validation Warnings for partner > Logistics > createCourierPartnerAccount \n ${res_error}`,
|
|
664
|
-
});
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
return response;
|
|
669
|
-
}
|
|
670
|
-
|
|
671
|
-
/**
|
|
672
|
-
* @param {LogisticsPartnerValidator.GetCourierPartnerAccountsParam} arg - Arg object.
|
|
673
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
674
|
-
* @param {import("../PartnerAPIClient").Options} - Options
|
|
675
|
-
* @returns {Promise<LogisticsPartnerModel.CompanyCourierPartnerAccountListResponse>}
|
|
676
|
-
* - Success response
|
|
677
|
-
*
|
|
678
|
-
* @name getCourierPartnerAccounts
|
|
679
|
-
* @summary: Getting Courier Account list of a company.
|
|
680
|
-
* @description: This API returns Courier Account of a company. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/partner/logistics/getCourierPartnerAccounts/).
|
|
681
|
-
*/
|
|
682
|
-
async getCourierPartnerAccounts(
|
|
683
|
-
{
|
|
684
|
-
companyId,
|
|
685
|
-
pageNo,
|
|
686
|
-
pageSize,
|
|
687
|
-
stage,
|
|
688
|
-
paymentMode,
|
|
689
|
-
transportType,
|
|
690
|
-
requestHeaders,
|
|
691
|
-
} = { requestHeaders: {} },
|
|
692
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
693
|
-
) {
|
|
694
|
-
const {
|
|
695
|
-
error,
|
|
696
|
-
} = LogisticsPartnerValidator.getCourierPartnerAccounts().validate(
|
|
697
|
-
{
|
|
698
|
-
companyId,
|
|
699
|
-
pageNo,
|
|
700
|
-
pageSize,
|
|
701
|
-
stage,
|
|
702
|
-
paymentMode,
|
|
703
|
-
transportType,
|
|
704
|
-
},
|
|
705
|
-
{ abortEarly: false, allowUnknown: true }
|
|
706
|
-
);
|
|
707
|
-
if (error) {
|
|
708
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
// Showing warrnings if extra unknown parameters are found
|
|
712
|
-
const {
|
|
713
|
-
error: warrning,
|
|
714
|
-
} = LogisticsPartnerValidator.getCourierPartnerAccounts().validate(
|
|
715
|
-
{
|
|
716
|
-
companyId,
|
|
717
|
-
pageNo,
|
|
718
|
-
pageSize,
|
|
719
|
-
stage,
|
|
720
|
-
paymentMode,
|
|
721
|
-
transportType,
|
|
722
|
-
},
|
|
723
|
-
{ abortEarly: false, allowUnknown: false }
|
|
724
|
-
);
|
|
725
|
-
if (warrning) {
|
|
726
|
-
Logger({
|
|
727
|
-
level: "WARN",
|
|
728
|
-
message: `Parameter Validation warrnings for partner > Logistics > getCourierPartnerAccounts \n ${warrning}`,
|
|
729
|
-
});
|
|
730
|
-
}
|
|
731
|
-
|
|
732
|
-
const query_params = {};
|
|
733
|
-
query_params["page_no"] = pageNo;
|
|
734
|
-
query_params["page_size"] = pageSize;
|
|
735
|
-
query_params["stage"] = stage;
|
|
736
|
-
query_params["payment_mode"] = paymentMode;
|
|
737
|
-
query_params["transport_type"] = transportType;
|
|
738
|
-
|
|
739
|
-
const response = await PartnerAPIClient.execute(
|
|
740
|
-
this.config,
|
|
741
|
-
"get",
|
|
742
|
-
`/service/partner/logistics/v1.0/organization/${this.config.organizationId}/company/${companyId}/courier-partner/account`,
|
|
743
|
-
query_params,
|
|
744
|
-
undefined,
|
|
745
|
-
requestHeaders,
|
|
746
|
-
{ responseHeaders }
|
|
747
|
-
);
|
|
748
|
-
|
|
749
|
-
let responseData = response;
|
|
750
|
-
if (responseHeaders) {
|
|
751
|
-
responseData = response[0];
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
const {
|
|
755
|
-
error: res_error,
|
|
756
|
-
} = LogisticsPartnerModel.CompanyCourierPartnerAccountListResponse().validate(
|
|
757
|
-
responseData,
|
|
758
|
-
{ abortEarly: false, allowUnknown: true }
|
|
759
|
-
);
|
|
760
|
-
|
|
761
|
-
if (res_error) {
|
|
762
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
763
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
764
|
-
} else {
|
|
765
|
-
Logger({
|
|
766
|
-
level: "WARN",
|
|
767
|
-
message: `Response Validation Warnings for partner > Logistics > getCourierPartnerAccounts \n ${res_error}`,
|
|
768
|
-
});
|
|
769
|
-
}
|
|
770
|
-
}
|
|
771
|
-
|
|
772
|
-
return response;
|
|
773
|
-
}
|
|
774
|
-
|
|
775
|
-
/**
|
|
776
|
-
* @param {LogisticsPartnerValidator.UpdateCourierPartnerAccountParam} arg
|
|
777
|
-
* - Arg object.
|
|
778
|
-
*
|
|
779
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
780
|
-
* @param {import("../PartnerAPIClient").Options} - Options
|
|
781
|
-
* @returns {Promise<LogisticsPartnerModel.CourierAccountResponse>} - Success response
|
|
782
|
-
* @name updateCourierPartnerAccount
|
|
783
|
-
* @summary: Update Courier Account in database.
|
|
784
|
-
* @description: Updates Courier Account - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/partner/logistics/updateCourierPartnerAccount/).
|
|
785
|
-
*/
|
|
786
|
-
async updateCourierPartnerAccount(
|
|
787
|
-
{ companyId, accountId, body, requestHeaders } = { requestHeaders: {} },
|
|
788
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
789
|
-
) {
|
|
790
|
-
const {
|
|
791
|
-
error,
|
|
792
|
-
} = LogisticsPartnerValidator.updateCourierPartnerAccount().validate(
|
|
793
|
-
{
|
|
794
|
-
companyId,
|
|
795
|
-
accountId,
|
|
796
|
-
body,
|
|
797
|
-
},
|
|
798
|
-
{ abortEarly: false, allowUnknown: true }
|
|
799
|
-
);
|
|
800
|
-
if (error) {
|
|
801
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
802
|
-
}
|
|
803
|
-
|
|
804
|
-
// Showing warrnings if extra unknown parameters are found
|
|
805
|
-
const {
|
|
806
|
-
error: warrning,
|
|
807
|
-
} = LogisticsPartnerValidator.updateCourierPartnerAccount().validate(
|
|
808
|
-
{
|
|
809
|
-
companyId,
|
|
810
|
-
accountId,
|
|
811
|
-
body,
|
|
812
|
-
},
|
|
813
|
-
{ abortEarly: false, allowUnknown: false }
|
|
814
|
-
);
|
|
815
|
-
if (warrning) {
|
|
816
|
-
Logger({
|
|
817
|
-
level: "WARN",
|
|
818
|
-
message: `Parameter Validation warrnings for partner > Logistics > updateCourierPartnerAccount \n ${warrning}`,
|
|
819
|
-
});
|
|
820
|
-
}
|
|
821
|
-
|
|
822
|
-
const query_params = {};
|
|
823
|
-
|
|
824
|
-
const response = await PartnerAPIClient.execute(
|
|
825
|
-
this.config,
|
|
826
|
-
"put",
|
|
827
|
-
`/service/partner/logistics/v1.0/organization/${this.config.organizationId}/company/${companyId}/courier-partner/account/${accountId}`,
|
|
828
|
-
query_params,
|
|
829
|
-
body,
|
|
830
|
-
requestHeaders,
|
|
831
|
-
{ responseHeaders }
|
|
832
|
-
);
|
|
833
|
-
|
|
834
|
-
let responseData = response;
|
|
835
|
-
if (responseHeaders) {
|
|
836
|
-
responseData = response[0];
|
|
837
|
-
}
|
|
838
|
-
|
|
839
|
-
const {
|
|
840
|
-
error: res_error,
|
|
841
|
-
} = LogisticsPartnerModel.CourierAccountResponse().validate(responseData, {
|
|
842
|
-
abortEarly: false,
|
|
843
|
-
allowUnknown: true,
|
|
844
|
-
});
|
|
845
|
-
|
|
846
|
-
if (res_error) {
|
|
847
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
848
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
849
|
-
} else {
|
|
850
|
-
Logger({
|
|
851
|
-
level: "WARN",
|
|
852
|
-
message: `Response Validation Warnings for partner > Logistics > updateCourierPartnerAccount \n ${res_error}`,
|
|
853
|
-
});
|
|
854
|
-
}
|
|
855
|
-
}
|
|
856
|
-
|
|
857
|
-
return response;
|
|
858
|
-
}
|
|
859
|
-
|
|
860
|
-
/**
|
|
861
|
-
* @param {LogisticsPartnerValidator.GetCourierPartnerAccountParam} arg - Arg object.
|
|
862
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
863
|
-
* @param {import("../PartnerAPIClient").Options} - Options
|
|
864
|
-
* @returns {Promise<LogisticsPartnerModel.CourierAccountResponse>} - Success response
|
|
865
|
-
* @name getCourierPartnerAccount
|
|
866
|
-
* @summary: Getting Courier Account of a company from database.
|
|
867
|
-
* @description: This API returns response DpAccount of a company from mongo database. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/partner/logistics/getCourierPartnerAccount/).
|
|
868
|
-
*/
|
|
869
|
-
async getCourierPartnerAccount(
|
|
870
|
-
{ companyId, accountId, requestHeaders } = { requestHeaders: {} },
|
|
871
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
872
|
-
) {
|
|
873
|
-
const {
|
|
874
|
-
error,
|
|
875
|
-
} = LogisticsPartnerValidator.getCourierPartnerAccount().validate(
|
|
876
|
-
{
|
|
877
|
-
companyId,
|
|
878
|
-
accountId,
|
|
879
|
-
},
|
|
880
|
-
{ abortEarly: false, allowUnknown: true }
|
|
881
|
-
);
|
|
882
|
-
if (error) {
|
|
883
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
884
|
-
}
|
|
885
|
-
|
|
886
|
-
// Showing warrnings if extra unknown parameters are found
|
|
887
|
-
const {
|
|
888
|
-
error: warrning,
|
|
889
|
-
} = LogisticsPartnerValidator.getCourierPartnerAccount().validate(
|
|
890
|
-
{
|
|
891
|
-
companyId,
|
|
892
|
-
accountId,
|
|
893
|
-
},
|
|
894
|
-
{ abortEarly: false, allowUnknown: false }
|
|
895
|
-
);
|
|
896
|
-
if (warrning) {
|
|
897
|
-
Logger({
|
|
898
|
-
level: "WARN",
|
|
899
|
-
message: `Parameter Validation warrnings for partner > Logistics > getCourierPartnerAccount \n ${warrning}`,
|
|
900
|
-
});
|
|
901
|
-
}
|
|
902
|
-
|
|
903
|
-
const query_params = {};
|
|
904
|
-
|
|
905
|
-
const response = await PartnerAPIClient.execute(
|
|
906
|
-
this.config,
|
|
907
|
-
"get",
|
|
908
|
-
`/service/partner/logistics/v1.0/organization/${this.config.organizationId}/company/${companyId}/courier-partner/account/${accountId}`,
|
|
909
|
-
query_params,
|
|
910
|
-
undefined,
|
|
911
|
-
requestHeaders,
|
|
912
|
-
{ responseHeaders }
|
|
913
|
-
);
|
|
914
|
-
|
|
915
|
-
let responseData = response;
|
|
916
|
-
if (responseHeaders) {
|
|
917
|
-
responseData = response[0];
|
|
918
|
-
}
|
|
919
|
-
|
|
920
|
-
const {
|
|
921
|
-
error: res_error,
|
|
922
|
-
} = LogisticsPartnerModel.CourierAccountResponse().validate(responseData, {
|
|
923
|
-
abortEarly: false,
|
|
924
|
-
allowUnknown: true,
|
|
925
|
-
});
|
|
926
|
-
|
|
927
|
-
if (res_error) {
|
|
928
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
929
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
930
|
-
} else {
|
|
931
|
-
Logger({
|
|
932
|
-
level: "WARN",
|
|
933
|
-
message: `Response Validation Warnings for partner > Logistics > getCourierPartnerAccount \n ${res_error}`,
|
|
934
|
-
});
|
|
935
|
-
}
|
|
936
|
-
}
|
|
937
|
-
|
|
938
|
-
return response;
|
|
939
|
-
}
|
|
940
|
-
|
|
941
|
-
/**
|
|
942
|
-
* @param {LogisticsPartnerValidator.CreateCourierPartnerSchemeParam} arg -
|
|
943
|
-
* Arg object.
|
|
944
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
945
|
-
* @param {import("../PartnerAPIClient").Options} - Options
|
|
946
|
-
* @returns {Promise<LogisticsPartnerModel.CourierPartnerSchemeModel>} -
|
|
947
|
-
* Success response
|
|
948
|
-
* @name createCourierPartnerScheme
|
|
949
|
-
* @summary: Create Scheme for courier partner extension
|
|
950
|
-
* @description: Create Scheme for courier partner extension - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/partner/logistics/createCourierPartnerScheme/).
|
|
951
|
-
*/
|
|
952
|
-
async createCourierPartnerScheme(
|
|
953
|
-
{ body, requestHeaders } = { requestHeaders: {} },
|
|
954
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
955
|
-
) {
|
|
956
|
-
const {
|
|
957
|
-
error,
|
|
958
|
-
} = LogisticsPartnerValidator.createCourierPartnerScheme().validate(
|
|
959
|
-
{
|
|
960
|
-
body,
|
|
961
|
-
},
|
|
962
|
-
{ abortEarly: false, allowUnknown: true }
|
|
963
|
-
);
|
|
964
|
-
if (error) {
|
|
965
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
966
|
-
}
|
|
967
|
-
|
|
968
|
-
// Showing warrnings if extra unknown parameters are found
|
|
969
|
-
const {
|
|
970
|
-
error: warrning,
|
|
971
|
-
} = LogisticsPartnerValidator.createCourierPartnerScheme().validate(
|
|
972
|
-
{
|
|
973
|
-
body,
|
|
974
|
-
},
|
|
975
|
-
{ abortEarly: false, allowUnknown: false }
|
|
976
|
-
);
|
|
977
|
-
if (warrning) {
|
|
978
|
-
Logger({
|
|
979
|
-
level: "WARN",
|
|
980
|
-
message: `Parameter Validation warrnings for partner > Logistics > createCourierPartnerScheme \n ${warrning}`,
|
|
981
|
-
});
|
|
982
|
-
}
|
|
983
|
-
|
|
984
|
-
const query_params = {};
|
|
985
|
-
|
|
986
|
-
const response = await PartnerAPIClient.execute(
|
|
987
|
-
this.config,
|
|
988
|
-
"post",
|
|
989
|
-
`/service/partner/logistics/v1.0/organization/${this.config.organizationId}/courier-partner/scheme/`,
|
|
990
|
-
query_params,
|
|
991
|
-
body,
|
|
992
|
-
requestHeaders,
|
|
993
|
-
{ responseHeaders }
|
|
994
|
-
);
|
|
995
|
-
|
|
996
|
-
let responseData = response;
|
|
997
|
-
if (responseHeaders) {
|
|
998
|
-
responseData = response[0];
|
|
999
|
-
}
|
|
1000
|
-
|
|
1001
|
-
const {
|
|
1002
|
-
error: res_error,
|
|
1003
|
-
} = LogisticsPartnerModel.CourierPartnerSchemeModel().validate(
|
|
1004
|
-
responseData,
|
|
1005
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1006
|
-
);
|
|
1007
|
-
|
|
1008
|
-
if (res_error) {
|
|
1009
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
1010
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1011
|
-
} else {
|
|
1012
|
-
Logger({
|
|
1013
|
-
level: "WARN",
|
|
1014
|
-
message: `Response Validation Warnings for partner > Logistics > createCourierPartnerScheme \n ${res_error}`,
|
|
1015
|
-
});
|
|
1016
|
-
}
|
|
1017
|
-
}
|
|
1018
|
-
|
|
1019
|
-
return response;
|
|
1020
|
-
}
|
|
1021
|
-
|
|
1022
|
-
/**
|
|
1023
|
-
* @param {LogisticsPartnerValidator.UpdateCourierPartnerSchemeParam} arg -
|
|
1024
|
-
* Arg object.
|
|
1025
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1026
|
-
* @param {import("../PartnerAPIClient").Options} - Options
|
|
1027
|
-
* @returns {Promise<LogisticsPartnerModel.CourierPartnerSchemeUpdateRequest>}
|
|
1028
|
-
* - Success response
|
|
1029
|
-
*
|
|
1030
|
-
* @name updateCourierPartnerScheme
|
|
1031
|
-
* @summary: Update Scheme for courier partner extension
|
|
1032
|
-
* @description: Update Scheme for courier partner extension - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/partner/logistics/updateCourierPartnerScheme/).
|
|
1033
|
-
*/
|
|
1034
|
-
async updateCourierPartnerScheme(
|
|
1035
|
-
{ schemeId, body, requestHeaders } = { requestHeaders: {} },
|
|
1036
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
1037
|
-
) {
|
|
1038
|
-
const {
|
|
1039
|
-
error,
|
|
1040
|
-
} = LogisticsPartnerValidator.updateCourierPartnerScheme().validate(
|
|
1041
|
-
{
|
|
1042
|
-
schemeId,
|
|
1043
|
-
body,
|
|
1044
|
-
},
|
|
1045
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1046
|
-
);
|
|
1047
|
-
if (error) {
|
|
1048
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1049
|
-
}
|
|
1050
|
-
|
|
1051
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1052
|
-
const {
|
|
1053
|
-
error: warrning,
|
|
1054
|
-
} = LogisticsPartnerValidator.updateCourierPartnerScheme().validate(
|
|
1055
|
-
{
|
|
1056
|
-
schemeId,
|
|
1057
|
-
body,
|
|
1058
|
-
},
|
|
1059
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1060
|
-
);
|
|
1061
|
-
if (warrning) {
|
|
1062
|
-
Logger({
|
|
1063
|
-
level: "WARN",
|
|
1064
|
-
message: `Parameter Validation warrnings for partner > Logistics > updateCourierPartnerScheme \n ${warrning}`,
|
|
1065
|
-
});
|
|
1066
|
-
}
|
|
1067
|
-
|
|
1068
|
-
const query_params = {};
|
|
1069
|
-
|
|
1070
|
-
const response = await PartnerAPIClient.execute(
|
|
1071
|
-
this.config,
|
|
1072
|
-
"put",
|
|
1073
|
-
`/service/partner/logistics/v1.0/organization/${this.config.organizationId}/courier-partner/scheme/${schemeId}`,
|
|
1074
|
-
query_params,
|
|
1075
|
-
body,
|
|
1076
|
-
requestHeaders,
|
|
1077
|
-
{ responseHeaders }
|
|
1078
|
-
);
|
|
1079
|
-
|
|
1080
|
-
let responseData = response;
|
|
1081
|
-
if (responseHeaders) {
|
|
1082
|
-
responseData = response[0];
|
|
1083
|
-
}
|
|
1084
|
-
|
|
1085
|
-
const {
|
|
1086
|
-
error: res_error,
|
|
1087
|
-
} = LogisticsPartnerModel.CourierPartnerSchemeUpdateRequest().validate(
|
|
1088
|
-
responseData,
|
|
1089
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1090
|
-
);
|
|
1091
|
-
|
|
1092
|
-
if (res_error) {
|
|
1093
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
1094
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1095
|
-
} else {
|
|
1096
|
-
Logger({
|
|
1097
|
-
level: "WARN",
|
|
1098
|
-
message: `Response Validation Warnings for partner > Logistics > updateCourierPartnerScheme \n ${res_error}`,
|
|
1099
|
-
});
|
|
1100
|
-
}
|
|
1101
|
-
}
|
|
1102
|
-
|
|
1103
|
-
return response;
|
|
1104
|
-
}
|
|
1105
|
-
|
|
1106
|
-
/**
|
|
1107
|
-
* @param {LogisticsPartnerValidator.GetCountriesParam} arg - Arg object.
|
|
1108
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1109
|
-
* @param {import("../PartnerAPIClient").Options} - Options
|
|
1110
|
-
* @returns {Promise<LogisticsPartnerModel.GetCountries>} - Success response
|
|
1111
|
-
* @name getCountries
|
|
1112
|
-
* @summary: Get all countries and associated data.
|
|
1113
|
-
* @description: Retrieve of all countries. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/partner/logistics/getCountries/).
|
|
1114
|
-
*/
|
|
1115
|
-
async getCountries(
|
|
1116
|
-
{ onboarding, pageNo, pageSize, q, requestHeaders } = {
|
|
1117
|
-
requestHeaders: {},
|
|
1118
|
-
},
|
|
1119
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
1120
|
-
) {
|
|
1121
|
-
const { error } = LogisticsPartnerValidator.getCountries().validate(
|
|
1122
|
-
{
|
|
1123
|
-
onboarding,
|
|
1124
|
-
pageNo,
|
|
1125
|
-
pageSize,
|
|
1126
|
-
q,
|
|
1127
|
-
},
|
|
1128
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1129
|
-
);
|
|
1130
|
-
if (error) {
|
|
1131
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1132
|
-
}
|
|
1133
|
-
|
|
1134
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1135
|
-
const {
|
|
1136
|
-
error: warrning,
|
|
1137
|
-
} = LogisticsPartnerValidator.getCountries().validate(
|
|
1138
|
-
{
|
|
1139
|
-
onboarding,
|
|
1140
|
-
pageNo,
|
|
1141
|
-
pageSize,
|
|
1142
|
-
q,
|
|
1143
|
-
},
|
|
1144
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1145
|
-
);
|
|
1146
|
-
if (warrning) {
|
|
1147
|
-
Logger({
|
|
1148
|
-
level: "WARN",
|
|
1149
|
-
message: `Parameter Validation warrnings for partner > Logistics > getCountries \n ${warrning}`,
|
|
1150
|
-
});
|
|
1151
|
-
}
|
|
1152
|
-
|
|
1153
|
-
const query_params = {};
|
|
1154
|
-
query_params["onboarding"] = onboarding;
|
|
1155
|
-
query_params["page_no"] = pageNo;
|
|
1156
|
-
query_params["page_size"] = pageSize;
|
|
1157
|
-
query_params["q"] = q;
|
|
1158
|
-
|
|
1159
|
-
const response = await PartnerAPIClient.execute(
|
|
1160
|
-
this.config,
|
|
1161
|
-
"get",
|
|
1162
|
-
`/service/partner/logistics/v1.0/organization/${this.config.organizationId}/countries`,
|
|
1163
|
-
query_params,
|
|
1164
|
-
undefined,
|
|
1165
|
-
requestHeaders,
|
|
1166
|
-
{ responseHeaders }
|
|
1167
|
-
);
|
|
1168
|
-
|
|
1169
|
-
let responseData = response;
|
|
1170
|
-
if (responseHeaders) {
|
|
1171
|
-
responseData = response[0];
|
|
1172
|
-
}
|
|
1173
|
-
|
|
1174
|
-
const {
|
|
1175
|
-
error: res_error,
|
|
1176
|
-
} = LogisticsPartnerModel.GetCountries().validate(responseData, {
|
|
1177
|
-
abortEarly: false,
|
|
1178
|
-
allowUnknown: true,
|
|
1179
|
-
});
|
|
1180
|
-
|
|
1181
|
-
if (res_error) {
|
|
1182
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
1183
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1184
|
-
} else {
|
|
1185
|
-
Logger({
|
|
1186
|
-
level: "WARN",
|
|
1187
|
-
message: `Response Validation Warnings for partner > Logistics > getCountries \n ${res_error}`,
|
|
1188
|
-
});
|
|
1189
|
-
}
|
|
1190
|
-
}
|
|
1191
|
-
|
|
1192
|
-
return response;
|
|
1193
|
-
}
|
|
1194
|
-
}
|
|
1195
|
-
module.exports = Logistics;
|