@gofynd/fdk-client-javascript 1.6.3 → 2.0.0
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/Cart/CartApplicationClient.d.ts +5 -5
- package/sdk/application/Cart/CartApplicationClient.js +26 -268
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +20 -20
- package/sdk/application/Catalog/CatalogApplicationClient.js +98 -347
- package/sdk/application/Common/CommonApplicationClient.js +1 -16
- package/sdk/application/Communication/CommunicationApplicationClient.js +1 -24
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +24 -2
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +58 -137
- package/sdk/application/Content/ContentApplicationClient.d.ts +47 -7
- package/sdk/application/Content/ContentApplicationClient.js +222 -191
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +2 -2
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +11 -30
- package/sdk/application/Finance/FinanceApplicationClient.js +1 -16
- package/sdk/application/Lead/LeadApplicationClient.d.ts +4 -4
- package/sdk/application/Lead/LeadApplicationClient.js +21 -52
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +16 -56
- package/sdk/application/Logistic/LogisticApplicationClient.js +57 -332
- package/sdk/application/Order/OrderApplicationClient.d.ts +11 -11
- package/sdk/application/Order/OrderApplicationClient.js +68 -153
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +2 -12
- package/sdk/application/Payment/PaymentApplicationClient.js +7 -487
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +1 -1
- package/sdk/application/Rewards/RewardsApplicationClient.js +6 -59
- package/sdk/application/Share/ShareApplicationClient.d.ts +4 -4
- package/sdk/application/Share/ShareApplicationClient.js +21 -75
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +3 -3
- package/sdk/application/Theme/ThemeApplicationClient.js +19 -47
- package/sdk/application/User/UserApplicationClient.js +1 -407
- package/sdk/application/Webhook/WebhookApplicationClient.js +1 -8
- package/sdk/common/Utility.d.ts +1 -1
- package/sdk/common/Utility.js +4 -4
- package/sdk/common/Validator.d.ts +1 -0
- package/sdk/common/Validator.js +20 -0
- package/sdk/partner/FileStorage/FileStoragePartnerClient.d.ts +1 -55
- package/sdk/partner/FileStorage/FileStoragePartnerClient.js +1 -408
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.d.ts +0 -5
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.js +0 -37
- package/sdk/partner/Lead/LeadPartnerModel.d.ts +5 -0
- package/sdk/partner/Lead/LeadPartnerModel.js +2 -0
- package/sdk/partner/Logistics/LogisticsPartnerClient.d.ts +29 -25
- package/sdk/partner/Logistics/LogisticsPartnerClient.js +65 -42
- package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +1008 -794
- package/sdk/partner/Logistics/LogisticsPartnerModel.js +573 -460
- package/sdk/partner/Logistics/LogisticsPartnerValidator.js +10 -5
- package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +64 -1
- package/sdk/partner/Webhook/WebhookPartnerModel.js +36 -0
- package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +5 -0
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +2 -0
- package/sdk/platform/Cart/CartPlatformModel.d.ts +67 -9
- package/sdk/platform/Cart/CartPlatformModel.js +38 -5
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1 -1
- package/sdk/platform/Catalog/CatalogPlatformClient.js +4 -4
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +47 -13
- package/sdk/platform/Catalog/CatalogPlatformModel.js +29 -7
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +2 -2
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +7 -4
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +71 -7
- package/sdk/platform/Communication/CommunicationPlatformModel.js +70 -6
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +0 -27
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +8 -60
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +31 -20
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +18 -18
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +1 -1
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +3 -3
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +13 -0
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +30 -1
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +68 -11
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +49 -7
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +169 -0
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +1279 -132
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +156 -1
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +180 -0
- package/sdk/platform/Content/ContentPlatformClient.d.ts +162 -0
- package/sdk/platform/Content/ContentPlatformClient.js +1697 -497
- package/sdk/platform/Content/ContentPlatformModel.d.ts +1053 -35
- package/sdk/platform/Content/ContentPlatformModel.js +717 -34
- package/sdk/platform/Content/ContentPlatformValidator.d.ts +127 -1
- package/sdk/platform/Content/ContentPlatformValidator.js +171 -0
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +34 -0
- package/sdk/platform/Discount/DiscountPlatformClient.js +59 -0
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +365 -93
- package/sdk/platform/Discount/DiscountPlatformModel.js +98 -93
- package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +54 -34
- package/sdk/platform/Discount/DiscountPlatformValidator.js +27 -17
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +0 -156
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +0 -1072
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +1 -137
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +0 -173
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +1 -1105
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +0 -1125
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +5 -0
- package/sdk/platform/Lead/LeadPlatformModel.js +2 -0
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +0 -10
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +0 -92
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -28
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +0 -18
- package/sdk/platform/Order/OrderPlatformClient.d.ts +212 -0
- package/sdk/platform/Order/OrderPlatformClient.js +397 -0
- package/sdk/platform/Order/OrderPlatformModel.d.ts +66 -10
- package/sdk/platform/Order/OrderPlatformModel.js +39 -7
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +33 -1
- package/sdk/platform/Order/OrderPlatformValidator.js +20 -0
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +58 -10
- package/sdk/platform/Partner/PartnerPlatformModel.js +19 -10
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +12 -2
- package/sdk/platform/Payment/PaymentPlatformModel.js +8 -2
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +5 -0
- package/sdk/platform/Rewards/RewardsPlatformModel.js +2 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +240 -24
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +1753 -277
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +320 -22
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +269 -19
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +53 -104
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +201 -629
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +5720 -2891
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +3414 -2181
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +138 -216
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +81 -148
- package/sdk/platform/Share/SharePlatformModel.d.ts +5 -0
- package/sdk/platform/Share/SharePlatformModel.js +2 -0
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +73 -0
- package/sdk/platform/User/UserPlatformApplicationClient.js +543 -0
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +129 -1
- package/sdk/platform/User/UserPlatformApplicationValidator.js +97 -0
- package/sdk/platform/User/UserPlatformModel.d.ts +269 -6
- package/sdk/platform/User/UserPlatformModel.js +187 -5
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +64 -1
- package/sdk/platform/Webhook/WebhookPlatformModel.js +36 -0
- package/sdk/public/Catalog/CatalogPublicClient.d.ts +1 -1
- package/sdk/public/Catalog/CatalogPublicClient.js +6 -11
- package/sdk/public/Configuration/ConfigurationPublicClient.js +1 -16
- package/sdk/public/Content/ContentPublicClient.d.ts +36 -3
- package/sdk/public/Content/ContentPublicClient.js +261 -104
- package/sdk/public/Content/ContentPublicModel.d.ts +155 -1
- package/sdk/public/Content/ContentPublicModel.js +102 -0
- package/sdk/public/Content/ContentPublicValidator.d.ts +18 -1
- package/sdk/public/Content/ContentPublicValidator.js +26 -0
- package/sdk/public/Partner/PartnerPublicClient.d.ts +1 -1
- package/sdk/public/Partner/PartnerPublicClient.js +6 -11
- package/sdk/public/Partner/PartnerPublicModel.d.ts +248 -72
- package/sdk/public/Partner/PartnerPublicModel.js +81 -71
- package/sdk/public/Partner/PartnerPublicValidator.d.ts +2 -2
- package/sdk/public/Partner/PartnerPublicValidator.js +1 -1
- package/sdk/public/Webhook/WebhookPublicClient.js +1 -40
|
@@ -68,7 +68,7 @@ class Serviceability {
|
|
|
68
68
|
const response = await PlatformAPIClient.execute(
|
|
69
69
|
this.config,
|
|
70
70
|
"post",
|
|
71
|
-
`/service/platform/logistics/
|
|
71
|
+
`/service/platform/logistics/v2.0/company/${this.config.companyId}/courier-partner/${extensionId}/scheme/${schemeId}/serviceability/bulk`,
|
|
72
72
|
query_params,
|
|
73
73
|
body,
|
|
74
74
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -154,7 +154,7 @@ class Serviceability {
|
|
|
154
154
|
const response = await PlatformAPIClient.execute(
|
|
155
155
|
this.config,
|
|
156
156
|
"post",
|
|
157
|
-
`/service/platform/logistics/
|
|
157
|
+
`/service/platform/logistics/v2.0/company/${this.config.companyId}/courier-partner/${extensionId}/scheme/${schemeId}/tat`,
|
|
158
158
|
query_params,
|
|
159
159
|
body,
|
|
160
160
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -193,10 +193,12 @@ class Serviceability {
|
|
|
193
193
|
*
|
|
194
194
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
195
195
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
196
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
196
|
+
* @returns {Promise<ServiceabilityPlatformModel.CourierAccountDetailsBody>}
|
|
197
|
+
* - Success response
|
|
198
|
+
*
|
|
197
199
|
* @name createCourierPartnerAccount
|
|
198
200
|
* @summary: Create courier account
|
|
199
|
-
* @description:
|
|
201
|
+
* @description: Retrieves a list of courier partner accounts. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/createCourierPartnerAccount/).
|
|
200
202
|
*/
|
|
201
203
|
async createCourierPartnerAccount(
|
|
202
204
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
@@ -251,10 +253,10 @@ class Serviceability {
|
|
|
251
253
|
|
|
252
254
|
const {
|
|
253
255
|
error: res_error,
|
|
254
|
-
} = ServiceabilityPlatformModel.
|
|
255
|
-
|
|
256
|
-
allowUnknown: true
|
|
257
|
-
|
|
256
|
+
} = ServiceabilityPlatformModel.CourierAccountDetailsBody().validate(
|
|
257
|
+
responseData,
|
|
258
|
+
{ abortEarly: false, allowUnknown: true }
|
|
259
|
+
);
|
|
258
260
|
|
|
259
261
|
if (res_error) {
|
|
260
262
|
if (this.config.options.strictResponseCheck === true) {
|
|
@@ -276,7 +278,7 @@ class Serviceability {
|
|
|
276
278
|
*
|
|
277
279
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
278
280
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
279
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
281
|
+
* @returns {Promise<ServiceabilityPlatformModel.CourierPartnerSchemeModelSchema>}
|
|
280
282
|
* - Success response
|
|
281
283
|
*
|
|
282
284
|
* @name createCourierPartnerScheme
|
|
@@ -336,7 +338,7 @@ class Serviceability {
|
|
|
336
338
|
|
|
337
339
|
const {
|
|
338
340
|
error: res_error,
|
|
339
|
-
} = ServiceabilityPlatformModel.
|
|
341
|
+
} = ServiceabilityPlatformModel.CourierPartnerSchemeModelSchema().validate(
|
|
340
342
|
responseData,
|
|
341
343
|
{ abortEarly: false, allowUnknown: true }
|
|
342
344
|
);
|
|
@@ -368,7 +370,7 @@ class Serviceability {
|
|
|
368
370
|
* @description: Creates a packaging material - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/createPackageMaterial/).
|
|
369
371
|
*/
|
|
370
372
|
async createPackageMaterial(
|
|
371
|
-
{ body, requestHeaders } = { requestHeaders: {} },
|
|
373
|
+
{ body, pageNo, requestHeaders } = { requestHeaders: {} },
|
|
372
374
|
{ responseHeaders } = { responseHeaders: false }
|
|
373
375
|
) {
|
|
374
376
|
const {
|
|
@@ -376,6 +378,7 @@ class Serviceability {
|
|
|
376
378
|
} = ServiceabilityPlatformValidator.createPackageMaterial().validate(
|
|
377
379
|
{
|
|
378
380
|
body,
|
|
381
|
+
pageNo,
|
|
379
382
|
},
|
|
380
383
|
{ abortEarly: false, allowUnknown: true }
|
|
381
384
|
);
|
|
@@ -389,6 +392,7 @@ class Serviceability {
|
|
|
389
392
|
} = ServiceabilityPlatformValidator.createPackageMaterial().validate(
|
|
390
393
|
{
|
|
391
394
|
body,
|
|
395
|
+
pageNo,
|
|
392
396
|
},
|
|
393
397
|
{ abortEarly: false, allowUnknown: false }
|
|
394
398
|
);
|
|
@@ -400,6 +404,7 @@ class Serviceability {
|
|
|
400
404
|
}
|
|
401
405
|
|
|
402
406
|
const query_params = {};
|
|
407
|
+
query_params["page_no"] = pageNo;
|
|
403
408
|
|
|
404
409
|
const xHeaders = {};
|
|
405
410
|
|
|
@@ -523,161 +528,6 @@ class Serviceability {
|
|
|
523
528
|
return response;
|
|
524
529
|
}
|
|
525
530
|
|
|
526
|
-
/**
|
|
527
|
-
* @param {ServiceabilityPlatformValidator.CreateZoneParam} arg - Arg object
|
|
528
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
529
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
530
|
-
* @returns {Promise<ServiceabilityPlatformModel.ZoneResult>} - Success response
|
|
531
|
-
* @name createZone
|
|
532
|
-
* @summary: Create zone
|
|
533
|
-
* @description: Creates a delivery zone. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/createZone/).
|
|
534
|
-
*/
|
|
535
|
-
async createZone(
|
|
536
|
-
{ body, requestHeaders } = { requestHeaders: {} },
|
|
537
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
538
|
-
) {
|
|
539
|
-
const { error } = ServiceabilityPlatformValidator.createZone().validate(
|
|
540
|
-
{
|
|
541
|
-
body,
|
|
542
|
-
},
|
|
543
|
-
{ abortEarly: false, allowUnknown: true }
|
|
544
|
-
);
|
|
545
|
-
if (error) {
|
|
546
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
// Showing warrnings if extra unknown parameters are found
|
|
550
|
-
const {
|
|
551
|
-
error: warrning,
|
|
552
|
-
} = ServiceabilityPlatformValidator.createZone().validate(
|
|
553
|
-
{
|
|
554
|
-
body,
|
|
555
|
-
},
|
|
556
|
-
{ abortEarly: false, allowUnknown: false }
|
|
557
|
-
);
|
|
558
|
-
if (warrning) {
|
|
559
|
-
Logger({
|
|
560
|
-
level: "WARN",
|
|
561
|
-
message: `Parameter Validation warrnings for platform > Serviceability > createZone \n ${warrning}`,
|
|
562
|
-
});
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
const query_params = {};
|
|
566
|
-
|
|
567
|
-
const xHeaders = {};
|
|
568
|
-
|
|
569
|
-
const response = await PlatformAPIClient.execute(
|
|
570
|
-
this.config,
|
|
571
|
-
"post",
|
|
572
|
-
`/service/platform/logistics/v2.0/company/${this.config.companyId}/zones`,
|
|
573
|
-
query_params,
|
|
574
|
-
body,
|
|
575
|
-
{ ...xHeaders, ...requestHeaders },
|
|
576
|
-
{ responseHeaders }
|
|
577
|
-
);
|
|
578
|
-
|
|
579
|
-
let responseData = response;
|
|
580
|
-
if (responseHeaders) {
|
|
581
|
-
responseData = response[0];
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
const {
|
|
585
|
-
error: res_error,
|
|
586
|
-
} = ServiceabilityPlatformModel.ZoneResult().validate(responseData, {
|
|
587
|
-
abortEarly: false,
|
|
588
|
-
allowUnknown: true,
|
|
589
|
-
});
|
|
590
|
-
|
|
591
|
-
if (res_error) {
|
|
592
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
593
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
594
|
-
} else {
|
|
595
|
-
Logger({
|
|
596
|
-
level: "WARN",
|
|
597
|
-
message: `Response Validation Warnings for platform > Serviceability > createZone \n ${res_error}`,
|
|
598
|
-
});
|
|
599
|
-
}
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
return response;
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
/**
|
|
606
|
-
* @param {ServiceabilityPlatformValidator.GetAllStoresParam} arg - Arg object
|
|
607
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
608
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
609
|
-
* @returns {Promise<ServiceabilityPlatformModel.GetStoresViewResult>} -
|
|
610
|
-
* Success response
|
|
611
|
-
* @name getAllStores
|
|
612
|
-
* @summary: Get all stores
|
|
613
|
-
* @description: Retrieves a list of locations. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getAllStores/).
|
|
614
|
-
*/
|
|
615
|
-
async getAllStores(
|
|
616
|
-
{ requestHeaders } = { requestHeaders: {} },
|
|
617
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
618
|
-
) {
|
|
619
|
-
const { error } = ServiceabilityPlatformValidator.getAllStores().validate(
|
|
620
|
-
{},
|
|
621
|
-
{ abortEarly: false, allowUnknown: true }
|
|
622
|
-
);
|
|
623
|
-
if (error) {
|
|
624
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
// Showing warrnings if extra unknown parameters are found
|
|
628
|
-
const {
|
|
629
|
-
error: warrning,
|
|
630
|
-
} = ServiceabilityPlatformValidator.getAllStores().validate(
|
|
631
|
-
{},
|
|
632
|
-
{ abortEarly: false, allowUnknown: false }
|
|
633
|
-
);
|
|
634
|
-
if (warrning) {
|
|
635
|
-
Logger({
|
|
636
|
-
level: "WARN",
|
|
637
|
-
message: `Parameter Validation warrnings for platform > Serviceability > getAllStores \n ${warrning}`,
|
|
638
|
-
});
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
const query_params = {};
|
|
642
|
-
|
|
643
|
-
const xHeaders = {};
|
|
644
|
-
|
|
645
|
-
const response = await PlatformAPIClient.execute(
|
|
646
|
-
this.config,
|
|
647
|
-
"get",
|
|
648
|
-
`/service/platform/logistics/v1.0/company/${this.config.companyId}/logistics/stores`,
|
|
649
|
-
query_params,
|
|
650
|
-
undefined,
|
|
651
|
-
{ ...xHeaders, ...requestHeaders },
|
|
652
|
-
{ responseHeaders }
|
|
653
|
-
);
|
|
654
|
-
|
|
655
|
-
let responseData = response;
|
|
656
|
-
if (responseHeaders) {
|
|
657
|
-
responseData = response[0];
|
|
658
|
-
}
|
|
659
|
-
|
|
660
|
-
const {
|
|
661
|
-
error: res_error,
|
|
662
|
-
} = ServiceabilityPlatformModel.GetStoresViewResult().validate(
|
|
663
|
-
responseData,
|
|
664
|
-
{ abortEarly: false, allowUnknown: true }
|
|
665
|
-
);
|
|
666
|
-
|
|
667
|
-
if (res_error) {
|
|
668
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
669
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
670
|
-
} else {
|
|
671
|
-
Logger({
|
|
672
|
-
level: "WARN",
|
|
673
|
-
message: `Response Validation Warnings for platform > Serviceability > getAllStores \n ${res_error}`,
|
|
674
|
-
});
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
return response;
|
|
679
|
-
}
|
|
680
|
-
|
|
681
531
|
/**
|
|
682
532
|
* @param {ServiceabilityPlatformValidator.GetBulkServiceabilityParam} arg
|
|
683
533
|
* - Arg object
|
|
@@ -770,7 +620,7 @@ class Serviceability {
|
|
|
770
620
|
const response = await PlatformAPIClient.execute(
|
|
771
621
|
this.config,
|
|
772
622
|
"get",
|
|
773
|
-
`/service/platform/logistics/
|
|
623
|
+
`/service/platform/logistics/v2.0/company/${this.config.companyId}/courier-partner/${extensionId}/scheme/${schemeId}/serviceability/bulk`,
|
|
774
624
|
query_params,
|
|
775
625
|
undefined,
|
|
776
626
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -891,7 +741,7 @@ class Serviceability {
|
|
|
891
741
|
const response = await PlatformAPIClient.execute(
|
|
892
742
|
this.config,
|
|
893
743
|
"get",
|
|
894
|
-
`/service/platform/logistics/
|
|
744
|
+
`/service/platform/logistics/v2.0/company/${this.config.companyId}/courier-partner/${extensionId}/scheme/${schemeId}/tat`,
|
|
895
745
|
query_params,
|
|
896
746
|
undefined,
|
|
897
747
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -1009,18 +859,18 @@ class Serviceability {
|
|
|
1009
859
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1010
860
|
* @returns {Promise<ServiceabilityPlatformModel.GetCountries>} - Success response
|
|
1011
861
|
* @name getCountries
|
|
1012
|
-
* @summary: Get countries
|
|
862
|
+
* @summary: Get all countries and associated data
|
|
1013
863
|
* @description: Retrieve a list of countries for logistical purposes. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getCountries/).
|
|
1014
864
|
*/
|
|
1015
865
|
async getCountries(
|
|
1016
|
-
{
|
|
866
|
+
{ onboard, pageNo, pageSize, q, hierarchy, requestHeaders } = {
|
|
1017
867
|
requestHeaders: {},
|
|
1018
868
|
},
|
|
1019
869
|
{ responseHeaders } = { responseHeaders: false }
|
|
1020
870
|
) {
|
|
1021
871
|
const { error } = ServiceabilityPlatformValidator.getCountries().validate(
|
|
1022
872
|
{
|
|
1023
|
-
|
|
873
|
+
onboard,
|
|
1024
874
|
pageNo,
|
|
1025
875
|
pageSize,
|
|
1026
876
|
q,
|
|
@@ -1037,7 +887,7 @@ class Serviceability {
|
|
|
1037
887
|
error: warrning,
|
|
1038
888
|
} = ServiceabilityPlatformValidator.getCountries().validate(
|
|
1039
889
|
{
|
|
1040
|
-
|
|
890
|
+
onboard,
|
|
1041
891
|
pageNo,
|
|
1042
892
|
pageSize,
|
|
1043
893
|
q,
|
|
@@ -1053,7 +903,7 @@ class Serviceability {
|
|
|
1053
903
|
}
|
|
1054
904
|
|
|
1055
905
|
const query_params = {};
|
|
1056
|
-
query_params["
|
|
906
|
+
query_params["onboard"] = onboard;
|
|
1057
907
|
query_params["page_no"] = pageNo;
|
|
1058
908
|
query_params["page_size"] = pageSize;
|
|
1059
909
|
query_params["q"] = q;
|
|
@@ -1195,9 +1045,18 @@ class Serviceability {
|
|
|
1195
1045
|
* @description: Retrieves a list of courier partner accounts. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getCourierPartnerAccounts/).
|
|
1196
1046
|
*/
|
|
1197
1047
|
async getCourierPartnerAccounts(
|
|
1198
|
-
{
|
|
1199
|
-
|
|
1200
|
-
|
|
1048
|
+
{
|
|
1049
|
+
pageNo,
|
|
1050
|
+
pageSize,
|
|
1051
|
+
stage,
|
|
1052
|
+
paymentMode,
|
|
1053
|
+
transportType,
|
|
1054
|
+
accountIds,
|
|
1055
|
+
selfShip,
|
|
1056
|
+
ownAccount,
|
|
1057
|
+
q,
|
|
1058
|
+
requestHeaders,
|
|
1059
|
+
} = { requestHeaders: {} },
|
|
1201
1060
|
{ responseHeaders } = { responseHeaders: false }
|
|
1202
1061
|
) {
|
|
1203
1062
|
const {
|
|
@@ -1209,6 +1068,10 @@ class Serviceability {
|
|
|
1209
1068
|
stage,
|
|
1210
1069
|
paymentMode,
|
|
1211
1070
|
transportType,
|
|
1071
|
+
accountIds,
|
|
1072
|
+
selfShip,
|
|
1073
|
+
ownAccount,
|
|
1074
|
+
q,
|
|
1212
1075
|
},
|
|
1213
1076
|
{ abortEarly: false, allowUnknown: true }
|
|
1214
1077
|
);
|
|
@@ -1226,6 +1089,10 @@ class Serviceability {
|
|
|
1226
1089
|
stage,
|
|
1227
1090
|
paymentMode,
|
|
1228
1091
|
transportType,
|
|
1092
|
+
accountIds,
|
|
1093
|
+
selfShip,
|
|
1094
|
+
ownAccount,
|
|
1095
|
+
q,
|
|
1229
1096
|
},
|
|
1230
1097
|
{ abortEarly: false, allowUnknown: false }
|
|
1231
1098
|
);
|
|
@@ -1242,6 +1109,10 @@ class Serviceability {
|
|
|
1242
1109
|
query_params["stage"] = stage;
|
|
1243
1110
|
query_params["payment_mode"] = paymentMode;
|
|
1244
1111
|
query_params["transport_type"] = transportType;
|
|
1112
|
+
query_params["account_ids"] = accountIds;
|
|
1113
|
+
query_params["self_ship"] = selfShip;
|
|
1114
|
+
query_params["own_account"] = ownAccount;
|
|
1115
|
+
query_params["q"] = q;
|
|
1245
1116
|
|
|
1246
1117
|
const xHeaders = {};
|
|
1247
1118
|
|
|
@@ -1287,7 +1158,7 @@ class Serviceability {
|
|
|
1287
1158
|
*
|
|
1288
1159
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1289
1160
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1290
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
1161
|
+
* @returns {Promise<ServiceabilityPlatformModel.CourierPartnerSchemeModelSchema>}
|
|
1291
1162
|
* - Success response
|
|
1292
1163
|
*
|
|
1293
1164
|
* @name getCourierPartnerScheme
|
|
@@ -1343,7 +1214,7 @@ class Serviceability {
|
|
|
1343
1214
|
|
|
1344
1215
|
const {
|
|
1345
1216
|
error: res_error,
|
|
1346
|
-
} = ServiceabilityPlatformModel.
|
|
1217
|
+
} = ServiceabilityPlatformModel.CourierPartnerSchemeModelSchema().validate(
|
|
1347
1218
|
responseData,
|
|
1348
1219
|
{ abortEarly: false, allowUnknown: true }
|
|
1349
1220
|
);
|
|
@@ -1368,7 +1239,7 @@ class Serviceability {
|
|
|
1368
1239
|
*
|
|
1369
1240
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1370
1241
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1371
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
1242
|
+
* @returns {Promise<ServiceabilityPlatformModel.CourierPartnerSchemeList>}
|
|
1372
1243
|
* - Success response
|
|
1373
1244
|
*
|
|
1374
1245
|
* @name getCourierPartnerSchemes
|
|
@@ -1440,7 +1311,7 @@ class Serviceability {
|
|
|
1440
1311
|
|
|
1441
1312
|
const {
|
|
1442
1313
|
error: res_error,
|
|
1443
|
-
} = ServiceabilityPlatformModel.
|
|
1314
|
+
} = ServiceabilityPlatformModel.CourierPartnerSchemeList().validate(
|
|
1444
1315
|
responseData,
|
|
1445
1316
|
{ abortEarly: false, allowUnknown: true }
|
|
1446
1317
|
);
|
|
@@ -1459,6 +1330,98 @@ class Serviceability {
|
|
|
1459
1330
|
return response;
|
|
1460
1331
|
}
|
|
1461
1332
|
|
|
1333
|
+
/**
|
|
1334
|
+
* @param {ServiceabilityPlatformValidator.GetInstalledCourierPartnerExtensionsParam} arg
|
|
1335
|
+
* - Arg object
|
|
1336
|
+
*
|
|
1337
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1338
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1339
|
+
* @returns {Promise<ServiceabilityPlatformModel.InstallCourierPartnerResponseSchema>}
|
|
1340
|
+
* - Success response
|
|
1341
|
+
*
|
|
1342
|
+
* @name getInstalledCourierPartnerExtensions
|
|
1343
|
+
* @summary: Fetching of Package Material Rules from database.
|
|
1344
|
+
* @description: This API returns response of Package Materials Rules from mongo database. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getInstalledCourierPartnerExtensions/).
|
|
1345
|
+
*/
|
|
1346
|
+
async getInstalledCourierPartnerExtensions(
|
|
1347
|
+
{ pageNo, pageSize, isInstalled, requestHeaders } = { requestHeaders: {} },
|
|
1348
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1349
|
+
) {
|
|
1350
|
+
const {
|
|
1351
|
+
error,
|
|
1352
|
+
} = ServiceabilityPlatformValidator.getInstalledCourierPartnerExtensions().validate(
|
|
1353
|
+
{
|
|
1354
|
+
pageNo,
|
|
1355
|
+
pageSize,
|
|
1356
|
+
isInstalled,
|
|
1357
|
+
},
|
|
1358
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1359
|
+
);
|
|
1360
|
+
if (error) {
|
|
1361
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1365
|
+
const {
|
|
1366
|
+
error: warrning,
|
|
1367
|
+
} = ServiceabilityPlatformValidator.getInstalledCourierPartnerExtensions().validate(
|
|
1368
|
+
{
|
|
1369
|
+
pageNo,
|
|
1370
|
+
pageSize,
|
|
1371
|
+
isInstalled,
|
|
1372
|
+
},
|
|
1373
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1374
|
+
);
|
|
1375
|
+
if (warrning) {
|
|
1376
|
+
Logger({
|
|
1377
|
+
level: "WARN",
|
|
1378
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getInstalledCourierPartnerExtensions \n ${warrning}`,
|
|
1379
|
+
});
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
const query_params = {};
|
|
1383
|
+
query_params["page_no"] = pageNo;
|
|
1384
|
+
query_params["page_size"] = pageSize;
|
|
1385
|
+
query_params["is_installed"] = isInstalled;
|
|
1386
|
+
|
|
1387
|
+
const xHeaders = {};
|
|
1388
|
+
|
|
1389
|
+
const response = await PlatformAPIClient.execute(
|
|
1390
|
+
this.config,
|
|
1391
|
+
"get",
|
|
1392
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/courier-partner/list`,
|
|
1393
|
+
query_params,
|
|
1394
|
+
undefined,
|
|
1395
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1396
|
+
{ responseHeaders }
|
|
1397
|
+
);
|
|
1398
|
+
|
|
1399
|
+
let responseData = response;
|
|
1400
|
+
if (responseHeaders) {
|
|
1401
|
+
responseData = response[0];
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
const {
|
|
1405
|
+
error: res_error,
|
|
1406
|
+
} = ServiceabilityPlatformModel.InstallCourierPartnerResponseSchema().validate(
|
|
1407
|
+
responseData,
|
|
1408
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1409
|
+
);
|
|
1410
|
+
|
|
1411
|
+
if (res_error) {
|
|
1412
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
1413
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1414
|
+
} else {
|
|
1415
|
+
Logger({
|
|
1416
|
+
level: "WARN",
|
|
1417
|
+
message: `Response Validation Warnings for platform > Serviceability > getInstalledCourierPartnerExtensions \n ${res_error}`,
|
|
1418
|
+
});
|
|
1419
|
+
}
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
return response;
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1462
1425
|
/**
|
|
1463
1426
|
* @param {ServiceabilityPlatformValidator.GetOptimalLocationsParam} arg - Arg object
|
|
1464
1427
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -1547,7 +1510,7 @@ class Serviceability {
|
|
|
1547
1510
|
*
|
|
1548
1511
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1549
1512
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1550
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
1513
|
+
* @returns {Promise<ServiceabilityPlatformModel.PackagesListResult>} -
|
|
1551
1514
|
* Success response
|
|
1552
1515
|
* @name getPackageMaterialList
|
|
1553
1516
|
* @summary: Get packaging materials
|
|
@@ -1621,7 +1584,7 @@ class Serviceability {
|
|
|
1621
1584
|
|
|
1622
1585
|
const {
|
|
1623
1586
|
error: res_error,
|
|
1624
|
-
} = ServiceabilityPlatformModel.
|
|
1587
|
+
} = ServiceabilityPlatformModel.PackagesListResult().validate(
|
|
1625
1588
|
responseData,
|
|
1626
1589
|
{ abortEarly: false, allowUnknown: true }
|
|
1627
1590
|
);
|
|
@@ -1725,29 +1688,23 @@ class Serviceability {
|
|
|
1725
1688
|
}
|
|
1726
1689
|
|
|
1727
1690
|
/**
|
|
1728
|
-
* @param {ServiceabilityPlatformValidator.
|
|
1729
|
-
* - Arg object
|
|
1730
|
-
*
|
|
1691
|
+
* @param {ServiceabilityPlatformValidator.GetPackageMaterialsParam} arg - Arg object
|
|
1731
1692
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1732
1693
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1733
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
1734
|
-
*
|
|
1735
|
-
*
|
|
1736
|
-
* @
|
|
1737
|
-
* @summary: Get packaging rules
|
|
1738
|
-
* @description: Retrieve packaging rules - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getPackageMaterialRules/).
|
|
1694
|
+
* @returns {Promise<ServiceabilityPlatformModel.PackageItem>} - Success response
|
|
1695
|
+
* @name getPackageMaterials
|
|
1696
|
+
* @summary: Get packaging material
|
|
1697
|
+
* @description: Retrieve a single packaging material - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getPackageMaterials/).
|
|
1739
1698
|
*/
|
|
1740
|
-
async
|
|
1741
|
-
{
|
|
1699
|
+
async getPackageMaterials(
|
|
1700
|
+
{ packageMaterialId, requestHeaders } = { requestHeaders: {} },
|
|
1742
1701
|
{ responseHeaders } = { responseHeaders: false }
|
|
1743
1702
|
) {
|
|
1744
1703
|
const {
|
|
1745
1704
|
error,
|
|
1746
|
-
} = ServiceabilityPlatformValidator.
|
|
1705
|
+
} = ServiceabilityPlatformValidator.getPackageMaterials().validate(
|
|
1747
1706
|
{
|
|
1748
|
-
|
|
1749
|
-
pageSize,
|
|
1750
|
-
isActive,
|
|
1707
|
+
packageMaterialId,
|
|
1751
1708
|
},
|
|
1752
1709
|
{ abortEarly: false, allowUnknown: true }
|
|
1753
1710
|
);
|
|
@@ -1758,32 +1715,27 @@ class Serviceability {
|
|
|
1758
1715
|
// Showing warrnings if extra unknown parameters are found
|
|
1759
1716
|
const {
|
|
1760
1717
|
error: warrning,
|
|
1761
|
-
} = ServiceabilityPlatformValidator.
|
|
1718
|
+
} = ServiceabilityPlatformValidator.getPackageMaterials().validate(
|
|
1762
1719
|
{
|
|
1763
|
-
|
|
1764
|
-
pageSize,
|
|
1765
|
-
isActive,
|
|
1720
|
+
packageMaterialId,
|
|
1766
1721
|
},
|
|
1767
1722
|
{ abortEarly: false, allowUnknown: false }
|
|
1768
1723
|
);
|
|
1769
1724
|
if (warrning) {
|
|
1770
1725
|
Logger({
|
|
1771
1726
|
level: "WARN",
|
|
1772
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
1727
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getPackageMaterials \n ${warrning}`,
|
|
1773
1728
|
});
|
|
1774
1729
|
}
|
|
1775
1730
|
|
|
1776
1731
|
const query_params = {};
|
|
1777
|
-
query_params["page_no"] = pageNo;
|
|
1778
|
-
query_params["page_size"] = pageSize;
|
|
1779
|
-
query_params["is_active"] = isActive;
|
|
1780
1732
|
|
|
1781
1733
|
const xHeaders = {};
|
|
1782
1734
|
|
|
1783
1735
|
const response = await PlatformAPIClient.execute(
|
|
1784
1736
|
this.config,
|
|
1785
1737
|
"get",
|
|
1786
|
-
`/service/platform/logistics/v1.0/company/${this.config.companyId}/packaging-material
|
|
1738
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/packaging-material/${packageMaterialId}`,
|
|
1787
1739
|
query_params,
|
|
1788
1740
|
undefined,
|
|
1789
1741
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -1797,92 +1749,10 @@ class Serviceability {
|
|
|
1797
1749
|
|
|
1798
1750
|
const {
|
|
1799
1751
|
error: res_error,
|
|
1800
|
-
} = ServiceabilityPlatformModel.
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
);
|
|
1804
|
-
|
|
1805
|
-
if (res_error) {
|
|
1806
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
1807
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1808
|
-
} else {
|
|
1809
|
-
Logger({
|
|
1810
|
-
level: "WARN",
|
|
1811
|
-
message: `Response Validation Warnings for platform > Serviceability > getPackageMaterialRules \n ${res_error}`,
|
|
1812
|
-
});
|
|
1813
|
-
}
|
|
1814
|
-
}
|
|
1815
|
-
|
|
1816
|
-
return response;
|
|
1817
|
-
}
|
|
1818
|
-
|
|
1819
|
-
/**
|
|
1820
|
-
* @param {ServiceabilityPlatformValidator.GetPackageMaterialsParam} arg - Arg object
|
|
1821
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1822
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1823
|
-
* @returns {Promise<ServiceabilityPlatformModel.PackageMaterialResult>} -
|
|
1824
|
-
* Success response
|
|
1825
|
-
* @name getPackageMaterials
|
|
1826
|
-
* @summary: Get packaging material
|
|
1827
|
-
* @description: Retrieve a single packaging material - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getPackageMaterials/).
|
|
1828
|
-
*/
|
|
1829
|
-
async getPackageMaterials(
|
|
1830
|
-
{ packageMaterialId, requestHeaders } = { requestHeaders: {} },
|
|
1831
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
1832
|
-
) {
|
|
1833
|
-
const {
|
|
1834
|
-
error,
|
|
1835
|
-
} = ServiceabilityPlatformValidator.getPackageMaterials().validate(
|
|
1836
|
-
{
|
|
1837
|
-
packageMaterialId,
|
|
1838
|
-
},
|
|
1839
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1840
|
-
);
|
|
1841
|
-
if (error) {
|
|
1842
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1843
|
-
}
|
|
1844
|
-
|
|
1845
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1846
|
-
const {
|
|
1847
|
-
error: warrning,
|
|
1848
|
-
} = ServiceabilityPlatformValidator.getPackageMaterials().validate(
|
|
1849
|
-
{
|
|
1850
|
-
packageMaterialId,
|
|
1851
|
-
},
|
|
1852
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1853
|
-
);
|
|
1854
|
-
if (warrning) {
|
|
1855
|
-
Logger({
|
|
1856
|
-
level: "WARN",
|
|
1857
|
-
message: `Parameter Validation warrnings for platform > Serviceability > getPackageMaterials \n ${warrning}`,
|
|
1858
|
-
});
|
|
1859
|
-
}
|
|
1860
|
-
|
|
1861
|
-
const query_params = {};
|
|
1862
|
-
|
|
1863
|
-
const xHeaders = {};
|
|
1864
|
-
|
|
1865
|
-
const response = await PlatformAPIClient.execute(
|
|
1866
|
-
this.config,
|
|
1867
|
-
"get",
|
|
1868
|
-
`/service/platform/logistics/v1.0/company/${this.config.companyId}/packaging-material/${packageMaterialId}`,
|
|
1869
|
-
query_params,
|
|
1870
|
-
undefined,
|
|
1871
|
-
{ ...xHeaders, ...requestHeaders },
|
|
1872
|
-
{ responseHeaders }
|
|
1873
|
-
);
|
|
1874
|
-
|
|
1875
|
-
let responseData = response;
|
|
1876
|
-
if (responseHeaders) {
|
|
1877
|
-
responseData = response[0];
|
|
1878
|
-
}
|
|
1879
|
-
|
|
1880
|
-
const {
|
|
1881
|
-
error: res_error,
|
|
1882
|
-
} = ServiceabilityPlatformModel.PackageMaterialResult().validate(
|
|
1883
|
-
responseData,
|
|
1884
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1885
|
-
);
|
|
1752
|
+
} = ServiceabilityPlatformModel.PackageItem().validate(responseData, {
|
|
1753
|
+
abortEarly: false,
|
|
1754
|
+
allowUnknown: true,
|
|
1755
|
+
});
|
|
1886
1756
|
|
|
1887
1757
|
if (res_error) {
|
|
1888
1758
|
if (this.config.options.strictResponseCheck === true) {
|
|
@@ -1957,7 +1827,7 @@ class Serviceability {
|
|
|
1957
1827
|
const response = await PlatformAPIClient.execute(
|
|
1958
1828
|
this.config,
|
|
1959
1829
|
"get",
|
|
1960
|
-
`/service/platform/logistics/
|
|
1830
|
+
`/service/platform/logistics/v2.0/company/${this.config.companyId}/localities/bulk-sample`,
|
|
1961
1831
|
query_params,
|
|
1962
1832
|
undefined,
|
|
1963
1833
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -1991,211 +1861,22 @@ class Serviceability {
|
|
|
1991
1861
|
}
|
|
1992
1862
|
|
|
1993
1863
|
/**
|
|
1994
|
-
* @param {ServiceabilityPlatformValidator.
|
|
1864
|
+
* @param {ServiceabilityPlatformValidator.GetSelfShipDetailsParam} arg - Arg object
|
|
1995
1865
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1996
1866
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1997
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
1998
|
-
*
|
|
1999
|
-
* @
|
|
2000
|
-
* @
|
|
2001
|
-
* @description: Rerieves serviceability settings of a single courier scheme for a given locality - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getServiceability/).
|
|
1867
|
+
* @returns {Promise<ServiceabilityPlatformModel.SelfshipSchema>} - Success response
|
|
1868
|
+
* @name getSelfShipDetails
|
|
1869
|
+
* @summary: Get self-ship details
|
|
1870
|
+
* @description: Get the self-ship details such as TAT, activation status, and unit for a specified company. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getSelfShipDetails/).
|
|
2002
1871
|
*/
|
|
2003
|
-
async
|
|
2004
|
-
{
|
|
2005
|
-
requestHeaders: {},
|
|
2006
|
-
},
|
|
1872
|
+
async getSelfShipDetails(
|
|
1873
|
+
{ requestHeaders } = { requestHeaders: {} },
|
|
2007
1874
|
{ responseHeaders } = { responseHeaders: false }
|
|
2008
1875
|
) {
|
|
2009
1876
|
const {
|
|
2010
1877
|
error,
|
|
2011
|
-
} = ServiceabilityPlatformValidator.
|
|
2012
|
-
{
|
|
2013
|
-
extensionId,
|
|
2014
|
-
schemeId,
|
|
2015
|
-
regionId,
|
|
2016
|
-
},
|
|
2017
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2018
|
-
);
|
|
2019
|
-
if (error) {
|
|
2020
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
2021
|
-
}
|
|
2022
|
-
|
|
2023
|
-
// Showing warrnings if extra unknown parameters are found
|
|
2024
|
-
const {
|
|
2025
|
-
error: warrning,
|
|
2026
|
-
} = ServiceabilityPlatformValidator.getServiceability().validate(
|
|
2027
|
-
{
|
|
2028
|
-
extensionId,
|
|
2029
|
-
schemeId,
|
|
2030
|
-
regionId,
|
|
2031
|
-
},
|
|
2032
|
-
{ abortEarly: false, allowUnknown: false }
|
|
2033
|
-
);
|
|
2034
|
-
if (warrning) {
|
|
2035
|
-
Logger({
|
|
2036
|
-
level: "WARN",
|
|
2037
|
-
message: `Parameter Validation warrnings for platform > Serviceability > getServiceability \n ${warrning}`,
|
|
2038
|
-
});
|
|
2039
|
-
}
|
|
2040
|
-
|
|
2041
|
-
const query_params = {};
|
|
2042
|
-
|
|
2043
|
-
const xHeaders = {};
|
|
2044
|
-
|
|
2045
|
-
const response = await PlatformAPIClient.execute(
|
|
2046
|
-
this.config,
|
|
2047
|
-
"get",
|
|
2048
|
-
`/service/platform/logistics/v1.0/company/${this.config.companyId}/courier-partner/${extensionId}/scheme/${schemeId}/serviceability/region/${regionId}`,
|
|
2049
|
-
query_params,
|
|
2050
|
-
undefined,
|
|
2051
|
-
{ ...xHeaders, ...requestHeaders },
|
|
2052
|
-
{ responseHeaders }
|
|
2053
|
-
);
|
|
2054
|
-
|
|
2055
|
-
let responseData = response;
|
|
2056
|
-
if (responseHeaders) {
|
|
2057
|
-
responseData = response[0];
|
|
2058
|
-
}
|
|
2059
|
-
|
|
2060
|
-
const {
|
|
2061
|
-
error: res_error,
|
|
2062
|
-
} = ServiceabilityPlatformModel.ServiceabilityModel().validate(
|
|
2063
|
-
responseData,
|
|
2064
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2065
|
-
);
|
|
2066
|
-
|
|
2067
|
-
if (res_error) {
|
|
2068
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
2069
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2070
|
-
} else {
|
|
2071
|
-
Logger({
|
|
2072
|
-
level: "WARN",
|
|
2073
|
-
message: `Response Validation Warnings for platform > Serviceability > getServiceability \n ${res_error}`,
|
|
2074
|
-
});
|
|
2075
|
-
}
|
|
2076
|
-
}
|
|
2077
|
-
|
|
2078
|
-
return response;
|
|
2079
|
-
}
|
|
2080
|
-
|
|
2081
|
-
/**
|
|
2082
|
-
* @param {ServiceabilityPlatformValidator.GetZoneByIdParam} arg - Arg object
|
|
2083
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2084
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2085
|
-
* @returns {Promise<ServiceabilityPlatformModel.GetZoneByIdSchema>} -
|
|
2086
|
-
* Success response
|
|
2087
|
-
* @name getZoneById
|
|
2088
|
-
* @summary: Get zone details
|
|
2089
|
-
* @description: Retrieves a single delivery zone. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getZoneById/).
|
|
2090
|
-
*/
|
|
2091
|
-
async getZoneById(
|
|
2092
|
-
{ zoneId, requestHeaders } = { requestHeaders: {} },
|
|
2093
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
2094
|
-
) {
|
|
2095
|
-
const { error } = ServiceabilityPlatformValidator.getZoneById().validate(
|
|
2096
|
-
{
|
|
2097
|
-
zoneId,
|
|
2098
|
-
},
|
|
2099
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2100
|
-
);
|
|
2101
|
-
if (error) {
|
|
2102
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
2103
|
-
}
|
|
2104
|
-
|
|
2105
|
-
// Showing warrnings if extra unknown parameters are found
|
|
2106
|
-
const {
|
|
2107
|
-
error: warrning,
|
|
2108
|
-
} = ServiceabilityPlatformValidator.getZoneById().validate(
|
|
2109
|
-
{
|
|
2110
|
-
zoneId,
|
|
2111
|
-
},
|
|
2112
|
-
{ abortEarly: false, allowUnknown: false }
|
|
2113
|
-
);
|
|
2114
|
-
if (warrning) {
|
|
2115
|
-
Logger({
|
|
2116
|
-
level: "WARN",
|
|
2117
|
-
message: `Parameter Validation warrnings for platform > Serviceability > getZoneById \n ${warrning}`,
|
|
2118
|
-
});
|
|
2119
|
-
}
|
|
2120
|
-
|
|
2121
|
-
const query_params = {};
|
|
2122
|
-
|
|
2123
|
-
const xHeaders = {};
|
|
2124
|
-
|
|
2125
|
-
const response = await PlatformAPIClient.execute(
|
|
2126
|
-
this.config,
|
|
2127
|
-
"get",
|
|
2128
|
-
`/service/platform/logistics/v2.0/company/${this.config.companyId}/zones/${zoneId}`,
|
|
2129
|
-
query_params,
|
|
2130
|
-
undefined,
|
|
2131
|
-
{ ...xHeaders, ...requestHeaders },
|
|
2132
|
-
{ responseHeaders }
|
|
2133
|
-
);
|
|
2134
|
-
|
|
2135
|
-
let responseData = response;
|
|
2136
|
-
if (responseHeaders) {
|
|
2137
|
-
responseData = response[0];
|
|
2138
|
-
}
|
|
2139
|
-
|
|
2140
|
-
const {
|
|
2141
|
-
error: res_error,
|
|
2142
|
-
} = ServiceabilityPlatformModel.GetZoneByIdSchema().validate(responseData, {
|
|
2143
|
-
abortEarly: false,
|
|
2144
|
-
allowUnknown: true,
|
|
2145
|
-
});
|
|
2146
|
-
|
|
2147
|
-
if (res_error) {
|
|
2148
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
2149
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2150
|
-
} else {
|
|
2151
|
-
Logger({
|
|
2152
|
-
level: "WARN",
|
|
2153
|
-
message: `Response Validation Warnings for platform > Serviceability > getZoneById \n ${res_error}`,
|
|
2154
|
-
});
|
|
2155
|
-
}
|
|
2156
|
-
}
|
|
2157
|
-
|
|
2158
|
-
return response;
|
|
2159
|
-
}
|
|
2160
|
-
|
|
2161
|
-
/**
|
|
2162
|
-
* @param {ServiceabilityPlatformValidator.GetZonesParam} arg - Arg object
|
|
2163
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2164
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2165
|
-
* @returns {Promise<ServiceabilityPlatformModel.ListViewResult>} - Success response
|
|
2166
|
-
* @name getZones
|
|
2167
|
-
* @summary: Get zones
|
|
2168
|
-
* @description: Retrieves a list of delivery zones. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getZones/).
|
|
2169
|
-
*/
|
|
2170
|
-
async getZones(
|
|
2171
|
-
{
|
|
2172
|
-
pageNo,
|
|
2173
|
-
pageSize,
|
|
2174
|
-
isActive,
|
|
2175
|
-
channelId,
|
|
2176
|
-
q,
|
|
2177
|
-
countryIsoCode,
|
|
2178
|
-
state,
|
|
2179
|
-
city,
|
|
2180
|
-
pincode,
|
|
2181
|
-
sector,
|
|
2182
|
-
requestHeaders,
|
|
2183
|
-
} = { requestHeaders: {} },
|
|
2184
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
2185
|
-
) {
|
|
2186
|
-
const { error } = ServiceabilityPlatformValidator.getZones().validate(
|
|
2187
|
-
{
|
|
2188
|
-
pageNo,
|
|
2189
|
-
pageSize,
|
|
2190
|
-
isActive,
|
|
2191
|
-
channelId,
|
|
2192
|
-
q,
|
|
2193
|
-
countryIsoCode,
|
|
2194
|
-
state,
|
|
2195
|
-
city,
|
|
2196
|
-
pincode,
|
|
2197
|
-
sector,
|
|
2198
|
-
},
|
|
1878
|
+
} = ServiceabilityPlatformValidator.getSelfShipDetails().validate(
|
|
1879
|
+
{},
|
|
2199
1880
|
{ abortEarly: false, allowUnknown: true }
|
|
2200
1881
|
);
|
|
2201
1882
|
if (error) {
|
|
@@ -2205,46 +1886,25 @@ class Serviceability {
|
|
|
2205
1886
|
// Showing warrnings if extra unknown parameters are found
|
|
2206
1887
|
const {
|
|
2207
1888
|
error: warrning,
|
|
2208
|
-
} = ServiceabilityPlatformValidator.
|
|
2209
|
-
{
|
|
2210
|
-
pageNo,
|
|
2211
|
-
pageSize,
|
|
2212
|
-
isActive,
|
|
2213
|
-
channelId,
|
|
2214
|
-
q,
|
|
2215
|
-
countryIsoCode,
|
|
2216
|
-
state,
|
|
2217
|
-
city,
|
|
2218
|
-
pincode,
|
|
2219
|
-
sector,
|
|
2220
|
-
},
|
|
1889
|
+
} = ServiceabilityPlatformValidator.getSelfShipDetails().validate(
|
|
1890
|
+
{},
|
|
2221
1891
|
{ abortEarly: false, allowUnknown: false }
|
|
2222
1892
|
);
|
|
2223
1893
|
if (warrning) {
|
|
2224
1894
|
Logger({
|
|
2225
1895
|
level: "WARN",
|
|
2226
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
1896
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getSelfShipDetails \n ${warrning}`,
|
|
2227
1897
|
});
|
|
2228
1898
|
}
|
|
2229
1899
|
|
|
2230
1900
|
const query_params = {};
|
|
2231
|
-
query_params["page_no"] = pageNo;
|
|
2232
|
-
query_params["page_size"] = pageSize;
|
|
2233
|
-
query_params["is_active"] = isActive;
|
|
2234
|
-
query_params["channel_id"] = channelId;
|
|
2235
|
-
query_params["q"] = q;
|
|
2236
|
-
query_params["country_iso_code"] = countryIsoCode;
|
|
2237
|
-
query_params["state"] = state;
|
|
2238
|
-
query_params["city"] = city;
|
|
2239
|
-
query_params["pincode"] = pincode;
|
|
2240
|
-
query_params["sector"] = sector;
|
|
2241
1901
|
|
|
2242
1902
|
const xHeaders = {};
|
|
2243
1903
|
|
|
2244
1904
|
const response = await PlatformAPIClient.execute(
|
|
2245
1905
|
this.config,
|
|
2246
1906
|
"get",
|
|
2247
|
-
`/service/platform/logistics/
|
|
1907
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/selfship`,
|
|
2248
1908
|
query_params,
|
|
2249
1909
|
undefined,
|
|
2250
1910
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -2258,7 +1918,7 @@ class Serviceability {
|
|
|
2258
1918
|
|
|
2259
1919
|
const {
|
|
2260
1920
|
error: res_error,
|
|
2261
|
-
} = ServiceabilityPlatformModel.
|
|
1921
|
+
} = ServiceabilityPlatformModel.SelfshipSchema().validate(responseData, {
|
|
2262
1922
|
abortEarly: false,
|
|
2263
1923
|
allowUnknown: true,
|
|
2264
1924
|
});
|
|
@@ -2269,7 +1929,7 @@ class Serviceability {
|
|
|
2269
1929
|
} else {
|
|
2270
1930
|
Logger({
|
|
2271
1931
|
level: "WARN",
|
|
2272
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
1932
|
+
message: `Response Validation Warnings for platform > Serviceability > getSelfShipDetails \n ${res_error}`,
|
|
2273
1933
|
});
|
|
2274
1934
|
}
|
|
2275
1935
|
}
|
|
@@ -2329,7 +1989,7 @@ class Serviceability {
|
|
|
2329
1989
|
const response = await PlatformAPIClient.execute(
|
|
2330
1990
|
this.config,
|
|
2331
1991
|
"post",
|
|
2332
|
-
`/service/platform/logistics/
|
|
1992
|
+
`/service/platform/logistics/v2.0/company/${this.config.companyId}/localities/bulk-sample`,
|
|
2333
1993
|
query_params,
|
|
2334
1994
|
body,
|
|
2335
1995
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -2451,8 +2111,9 @@ class Serviceability {
|
|
|
2451
2111
|
*
|
|
2452
2112
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2453
2113
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2454
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
2455
|
-
* Success response
|
|
2114
|
+
* @returns {Promise<ServiceabilityPlatformModel.CourierAccountDetailsBody>}
|
|
2115
|
+
* - Success response
|
|
2116
|
+
*
|
|
2456
2117
|
* @name updateCourierPartnerAccount
|
|
2457
2118
|
* @summary: Update courier account
|
|
2458
2119
|
* @description: Updates an existing courier partner account. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/updateCourierPartnerAccount/).
|
|
@@ -2512,7 +2173,7 @@ class Serviceability {
|
|
|
2512
2173
|
|
|
2513
2174
|
const {
|
|
2514
2175
|
error: res_error,
|
|
2515
|
-
} = ServiceabilityPlatformModel.
|
|
2176
|
+
} = ServiceabilityPlatformModel.CourierAccountDetailsBody().validate(
|
|
2516
2177
|
responseData,
|
|
2517
2178
|
{ abortEarly: false, allowUnknown: true }
|
|
2518
2179
|
);
|
|
@@ -2537,7 +2198,7 @@ class Serviceability {
|
|
|
2537
2198
|
*
|
|
2538
2199
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2539
2200
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2540
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
2201
|
+
* @returns {Promise<ServiceabilityPlatformModel.CourierPartnerSchemeModelSchema>}
|
|
2541
2202
|
* - Success response
|
|
2542
2203
|
*
|
|
2543
2204
|
* @name updateCourierPartnerScheme
|
|
@@ -2601,7 +2262,7 @@ class Serviceability {
|
|
|
2601
2262
|
|
|
2602
2263
|
const {
|
|
2603
2264
|
error: res_error,
|
|
2604
|
-
} = ServiceabilityPlatformModel.
|
|
2265
|
+
} = ServiceabilityPlatformModel.CourierPartnerSchemeModelSchema().validate(
|
|
2605
2266
|
responseData,
|
|
2606
2267
|
{ abortEarly: false, allowUnknown: true }
|
|
2607
2268
|
);
|
|
@@ -2793,28 +2454,24 @@ class Serviceability {
|
|
|
2793
2454
|
}
|
|
2794
2455
|
|
|
2795
2456
|
/**
|
|
2796
|
-
* @param {ServiceabilityPlatformValidator.
|
|
2457
|
+
* @param {ServiceabilityPlatformValidator.UpdateSelfShipDetailsParam} arg
|
|
2458
|
+
* - Arg object
|
|
2459
|
+
*
|
|
2797
2460
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2798
2461
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2799
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
2800
|
-
*
|
|
2801
|
-
* @
|
|
2802
|
-
* @
|
|
2803
|
-
* @description: Updates serviceability settings of a single courier scheme for a given locality - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/updateServiceability/).
|
|
2462
|
+
* @returns {Promise<ServiceabilityPlatformModel.SelfshipSchema>} - Success response
|
|
2463
|
+
* @name updateSelfShipDetails
|
|
2464
|
+
* @summary: Update self-ship details
|
|
2465
|
+
* @description: Updates the self-ship details such as TAT, activation status, and unit for a specified company. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/updateSelfShipDetails/).
|
|
2804
2466
|
*/
|
|
2805
|
-
async
|
|
2806
|
-
{
|
|
2807
|
-
requestHeaders: {},
|
|
2808
|
-
},
|
|
2467
|
+
async updateSelfShipDetails(
|
|
2468
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
2809
2469
|
{ responseHeaders } = { responseHeaders: false }
|
|
2810
2470
|
) {
|
|
2811
2471
|
const {
|
|
2812
2472
|
error,
|
|
2813
|
-
} = ServiceabilityPlatformValidator.
|
|
2473
|
+
} = ServiceabilityPlatformValidator.updateSelfShipDetails().validate(
|
|
2814
2474
|
{
|
|
2815
|
-
extensionId,
|
|
2816
|
-
schemeId,
|
|
2817
|
-
regionId,
|
|
2818
2475
|
body,
|
|
2819
2476
|
},
|
|
2820
2477
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -2826,11 +2483,8 @@ class Serviceability {
|
|
|
2826
2483
|
// Showing warrnings if extra unknown parameters are found
|
|
2827
2484
|
const {
|
|
2828
2485
|
error: warrning,
|
|
2829
|
-
} = ServiceabilityPlatformValidator.
|
|
2486
|
+
} = ServiceabilityPlatformValidator.updateSelfShipDetails().validate(
|
|
2830
2487
|
{
|
|
2831
|
-
extensionId,
|
|
2832
|
-
schemeId,
|
|
2833
|
-
regionId,
|
|
2834
2488
|
body,
|
|
2835
2489
|
},
|
|
2836
2490
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -2838,7 +2492,7 @@ class Serviceability {
|
|
|
2838
2492
|
if (warrning) {
|
|
2839
2493
|
Logger({
|
|
2840
2494
|
level: "WARN",
|
|
2841
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
2495
|
+
message: `Parameter Validation warrnings for platform > Serviceability > updateSelfShipDetails \n ${warrning}`,
|
|
2842
2496
|
});
|
|
2843
2497
|
}
|
|
2844
2498
|
|
|
@@ -2848,90 +2502,8 @@ class Serviceability {
|
|
|
2848
2502
|
|
|
2849
2503
|
const response = await PlatformAPIClient.execute(
|
|
2850
2504
|
this.config,
|
|
2851
|
-
"
|
|
2852
|
-
`/service/platform/logistics/v1.0/company/${this.config.companyId}/
|
|
2853
|
-
query_params,
|
|
2854
|
-
body,
|
|
2855
|
-
{ ...xHeaders, ...requestHeaders },
|
|
2856
|
-
{ responseHeaders }
|
|
2857
|
-
);
|
|
2858
|
-
|
|
2859
|
-
let responseData = response;
|
|
2860
|
-
if (responseHeaders) {
|
|
2861
|
-
responseData = response[0];
|
|
2862
|
-
}
|
|
2863
|
-
|
|
2864
|
-
const {
|
|
2865
|
-
error: res_error,
|
|
2866
|
-
} = ServiceabilityPlatformModel.ServiceabilityModel().validate(
|
|
2867
|
-
responseData,
|
|
2868
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2869
|
-
);
|
|
2870
|
-
|
|
2871
|
-
if (res_error) {
|
|
2872
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
2873
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2874
|
-
} else {
|
|
2875
|
-
Logger({
|
|
2876
|
-
level: "WARN",
|
|
2877
|
-
message: `Response Validation Warnings for platform > Serviceability > updateServiceability \n ${res_error}`,
|
|
2878
|
-
});
|
|
2879
|
-
}
|
|
2880
|
-
}
|
|
2881
|
-
|
|
2882
|
-
return response;
|
|
2883
|
-
}
|
|
2884
|
-
|
|
2885
|
-
/**
|
|
2886
|
-
* @param {ServiceabilityPlatformValidator.UpdateZoneByIdParam} arg - Arg object
|
|
2887
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2888
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2889
|
-
* @returns {Promise<ServiceabilityPlatformModel.ZoneSuccessResult>} -
|
|
2890
|
-
* Success response
|
|
2891
|
-
* @name updateZoneById
|
|
2892
|
-
* @summary: Update a zone
|
|
2893
|
-
* @description: Update an existing delivery zone . - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/updateZoneById/).
|
|
2894
|
-
*/
|
|
2895
|
-
async updateZoneById(
|
|
2896
|
-
{ zoneId, body, requestHeaders } = { requestHeaders: {} },
|
|
2897
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
2898
|
-
) {
|
|
2899
|
-
const { error } = ServiceabilityPlatformValidator.updateZoneById().validate(
|
|
2900
|
-
{
|
|
2901
|
-
zoneId,
|
|
2902
|
-
body,
|
|
2903
|
-
},
|
|
2904
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2905
|
-
);
|
|
2906
|
-
if (error) {
|
|
2907
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
2908
|
-
}
|
|
2909
|
-
|
|
2910
|
-
// Showing warrnings if extra unknown parameters are found
|
|
2911
|
-
const {
|
|
2912
|
-
error: warrning,
|
|
2913
|
-
} = ServiceabilityPlatformValidator.updateZoneById().validate(
|
|
2914
|
-
{
|
|
2915
|
-
zoneId,
|
|
2916
|
-
body,
|
|
2917
|
-
},
|
|
2918
|
-
{ abortEarly: false, allowUnknown: false }
|
|
2919
|
-
);
|
|
2920
|
-
if (warrning) {
|
|
2921
|
-
Logger({
|
|
2922
|
-
level: "WARN",
|
|
2923
|
-
message: `Parameter Validation warrnings for platform > Serviceability > updateZoneById \n ${warrning}`,
|
|
2924
|
-
});
|
|
2925
|
-
}
|
|
2926
|
-
|
|
2927
|
-
const query_params = {};
|
|
2928
|
-
|
|
2929
|
-
const xHeaders = {};
|
|
2930
|
-
|
|
2931
|
-
const response = await PlatformAPIClient.execute(
|
|
2932
|
-
this.config,
|
|
2933
|
-
"put",
|
|
2934
|
-
`/service/platform/logistics/v2.0/company/${this.config.companyId}/zones/${zoneId}`,
|
|
2505
|
+
"patch",
|
|
2506
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/selfship`,
|
|
2935
2507
|
query_params,
|
|
2936
2508
|
body,
|
|
2937
2509
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -2945,7 +2517,7 @@ class Serviceability {
|
|
|
2945
2517
|
|
|
2946
2518
|
const {
|
|
2947
2519
|
error: res_error,
|
|
2948
|
-
} = ServiceabilityPlatformModel.
|
|
2520
|
+
} = ServiceabilityPlatformModel.SelfshipSchema().validate(responseData, {
|
|
2949
2521
|
abortEarly: false,
|
|
2950
2522
|
allowUnknown: true,
|
|
2951
2523
|
});
|
|
@@ -2956,7 +2528,7 @@ class Serviceability {
|
|
|
2956
2528
|
} else {
|
|
2957
2529
|
Logger({
|
|
2958
2530
|
level: "WARN",
|
|
2959
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
2531
|
+
message: `Response Validation Warnings for platform > Serviceability > updateSelfShipDetails \n ${res_error}`,
|
|
2960
2532
|
});
|
|
2961
2533
|
}
|
|
2962
2534
|
}
|