@gofynd/fdk-client-javascript 3.16.3 → 3.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/sdk/application/ApplicationClient.d.ts +0 -2
- package/sdk/application/ApplicationClient.js +0 -2
- package/sdk/application/Cart/CartApplicationClient.d.ts +40 -0
- package/sdk/application/Cart/CartApplicationClient.js +176 -0
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +18 -4
- package/sdk/application/Catalog/CatalogApplicationClient.js +47 -4
- package/sdk/application/Content/ContentApplicationClient.d.ts +21 -1
- package/sdk/application/Content/ContentApplicationClient.js +93 -2
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +11 -21
- package/sdk/application/Logistic/LogisticApplicationClient.js +34 -83
- package/sdk/application/Order/OrderApplicationClient.d.ts +11 -0
- package/sdk/application/Order/OrderApplicationClient.js +50 -0
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +5 -5
- package/sdk/application/Payment/PaymentApplicationClient.js +5 -4
- package/sdk/partner/Logistics/LogisticsPartnerClient.d.ts +84 -0
- package/sdk/partner/Logistics/LogisticsPartnerClient.js +712 -0
- package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +237 -1
- package/sdk/partner/Logistics/LogisticsPartnerModel.js +157 -0
- package/sdk/partner/Logistics/LogisticsPartnerValidator.d.ts +8 -0
- package/sdk/partner/Logistics/LogisticsPartnerValidator.js +70 -0
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +74 -12
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +637 -36
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +225 -1
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +147 -0
- package/sdk/platform/Cart/CartPlatformModel.d.ts +952 -5
- package/sdk/platform/Cart/CartPlatformModel.js +598 -2
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +125 -5
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +831 -41
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +205 -7
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +154 -3
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +5 -16
- package/sdk/platform/Catalog/CatalogPlatformClient.js +8 -85
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +1025 -159
- package/sdk/platform/Catalog/CatalogPlatformModel.js +840 -165
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +8 -10
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +3 -12
- package/sdk/platform/Common/CommonPlatformModel.d.ts +18 -1
- package/sdk/platform/Common/CommonPlatformModel.js +14 -0
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +1 -73
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +4 -462
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +7 -45
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +4 -55
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +10 -2
- package/sdk/platform/Communication/CommunicationPlatformModel.js +3 -2
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +14 -0
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +6 -0
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +92 -1
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +54 -0
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +21 -0
- package/sdk/platform/Discount/DiscountPlatformModel.js +9 -0
- package/sdk/platform/Order/OrderPlatformClient.d.ts +27 -19
- package/sdk/platform/Order/OrderPlatformClient.js +176 -108
- package/sdk/platform/Order/OrderPlatformModel.d.ts +359 -45
- package/sdk/platform/Order/OrderPlatformModel.js +218 -44
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +40 -43
- package/sdk/platform/Order/OrderPlatformValidator.js +35 -30
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +14 -3
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +88 -6
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +28 -3
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +22 -2
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +376 -11
- package/sdk/platform/Payment/PaymentPlatformModel.js +243 -10
- package/sdk/platform/PlatformApplicationClient.d.ts +0 -2
- package/sdk/platform/PlatformApplicationClient.js +0 -4
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +0 -13
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +0 -82
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +1 -10
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +0 -12
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +212 -28
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +133 -13
- package/sdk/platform/User/UserPlatformModel.d.ts +2 -2
- package/sdk/platform/User/UserPlatformModel.js +4 -4
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +29 -0
- package/sdk/platform/Webhook/WebhookPlatformModel.js +13 -0
- package/sdk/platform/index.d.ts +0 -1
- package/sdk/platform/index.js +0 -2
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +27 -1
- package/sdk/public/Configuration/ConfigurationPublicModel.js +19 -0
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +29 -0
- package/sdk/public/Webhook/WebhookPublicModel.js +13 -0
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +0 -79
- package/sdk/application/Rewards/RewardsApplicationClient.js +0 -315
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +0 -136
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +0 -976
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +0 -152
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +0 -157
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +0 -387
- package/sdk/platform/Rewards/RewardsPlatformModel.js +0 -410
|
@@ -2335,5 +2335,717 @@ class Logistics {
|
|
|
2335
2335
|
|
|
2336
2336
|
return response;
|
|
2337
2337
|
}
|
|
2338
|
+
|
|
2339
|
+
/**
|
|
2340
|
+
* @param {LogisticsPartnerValidator.GetSampleFileRateCardParam} arg - Arg object.
|
|
2341
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2342
|
+
* @param {import("../PartnerAPIClient").Options} - Options
|
|
2343
|
+
* @returns {Promise<LogisticsPartnerModel.RateCardSampleFile>} - Success response
|
|
2344
|
+
* @name getSampleFileRateCard
|
|
2345
|
+
* @summary: Retrieves a sample file that shows the required format for rate card uploads.
|
|
2346
|
+
* @description: Retrieves a downloadable sample file template for bulk rate card uploads. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/partner/logistics/getSampleFileRateCard/).
|
|
2347
|
+
*/
|
|
2348
|
+
async getSampleFileRateCard(
|
|
2349
|
+
{ requestHeaders } = { requestHeaders: {} },
|
|
2350
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
2351
|
+
) {
|
|
2352
|
+
const {
|
|
2353
|
+
error,
|
|
2354
|
+
} = LogisticsPartnerValidator.getSampleFileRateCard().validate(
|
|
2355
|
+
{},
|
|
2356
|
+
{ abortEarly: false, allowUnknown: true }
|
|
2357
|
+
);
|
|
2358
|
+
if (error) {
|
|
2359
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
2360
|
+
}
|
|
2361
|
+
|
|
2362
|
+
// Showing warrnings if extra unknown parameters are found
|
|
2363
|
+
const {
|
|
2364
|
+
error: warrning,
|
|
2365
|
+
} = LogisticsPartnerValidator.getSampleFileRateCard().validate(
|
|
2366
|
+
{},
|
|
2367
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2368
|
+
);
|
|
2369
|
+
if (warrning) {
|
|
2370
|
+
Logger({
|
|
2371
|
+
level: "WARN",
|
|
2372
|
+
message: `Parameter Validation warrnings for partner > Logistics > getSampleFileRateCard \n ${warrning}`,
|
|
2373
|
+
});
|
|
2374
|
+
}
|
|
2375
|
+
|
|
2376
|
+
const query_params = {};
|
|
2377
|
+
|
|
2378
|
+
const response = await PartnerAPIClient.execute(
|
|
2379
|
+
this.config,
|
|
2380
|
+
"get",
|
|
2381
|
+
`/service/partner/logistics/v1.0/organization/${this.config.organizationId}/rate-card/sample-file`,
|
|
2382
|
+
query_params,
|
|
2383
|
+
undefined,
|
|
2384
|
+
requestHeaders,
|
|
2385
|
+
{ responseHeaders }
|
|
2386
|
+
);
|
|
2387
|
+
|
|
2388
|
+
let responseData = response;
|
|
2389
|
+
if (responseHeaders) {
|
|
2390
|
+
responseData = response[0];
|
|
2391
|
+
}
|
|
2392
|
+
|
|
2393
|
+
const {
|
|
2394
|
+
error: res_error,
|
|
2395
|
+
} = LogisticsPartnerModel.RateCardSampleFile().validate(responseData, {
|
|
2396
|
+
abortEarly: false,
|
|
2397
|
+
allowUnknown: true,
|
|
2398
|
+
});
|
|
2399
|
+
|
|
2400
|
+
if (res_error) {
|
|
2401
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
2402
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2403
|
+
} else {
|
|
2404
|
+
Logger({
|
|
2405
|
+
level: "WARN",
|
|
2406
|
+
message: `Response Validation Warnings for partner > Logistics > getSampleFileRateCard \n ${res_error}`,
|
|
2407
|
+
});
|
|
2408
|
+
}
|
|
2409
|
+
}
|
|
2410
|
+
|
|
2411
|
+
return response;
|
|
2412
|
+
}
|
|
2413
|
+
|
|
2414
|
+
/**
|
|
2415
|
+
* @param {LogisticsPartnerValidator.BulkRateCardParam} arg - Arg object.
|
|
2416
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2417
|
+
* @param {import("../PartnerAPIClient").Options} - Options
|
|
2418
|
+
* @returns {Promise<LogisticsPartnerModel.BulkRateCardJob>} - Success response
|
|
2419
|
+
* @name bulkRateCard
|
|
2420
|
+
* @summary: Rate Card Import or Export
|
|
2421
|
+
* @description: Rate Card Import or Export - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/partner/logistics/bulkRateCard/).
|
|
2422
|
+
*/
|
|
2423
|
+
async bulkRateCard(
|
|
2424
|
+
{ extensionId, schemeId, body, requestHeaders } = { requestHeaders: {} },
|
|
2425
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
2426
|
+
) {
|
|
2427
|
+
const { error } = LogisticsPartnerValidator.bulkRateCard().validate(
|
|
2428
|
+
{
|
|
2429
|
+
extensionId,
|
|
2430
|
+
schemeId,
|
|
2431
|
+
body,
|
|
2432
|
+
},
|
|
2433
|
+
{ abortEarly: false, allowUnknown: true }
|
|
2434
|
+
);
|
|
2435
|
+
if (error) {
|
|
2436
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
2437
|
+
}
|
|
2438
|
+
|
|
2439
|
+
// Showing warrnings if extra unknown parameters are found
|
|
2440
|
+
const {
|
|
2441
|
+
error: warrning,
|
|
2442
|
+
} = LogisticsPartnerValidator.bulkRateCard().validate(
|
|
2443
|
+
{
|
|
2444
|
+
extensionId,
|
|
2445
|
+
schemeId,
|
|
2446
|
+
body,
|
|
2447
|
+
},
|
|
2448
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2449
|
+
);
|
|
2450
|
+
if (warrning) {
|
|
2451
|
+
Logger({
|
|
2452
|
+
level: "WARN",
|
|
2453
|
+
message: `Parameter Validation warrnings for partner > Logistics > bulkRateCard \n ${warrning}`,
|
|
2454
|
+
});
|
|
2455
|
+
}
|
|
2456
|
+
|
|
2457
|
+
const query_params = {};
|
|
2458
|
+
|
|
2459
|
+
const response = await PartnerAPIClient.execute(
|
|
2460
|
+
this.config,
|
|
2461
|
+
"post",
|
|
2462
|
+
`/service/partner/logistics/v1.0/organization/${this.config.organizationId}/courier-partner/${extensionId}/scheme/${schemeId}/rate-card/bulk`,
|
|
2463
|
+
query_params,
|
|
2464
|
+
body,
|
|
2465
|
+
requestHeaders,
|
|
2466
|
+
{ responseHeaders }
|
|
2467
|
+
);
|
|
2468
|
+
|
|
2469
|
+
let responseData = response;
|
|
2470
|
+
if (responseHeaders) {
|
|
2471
|
+
responseData = response[0];
|
|
2472
|
+
}
|
|
2473
|
+
|
|
2474
|
+
const {
|
|
2475
|
+
error: res_error,
|
|
2476
|
+
} = LogisticsPartnerModel.BulkRateCardJob().validate(responseData, {
|
|
2477
|
+
abortEarly: false,
|
|
2478
|
+
allowUnknown: true,
|
|
2479
|
+
});
|
|
2480
|
+
|
|
2481
|
+
if (res_error) {
|
|
2482
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
2483
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2484
|
+
} else {
|
|
2485
|
+
Logger({
|
|
2486
|
+
level: "WARN",
|
|
2487
|
+
message: `Response Validation Warnings for partner > Logistics > bulkRateCard \n ${res_error}`,
|
|
2488
|
+
});
|
|
2489
|
+
}
|
|
2490
|
+
}
|
|
2491
|
+
|
|
2492
|
+
return response;
|
|
2493
|
+
}
|
|
2494
|
+
|
|
2495
|
+
/**
|
|
2496
|
+
* @param {LogisticsPartnerValidator.GetBulkRateCardParam} arg - Arg object.
|
|
2497
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2498
|
+
* @param {import("../PartnerAPIClient").Options} - Options
|
|
2499
|
+
* @returns {Promise<LogisticsPartnerModel.BulkRateCardJob>} - Success response
|
|
2500
|
+
* @name getBulkRateCard
|
|
2501
|
+
* @summary: Retrieve the history of bulk rate card uploads.
|
|
2502
|
+
* @description: Returns the history of all bulk rate card upload operations, including their statuses and details. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/partner/logistics/getBulkRateCard/).
|
|
2503
|
+
*/
|
|
2504
|
+
async getBulkRateCard(
|
|
2505
|
+
{
|
|
2506
|
+
extensionId,
|
|
2507
|
+
schemeId,
|
|
2508
|
+
pageNo,
|
|
2509
|
+
pageSize,
|
|
2510
|
+
batchId,
|
|
2511
|
+
action,
|
|
2512
|
+
status,
|
|
2513
|
+
startDate,
|
|
2514
|
+
endDate,
|
|
2515
|
+
requestHeaders,
|
|
2516
|
+
} = { requestHeaders: {} },
|
|
2517
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
2518
|
+
) {
|
|
2519
|
+
const { error } = LogisticsPartnerValidator.getBulkRateCard().validate(
|
|
2520
|
+
{
|
|
2521
|
+
extensionId,
|
|
2522
|
+
schemeId,
|
|
2523
|
+
pageNo,
|
|
2524
|
+
pageSize,
|
|
2525
|
+
batchId,
|
|
2526
|
+
action,
|
|
2527
|
+
status,
|
|
2528
|
+
startDate,
|
|
2529
|
+
endDate,
|
|
2530
|
+
},
|
|
2531
|
+
{ abortEarly: false, allowUnknown: true }
|
|
2532
|
+
);
|
|
2533
|
+
if (error) {
|
|
2534
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
2535
|
+
}
|
|
2536
|
+
|
|
2537
|
+
// Showing warrnings if extra unknown parameters are found
|
|
2538
|
+
const {
|
|
2539
|
+
error: warrning,
|
|
2540
|
+
} = LogisticsPartnerValidator.getBulkRateCard().validate(
|
|
2541
|
+
{
|
|
2542
|
+
extensionId,
|
|
2543
|
+
schemeId,
|
|
2544
|
+
pageNo,
|
|
2545
|
+
pageSize,
|
|
2546
|
+
batchId,
|
|
2547
|
+
action,
|
|
2548
|
+
status,
|
|
2549
|
+
startDate,
|
|
2550
|
+
endDate,
|
|
2551
|
+
},
|
|
2552
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2553
|
+
);
|
|
2554
|
+
if (warrning) {
|
|
2555
|
+
Logger({
|
|
2556
|
+
level: "WARN",
|
|
2557
|
+
message: `Parameter Validation warrnings for partner > Logistics > getBulkRateCard \n ${warrning}`,
|
|
2558
|
+
});
|
|
2559
|
+
}
|
|
2560
|
+
|
|
2561
|
+
const query_params = {};
|
|
2562
|
+
query_params["page_no"] = pageNo;
|
|
2563
|
+
query_params["page_size"] = pageSize;
|
|
2564
|
+
query_params["batch_id"] = batchId;
|
|
2565
|
+
query_params["action"] = action;
|
|
2566
|
+
query_params["status"] = status;
|
|
2567
|
+
query_params["start_date"] = startDate;
|
|
2568
|
+
query_params["end_date"] = endDate;
|
|
2569
|
+
|
|
2570
|
+
const response = await PartnerAPIClient.execute(
|
|
2571
|
+
this.config,
|
|
2572
|
+
"get",
|
|
2573
|
+
`/service/partner/logistics/v1.0/organization/${this.config.organizationId}/courier-partner/${extensionId}/scheme/${schemeId}/rate-card/bulk`,
|
|
2574
|
+
query_params,
|
|
2575
|
+
undefined,
|
|
2576
|
+
requestHeaders,
|
|
2577
|
+
{ responseHeaders }
|
|
2578
|
+
);
|
|
2579
|
+
|
|
2580
|
+
let responseData = response;
|
|
2581
|
+
if (responseHeaders) {
|
|
2582
|
+
responseData = response[0];
|
|
2583
|
+
}
|
|
2584
|
+
|
|
2585
|
+
const {
|
|
2586
|
+
error: res_error,
|
|
2587
|
+
} = LogisticsPartnerModel.BulkRateCardJob().validate(responseData, {
|
|
2588
|
+
abortEarly: false,
|
|
2589
|
+
allowUnknown: true,
|
|
2590
|
+
});
|
|
2591
|
+
|
|
2592
|
+
if (res_error) {
|
|
2593
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
2594
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2595
|
+
} else {
|
|
2596
|
+
Logger({
|
|
2597
|
+
level: "WARN",
|
|
2598
|
+
message: `Response Validation Warnings for partner > Logistics > getBulkRateCard \n ${res_error}`,
|
|
2599
|
+
});
|
|
2600
|
+
}
|
|
2601
|
+
}
|
|
2602
|
+
|
|
2603
|
+
return response;
|
|
2604
|
+
}
|
|
2605
|
+
|
|
2606
|
+
/**
|
|
2607
|
+
* @param {LogisticsPartnerValidator.GetSampleFileRateZoneParam} arg - Arg object.
|
|
2608
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2609
|
+
* @param {import("../PartnerAPIClient").Options} - Options
|
|
2610
|
+
* @returns {Promise<LogisticsPartnerModel.BulkRateCardJob>} - Success response
|
|
2611
|
+
* @name getSampleFileRateZone
|
|
2612
|
+
* @summary: Get Rate Zone sample file
|
|
2613
|
+
* @description: Retrieves a downloadable sample file template for bulk rate zone uploads. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/partner/logistics/getSampleFileRateZone/).
|
|
2614
|
+
*/
|
|
2615
|
+
async getSampleFileRateZone(
|
|
2616
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
2617
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
2618
|
+
) {
|
|
2619
|
+
const {
|
|
2620
|
+
error,
|
|
2621
|
+
} = LogisticsPartnerValidator.getSampleFileRateZone().validate(
|
|
2622
|
+
{
|
|
2623
|
+
body,
|
|
2624
|
+
},
|
|
2625
|
+
{ abortEarly: false, allowUnknown: true }
|
|
2626
|
+
);
|
|
2627
|
+
if (error) {
|
|
2628
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
2629
|
+
}
|
|
2630
|
+
|
|
2631
|
+
// Showing warrnings if extra unknown parameters are found
|
|
2632
|
+
const {
|
|
2633
|
+
error: warrning,
|
|
2634
|
+
} = LogisticsPartnerValidator.getSampleFileRateZone().validate(
|
|
2635
|
+
{
|
|
2636
|
+
body,
|
|
2637
|
+
},
|
|
2638
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2639
|
+
);
|
|
2640
|
+
if (warrning) {
|
|
2641
|
+
Logger({
|
|
2642
|
+
level: "WARN",
|
|
2643
|
+
message: `Parameter Validation warrnings for partner > Logistics > getSampleFileRateZone \n ${warrning}`,
|
|
2644
|
+
});
|
|
2645
|
+
}
|
|
2646
|
+
|
|
2647
|
+
const query_params = {};
|
|
2648
|
+
|
|
2649
|
+
const response = await PartnerAPIClient.execute(
|
|
2650
|
+
this.config,
|
|
2651
|
+
"post",
|
|
2652
|
+
`/service/partner/logistics/v1.0/organization/${this.config.organizationId}/rate-card/zone/sample-file`,
|
|
2653
|
+
query_params,
|
|
2654
|
+
body,
|
|
2655
|
+
requestHeaders,
|
|
2656
|
+
{ responseHeaders }
|
|
2657
|
+
);
|
|
2658
|
+
|
|
2659
|
+
let responseData = response;
|
|
2660
|
+
if (responseHeaders) {
|
|
2661
|
+
responseData = response[0];
|
|
2662
|
+
}
|
|
2663
|
+
|
|
2664
|
+
const {
|
|
2665
|
+
error: res_error,
|
|
2666
|
+
} = LogisticsPartnerModel.BulkRateCardJob().validate(responseData, {
|
|
2667
|
+
abortEarly: false,
|
|
2668
|
+
allowUnknown: true,
|
|
2669
|
+
});
|
|
2670
|
+
|
|
2671
|
+
if (res_error) {
|
|
2672
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
2673
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2674
|
+
} else {
|
|
2675
|
+
Logger({
|
|
2676
|
+
level: "WARN",
|
|
2677
|
+
message: `Response Validation Warnings for partner > Logistics > getSampleFileRateZone \n ${res_error}`,
|
|
2678
|
+
});
|
|
2679
|
+
}
|
|
2680
|
+
}
|
|
2681
|
+
|
|
2682
|
+
return response;
|
|
2683
|
+
}
|
|
2684
|
+
|
|
2685
|
+
/**
|
|
2686
|
+
* @param {LogisticsPartnerValidator.CreateRateZoneBulkJobParam} arg - Arg object.
|
|
2687
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2688
|
+
* @param {import("../PartnerAPIClient").Options} - Options
|
|
2689
|
+
* @returns {Promise<LogisticsPartnerModel.BulkRateCardJob>} - Success response
|
|
2690
|
+
* @name createRateZoneBulkJob
|
|
2691
|
+
* @summary: Rate Zone Import or Export
|
|
2692
|
+
* @description: Performs bulk import or export of rate zone details. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/partner/logistics/createRateZoneBulkJob/).
|
|
2693
|
+
*/
|
|
2694
|
+
async createRateZoneBulkJob(
|
|
2695
|
+
{ extensionId, schemeId, body, requestHeaders } = { requestHeaders: {} },
|
|
2696
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
2697
|
+
) {
|
|
2698
|
+
const {
|
|
2699
|
+
error,
|
|
2700
|
+
} = LogisticsPartnerValidator.createRateZoneBulkJob().validate(
|
|
2701
|
+
{
|
|
2702
|
+
extensionId,
|
|
2703
|
+
schemeId,
|
|
2704
|
+
body,
|
|
2705
|
+
},
|
|
2706
|
+
{ abortEarly: false, allowUnknown: true }
|
|
2707
|
+
);
|
|
2708
|
+
if (error) {
|
|
2709
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
2710
|
+
}
|
|
2711
|
+
|
|
2712
|
+
// Showing warrnings if extra unknown parameters are found
|
|
2713
|
+
const {
|
|
2714
|
+
error: warrning,
|
|
2715
|
+
} = LogisticsPartnerValidator.createRateZoneBulkJob().validate(
|
|
2716
|
+
{
|
|
2717
|
+
extensionId,
|
|
2718
|
+
schemeId,
|
|
2719
|
+
body,
|
|
2720
|
+
},
|
|
2721
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2722
|
+
);
|
|
2723
|
+
if (warrning) {
|
|
2724
|
+
Logger({
|
|
2725
|
+
level: "WARN",
|
|
2726
|
+
message: `Parameter Validation warrnings for partner > Logistics > createRateZoneBulkJob \n ${warrning}`,
|
|
2727
|
+
});
|
|
2728
|
+
}
|
|
2729
|
+
|
|
2730
|
+
const query_params = {};
|
|
2731
|
+
|
|
2732
|
+
const response = await PartnerAPIClient.execute(
|
|
2733
|
+
this.config,
|
|
2734
|
+
"post",
|
|
2735
|
+
`/service/partner/logistics/v1.0/organization/${this.config.organizationId}/courier-partner/${extensionId}/scheme/${schemeId}/rate-card/zone/bulk`,
|
|
2736
|
+
query_params,
|
|
2737
|
+
body,
|
|
2738
|
+
requestHeaders,
|
|
2739
|
+
{ responseHeaders }
|
|
2740
|
+
);
|
|
2741
|
+
|
|
2742
|
+
let responseData = response;
|
|
2743
|
+
if (responseHeaders) {
|
|
2744
|
+
responseData = response[0];
|
|
2745
|
+
}
|
|
2746
|
+
|
|
2747
|
+
const {
|
|
2748
|
+
error: res_error,
|
|
2749
|
+
} = LogisticsPartnerModel.BulkRateCardJob().validate(responseData, {
|
|
2750
|
+
abortEarly: false,
|
|
2751
|
+
allowUnknown: true,
|
|
2752
|
+
});
|
|
2753
|
+
|
|
2754
|
+
if (res_error) {
|
|
2755
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
2756
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2757
|
+
} else {
|
|
2758
|
+
Logger({
|
|
2759
|
+
level: "WARN",
|
|
2760
|
+
message: `Response Validation Warnings for partner > Logistics > createRateZoneBulkJob \n ${res_error}`,
|
|
2761
|
+
});
|
|
2762
|
+
}
|
|
2763
|
+
}
|
|
2764
|
+
|
|
2765
|
+
return response;
|
|
2766
|
+
}
|
|
2767
|
+
|
|
2768
|
+
/**
|
|
2769
|
+
* @param {LogisticsPartnerValidator.GetBulkRateZoneJobHistoryParam} arg - Arg object.
|
|
2770
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2771
|
+
* @param {import("../PartnerAPIClient").Options} - Options
|
|
2772
|
+
* @returns {Promise<LogisticsPartnerModel.RateZoneBulkJobList>} - Success response
|
|
2773
|
+
* @name getBulkRateZoneJobHistory
|
|
2774
|
+
* @summary: Get Rate Zone Bulk History
|
|
2775
|
+
* @description: Retrieves the bulk job history for rate zone import and export operations. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/partner/logistics/getBulkRateZoneJobHistory/).
|
|
2776
|
+
*/
|
|
2777
|
+
async getBulkRateZoneJobHistory(
|
|
2778
|
+
{
|
|
2779
|
+
extensionId,
|
|
2780
|
+
schemeId,
|
|
2781
|
+
pageNo,
|
|
2782
|
+
pageSize,
|
|
2783
|
+
batchId,
|
|
2784
|
+
action,
|
|
2785
|
+
status,
|
|
2786
|
+
zoneType,
|
|
2787
|
+
startDate,
|
|
2788
|
+
endDate,
|
|
2789
|
+
requestHeaders,
|
|
2790
|
+
} = { requestHeaders: {} },
|
|
2791
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
2792
|
+
) {
|
|
2793
|
+
const {
|
|
2794
|
+
error,
|
|
2795
|
+
} = LogisticsPartnerValidator.getBulkRateZoneJobHistory().validate(
|
|
2796
|
+
{
|
|
2797
|
+
extensionId,
|
|
2798
|
+
schemeId,
|
|
2799
|
+
pageNo,
|
|
2800
|
+
pageSize,
|
|
2801
|
+
batchId,
|
|
2802
|
+
action,
|
|
2803
|
+
status,
|
|
2804
|
+
zoneType,
|
|
2805
|
+
startDate,
|
|
2806
|
+
endDate,
|
|
2807
|
+
},
|
|
2808
|
+
{ abortEarly: false, allowUnknown: true }
|
|
2809
|
+
);
|
|
2810
|
+
if (error) {
|
|
2811
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
2812
|
+
}
|
|
2813
|
+
|
|
2814
|
+
// Showing warrnings if extra unknown parameters are found
|
|
2815
|
+
const {
|
|
2816
|
+
error: warrning,
|
|
2817
|
+
} = LogisticsPartnerValidator.getBulkRateZoneJobHistory().validate(
|
|
2818
|
+
{
|
|
2819
|
+
extensionId,
|
|
2820
|
+
schemeId,
|
|
2821
|
+
pageNo,
|
|
2822
|
+
pageSize,
|
|
2823
|
+
batchId,
|
|
2824
|
+
action,
|
|
2825
|
+
status,
|
|
2826
|
+
zoneType,
|
|
2827
|
+
startDate,
|
|
2828
|
+
endDate,
|
|
2829
|
+
},
|
|
2830
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2831
|
+
);
|
|
2832
|
+
if (warrning) {
|
|
2833
|
+
Logger({
|
|
2834
|
+
level: "WARN",
|
|
2835
|
+
message: `Parameter Validation warrnings for partner > Logistics > getBulkRateZoneJobHistory \n ${warrning}`,
|
|
2836
|
+
});
|
|
2837
|
+
}
|
|
2838
|
+
|
|
2839
|
+
const query_params = {};
|
|
2840
|
+
query_params["page_no"] = pageNo;
|
|
2841
|
+
query_params["page_size"] = pageSize;
|
|
2842
|
+
query_params["batch_id"] = batchId;
|
|
2843
|
+
query_params["action"] = action;
|
|
2844
|
+
query_params["status"] = status;
|
|
2845
|
+
query_params["zone_type"] = zoneType;
|
|
2846
|
+
query_params["start_date"] = startDate;
|
|
2847
|
+
query_params["end_date"] = endDate;
|
|
2848
|
+
|
|
2849
|
+
const response = await PartnerAPIClient.execute(
|
|
2850
|
+
this.config,
|
|
2851
|
+
"get",
|
|
2852
|
+
`/service/partner/logistics/v1.0/organization/${this.config.organizationId}/courier-partner/${extensionId}/scheme/${schemeId}/rate-card/zone/bulk`,
|
|
2853
|
+
query_params,
|
|
2854
|
+
undefined,
|
|
2855
|
+
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
|
+
} = LogisticsPartnerModel.RateZoneBulkJobList().validate(responseData, {
|
|
2867
|
+
abortEarly: false,
|
|
2868
|
+
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 partner > Logistics > getBulkRateZoneJobHistory \n ${res_error}`,
|
|
2878
|
+
});
|
|
2879
|
+
}
|
|
2880
|
+
}
|
|
2881
|
+
|
|
2882
|
+
return response;
|
|
2883
|
+
}
|
|
2884
|
+
|
|
2885
|
+
/**
|
|
2886
|
+
* @param {LogisticsPartnerValidator.GetRateZoneConfigParam} arg - Arg object.
|
|
2887
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2888
|
+
* @param {import("../PartnerAPIClient").Options} - Options
|
|
2889
|
+
* @returns {Promise<LogisticsPartnerModel.RateZoneConfigurationDetails>} -
|
|
2890
|
+
* Success response
|
|
2891
|
+
* @name getRateZoneConfig
|
|
2892
|
+
* @summary: Fetch Rate Zone Configuration
|
|
2893
|
+
* @description: Fetch Rate Zone Configuration - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/partner/logistics/getRateZoneConfig/).
|
|
2894
|
+
*/
|
|
2895
|
+
async getRateZoneConfig(
|
|
2896
|
+
{ extensionId, schemeId, requestHeaders } = { requestHeaders: {} },
|
|
2897
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
2898
|
+
) {
|
|
2899
|
+
const { error } = LogisticsPartnerValidator.getRateZoneConfig().validate(
|
|
2900
|
+
{
|
|
2901
|
+
extensionId,
|
|
2902
|
+
schemeId,
|
|
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
|
+
} = LogisticsPartnerValidator.getRateZoneConfig().validate(
|
|
2914
|
+
{
|
|
2915
|
+
extensionId,
|
|
2916
|
+
schemeId,
|
|
2917
|
+
},
|
|
2918
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2919
|
+
);
|
|
2920
|
+
if (warrning) {
|
|
2921
|
+
Logger({
|
|
2922
|
+
level: "WARN",
|
|
2923
|
+
message: `Parameter Validation warrnings for partner > Logistics > getRateZoneConfig \n ${warrning}`,
|
|
2924
|
+
});
|
|
2925
|
+
}
|
|
2926
|
+
|
|
2927
|
+
const query_params = {};
|
|
2928
|
+
|
|
2929
|
+
const response = await PartnerAPIClient.execute(
|
|
2930
|
+
this.config,
|
|
2931
|
+
"get",
|
|
2932
|
+
`/service/partner/logistics/v1.0/organization/${this.config.organizationId}/courier-partner/${extensionId}/scheme/${schemeId}/rate-card/zone/configuration`,
|
|
2933
|
+
query_params,
|
|
2934
|
+
undefined,
|
|
2935
|
+
requestHeaders,
|
|
2936
|
+
{ responseHeaders }
|
|
2937
|
+
);
|
|
2938
|
+
|
|
2939
|
+
let responseData = response;
|
|
2940
|
+
if (responseHeaders) {
|
|
2941
|
+
responseData = response[0];
|
|
2942
|
+
}
|
|
2943
|
+
|
|
2944
|
+
const {
|
|
2945
|
+
error: res_error,
|
|
2946
|
+
} = LogisticsPartnerModel.RateZoneConfigurationDetails().validate(
|
|
2947
|
+
responseData,
|
|
2948
|
+
{ abortEarly: false, allowUnknown: true }
|
|
2949
|
+
);
|
|
2950
|
+
|
|
2951
|
+
if (res_error) {
|
|
2952
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
2953
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2954
|
+
} else {
|
|
2955
|
+
Logger({
|
|
2956
|
+
level: "WARN",
|
|
2957
|
+
message: `Response Validation Warnings for partner > Logistics > getRateZoneConfig \n ${res_error}`,
|
|
2958
|
+
});
|
|
2959
|
+
}
|
|
2960
|
+
}
|
|
2961
|
+
|
|
2962
|
+
return response;
|
|
2963
|
+
}
|
|
2964
|
+
|
|
2965
|
+
/**
|
|
2966
|
+
* @param {LogisticsPartnerValidator.UpdateRateZoneConfigurationParam} arg
|
|
2967
|
+
* - Arg object.
|
|
2968
|
+
*
|
|
2969
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2970
|
+
* @param {import("../PartnerAPIClient").Options} - Options
|
|
2971
|
+
* @returns {Promise<LogisticsPartnerModel.RateZoneConfigurationDetails>} -
|
|
2972
|
+
* Success response
|
|
2973
|
+
* @name updateRateZoneConfiguration
|
|
2974
|
+
* @summary: Update Rate Zone Configuration
|
|
2975
|
+
* @description: Updates the rate zone configuration for the specified courier partner scheme. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/partner/logistics/updateRateZoneConfiguration/).
|
|
2976
|
+
*/
|
|
2977
|
+
async updateRateZoneConfiguration(
|
|
2978
|
+
{ extensionId, schemeId, body, requestHeaders } = { requestHeaders: {} },
|
|
2979
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
2980
|
+
) {
|
|
2981
|
+
const {
|
|
2982
|
+
error,
|
|
2983
|
+
} = LogisticsPartnerValidator.updateRateZoneConfiguration().validate(
|
|
2984
|
+
{
|
|
2985
|
+
extensionId,
|
|
2986
|
+
schemeId,
|
|
2987
|
+
body,
|
|
2988
|
+
},
|
|
2989
|
+
{ abortEarly: false, allowUnknown: true }
|
|
2990
|
+
);
|
|
2991
|
+
if (error) {
|
|
2992
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
2993
|
+
}
|
|
2994
|
+
|
|
2995
|
+
// Showing warrnings if extra unknown parameters are found
|
|
2996
|
+
const {
|
|
2997
|
+
error: warrning,
|
|
2998
|
+
} = LogisticsPartnerValidator.updateRateZoneConfiguration().validate(
|
|
2999
|
+
{
|
|
3000
|
+
extensionId,
|
|
3001
|
+
schemeId,
|
|
3002
|
+
body,
|
|
3003
|
+
},
|
|
3004
|
+
{ abortEarly: false, allowUnknown: false }
|
|
3005
|
+
);
|
|
3006
|
+
if (warrning) {
|
|
3007
|
+
Logger({
|
|
3008
|
+
level: "WARN",
|
|
3009
|
+
message: `Parameter Validation warrnings for partner > Logistics > updateRateZoneConfiguration \n ${warrning}`,
|
|
3010
|
+
});
|
|
3011
|
+
}
|
|
3012
|
+
|
|
3013
|
+
const query_params = {};
|
|
3014
|
+
|
|
3015
|
+
const response = await PartnerAPIClient.execute(
|
|
3016
|
+
this.config,
|
|
3017
|
+
"put",
|
|
3018
|
+
`/service/partner/logistics/v1.0/organization/${this.config.organizationId}/courier-partner/${extensionId}/scheme/${schemeId}/rate-card/zone/configuration`,
|
|
3019
|
+
query_params,
|
|
3020
|
+
body,
|
|
3021
|
+
requestHeaders,
|
|
3022
|
+
{ responseHeaders }
|
|
3023
|
+
);
|
|
3024
|
+
|
|
3025
|
+
let responseData = response;
|
|
3026
|
+
if (responseHeaders) {
|
|
3027
|
+
responseData = response[0];
|
|
3028
|
+
}
|
|
3029
|
+
|
|
3030
|
+
const {
|
|
3031
|
+
error: res_error,
|
|
3032
|
+
} = LogisticsPartnerModel.RateZoneConfigurationDetails().validate(
|
|
3033
|
+
responseData,
|
|
3034
|
+
{ abortEarly: false, allowUnknown: true }
|
|
3035
|
+
);
|
|
3036
|
+
|
|
3037
|
+
if (res_error) {
|
|
3038
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
3039
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
3040
|
+
} else {
|
|
3041
|
+
Logger({
|
|
3042
|
+
level: "WARN",
|
|
3043
|
+
message: `Response Validation Warnings for partner > Logistics > updateRateZoneConfiguration \n ${res_error}`,
|
|
3044
|
+
});
|
|
3045
|
+
}
|
|
3046
|
+
}
|
|
3047
|
+
|
|
3048
|
+
return response;
|
|
3049
|
+
}
|
|
2338
3050
|
}
|
|
2339
3051
|
module.exports = Logistics;
|