@gofynd/fdk-client-javascript 1.4.15-beta.6 → 1.4.15-beta.8
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 -252
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +16 -16
- package/sdk/application/Catalog/CatalogApplicationClient.js +90 -339
- package/sdk/application/Common/CommonApplicationClient.js +1 -16
- package/sdk/application/Communication/CommunicationApplicationClient.js +1 -24
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +2 -2
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +11 -134
- package/sdk/application/Content/ContentApplicationClient.d.ts +8 -8
- package/sdk/application/Content/ContentApplicationClient.js +44 -206
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +5 -3
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +14 -30
- package/sdk/application/Lead/LeadApplicationClient.d.ts +4 -4
- package/sdk/application/Lead/LeadApplicationClient.js +21 -52
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +5 -5
- package/sdk/application/Logistic/LogisticApplicationClient.js +32 -128
- package/sdk/application/Order/OrderApplicationClient.d.ts +10 -10
- package/sdk/application/Order/OrderApplicationClient.js +63 -142
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +1 -1
- package/sdk/application/Payment/PaymentApplicationClient.js +6 -418
- 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 +10 -7
- package/sdk/common/Validator.d.ts +1 -0
- package/sdk/common/Validator.js +20 -0
- package/sdk/common/utils.d.ts +0 -1
- package/sdk/common/utils.js +0 -14
- package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +2 -0
- package/sdk/partner/FileStorage/FileStoragePartnerModel.js +2 -0
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +7 -0
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +3 -0
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +3 -1
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +3 -0
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +3 -1
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +3 -0
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +16 -1
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +20 -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 +10 -0
- package/sdk/platform/Order/OrderPlatformClient.js +99 -0
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +33 -1
- package/sdk/platform/Order/OrderPlatformValidator.js +20 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +0 -10
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +0 -118
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +1 -53
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +0 -29
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +10 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +119 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +58 -1
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +30 -0
- package/sdk/public/Configuration/ConfigurationPublicClient.js +1 -16
- package/sdk/public/Content/ContentPublicClient.d.ts +1 -1
- package/sdk/public/Content/ContentPublicClient.js +6 -11
- package/sdk/public/Partner/PartnerPublicClient.d.ts +1 -1
- package/sdk/public/Partner/PartnerPublicClient.js +6 -11
- package/sdk/public/Webhook/WebhookPublicClient.js +1 -40
|
@@ -910,6 +910,105 @@ class Order {
|
|
|
910
910
|
return response;
|
|
911
911
|
}
|
|
912
912
|
|
|
913
|
+
/**
|
|
914
|
+
* @param {OrderPlatformValidator.FailedOrderLogsParam} arg - Arg object
|
|
915
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
916
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
917
|
+
* @returns {Promise<OrderPlatformModel.FailedOrderLogs>} - Success response
|
|
918
|
+
* @name failedOrderLogs
|
|
919
|
+
* @summary: List failed order logs
|
|
920
|
+
* @description: Get failed order logs listing for filters based on order Id, user contact number, user email Id and sales channel Id. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/failedOrderLogs/).
|
|
921
|
+
*/
|
|
922
|
+
async failedOrderLogs(
|
|
923
|
+
{
|
|
924
|
+
applicationId,
|
|
925
|
+
pageNo,
|
|
926
|
+
pageSize,
|
|
927
|
+
searchType,
|
|
928
|
+
searchValue,
|
|
929
|
+
requestHeaders,
|
|
930
|
+
} = { requestHeaders: {} },
|
|
931
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
932
|
+
) {
|
|
933
|
+
const { error } = OrderPlatformValidator.failedOrderLogs().validate(
|
|
934
|
+
{
|
|
935
|
+
applicationId,
|
|
936
|
+
pageNo,
|
|
937
|
+
pageSize,
|
|
938
|
+
searchType,
|
|
939
|
+
searchValue,
|
|
940
|
+
},
|
|
941
|
+
{ abortEarly: false, allowUnknown: true }
|
|
942
|
+
);
|
|
943
|
+
if (error) {
|
|
944
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
// Showing warrnings if extra unknown parameters are found
|
|
948
|
+
const {
|
|
949
|
+
error: warrning,
|
|
950
|
+
} = OrderPlatformValidator.failedOrderLogs().validate(
|
|
951
|
+
{
|
|
952
|
+
applicationId,
|
|
953
|
+
pageNo,
|
|
954
|
+
pageSize,
|
|
955
|
+
searchType,
|
|
956
|
+
searchValue,
|
|
957
|
+
},
|
|
958
|
+
{ abortEarly: false, allowUnknown: false }
|
|
959
|
+
);
|
|
960
|
+
if (warrning) {
|
|
961
|
+
Logger({
|
|
962
|
+
level: "WARN",
|
|
963
|
+
message: `Parameter Validation warrnings for platform > Order > failedOrderLogs \n ${warrning}`,
|
|
964
|
+
});
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
const query_params = {};
|
|
968
|
+
query_params["application_id"] = applicationId;
|
|
969
|
+
query_params["page_no"] = pageNo;
|
|
970
|
+
query_params["page_size"] = pageSize;
|
|
971
|
+
query_params["search_type"] = searchType;
|
|
972
|
+
query_params["search_value"] = searchValue;
|
|
973
|
+
|
|
974
|
+
const xHeaders = {};
|
|
975
|
+
|
|
976
|
+
const response = await PlatformAPIClient.execute(
|
|
977
|
+
this.config,
|
|
978
|
+
"get",
|
|
979
|
+
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/orders/failed`,
|
|
980
|
+
query_params,
|
|
981
|
+
undefined,
|
|
982
|
+
{ ...xHeaders, ...requestHeaders },
|
|
983
|
+
{ responseHeaders }
|
|
984
|
+
);
|
|
985
|
+
|
|
986
|
+
let responseData = response;
|
|
987
|
+
if (responseHeaders) {
|
|
988
|
+
responseData = response[0];
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
const {
|
|
992
|
+
error: res_error,
|
|
993
|
+
} = OrderPlatformModel.FailedOrderLogs().validate(responseData, {
|
|
994
|
+
abortEarly: false,
|
|
995
|
+
allowUnknown: true,
|
|
996
|
+
});
|
|
997
|
+
|
|
998
|
+
if (res_error) {
|
|
999
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
1000
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1001
|
+
} else {
|
|
1002
|
+
Logger({
|
|
1003
|
+
level: "WARN",
|
|
1004
|
+
message: `Response Validation Warnings for platform > Order > failedOrderLogs \n ${res_error}`,
|
|
1005
|
+
});
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
return response;
|
|
1010
|
+
}
|
|
1011
|
+
|
|
913
1012
|
/**
|
|
914
1013
|
* @param {OrderPlatformValidator.FetchRefundModeConfigParam} arg - Arg object
|
|
915
1014
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -51,6 +51,14 @@ export = OrderPlatformValidator;
|
|
|
51
51
|
* @typedef FailedOrderLogDetailsParam
|
|
52
52
|
* @property {string} logId - Log Error ID
|
|
53
53
|
*/
|
|
54
|
+
/**
|
|
55
|
+
* @typedef FailedOrderLogsParam
|
|
56
|
+
* @property {string} [applicationId] - Application ID
|
|
57
|
+
* @property {number} [pageNo] - Page Number
|
|
58
|
+
* @property {number} [pageSize] - Page Size
|
|
59
|
+
* @property {string} [searchType] - Search type for filter
|
|
60
|
+
* @property {string} [searchValue] - Search value for filter
|
|
61
|
+
*/
|
|
54
62
|
/**
|
|
55
63
|
* @typedef FetchRefundModeConfigParam
|
|
56
64
|
* @property {OrderPlatformModel.RefundModeConfigRequestPayload} body
|
|
@@ -410,6 +418,8 @@ declare class OrderPlatformValidator {
|
|
|
410
418
|
static eInvoiceRetry(): EInvoiceRetryParam;
|
|
411
419
|
/** @returns {FailedOrderLogDetailsParam} */
|
|
412
420
|
static failedOrderLogDetails(): FailedOrderLogDetailsParam;
|
|
421
|
+
/** @returns {FailedOrderLogsParam} */
|
|
422
|
+
static failedOrderLogs(): FailedOrderLogsParam;
|
|
413
423
|
/** @returns {FetchRefundModeConfigParam} */
|
|
414
424
|
static fetchRefundModeConfig(): FetchRefundModeConfigParam;
|
|
415
425
|
/** @returns {GenerateInvoiceIDParam} */
|
|
@@ -498,7 +508,7 @@ declare class OrderPlatformValidator {
|
|
|
498
508
|
static verifyMobileOTP(): VerifyMobileOTPParam;
|
|
499
509
|
}
|
|
500
510
|
declare namespace OrderPlatformValidator {
|
|
501
|
-
export { AddStateManagerConfigParam, AttachOrderUserParam, BulkListingParam, BulkStateTransistionParam, CheckOrderStatusParam, CreateOrderParam, DispatchManifestsParam, DownloadBulkActionTemplateParam, DownloadLanesReportParam, EInvoiceRetryParam, FailedOrderLogDetailsParam, FetchRefundModeConfigParam, GenerateInvoiceIDParam, GeneratePOSReceiptByOrderIdParam, GenerateProcessManifestParam, GetAllowedStateTransitionParam, GetAllowedTemplatesForBulkParam, GetAnnouncementsParam, GetBagByIdParam, GetBagsParam, GetBulkActionTemplateParam, GetBulkShipmentExcelFileParam, GetFileByStatusParam, GetLaneConfigParam, GetManifestDetailsParam, GetManifestShipmentsParam, GetManifestfiltersParam, GetManifestsParam, GetOrderByIdParam, GetOrdersParam, GetRoleBasedActionsParam, GetShipmentByIdParam, GetShipmentHistoryParam, GetShipmentReasonsParam, GetShipmentsParam, GetStateManagerConfigParam, GetStateTransitionMapParam, GetTemplateParam, GetfiltersParam, InvalidateShipmentCacheParam, JobDetailsParam, OrderUpdateParam, PostShipmentHistoryParam, ReassignLocationParam, SendSmsNinjaParam, SendUserMobileOTPParam, TrackShipmentParam, UpdateAddressParam, UpdatePackagingDimensionsParam, UpdateShipmentLockParam, UpdateShipmentStatusParam, UpdateShipmentTrackingParam, UploadConsentsParam, VerifyMobileOTPParam };
|
|
511
|
+
export { AddStateManagerConfigParam, AttachOrderUserParam, BulkListingParam, BulkStateTransistionParam, CheckOrderStatusParam, CreateOrderParam, DispatchManifestsParam, DownloadBulkActionTemplateParam, DownloadLanesReportParam, EInvoiceRetryParam, FailedOrderLogDetailsParam, FailedOrderLogsParam, FetchRefundModeConfigParam, GenerateInvoiceIDParam, GeneratePOSReceiptByOrderIdParam, GenerateProcessManifestParam, GetAllowedStateTransitionParam, GetAllowedTemplatesForBulkParam, GetAnnouncementsParam, GetBagByIdParam, GetBagsParam, GetBulkActionTemplateParam, GetBulkShipmentExcelFileParam, GetFileByStatusParam, GetLaneConfigParam, GetManifestDetailsParam, GetManifestShipmentsParam, GetManifestfiltersParam, GetManifestsParam, GetOrderByIdParam, GetOrdersParam, GetRoleBasedActionsParam, GetShipmentByIdParam, GetShipmentHistoryParam, GetShipmentReasonsParam, GetShipmentsParam, GetStateManagerConfigParam, GetStateTransitionMapParam, GetTemplateParam, GetfiltersParam, InvalidateShipmentCacheParam, JobDetailsParam, OrderUpdateParam, PostShipmentHistoryParam, ReassignLocationParam, SendSmsNinjaParam, SendUserMobileOTPParam, TrackShipmentParam, UpdateAddressParam, UpdatePackagingDimensionsParam, UpdateShipmentLockParam, UpdateShipmentStatusParam, UpdateShipmentTrackingParam, UploadConsentsParam, VerifyMobileOTPParam };
|
|
502
512
|
}
|
|
503
513
|
type AddStateManagerConfigParam = {
|
|
504
514
|
body: OrderPlatformModel.TransitionConfigPayload;
|
|
@@ -568,6 +578,28 @@ type FailedOrderLogDetailsParam = {
|
|
|
568
578
|
*/
|
|
569
579
|
logId: string;
|
|
570
580
|
};
|
|
581
|
+
type FailedOrderLogsParam = {
|
|
582
|
+
/**
|
|
583
|
+
* - Application ID
|
|
584
|
+
*/
|
|
585
|
+
applicationId?: string;
|
|
586
|
+
/**
|
|
587
|
+
* - Page Number
|
|
588
|
+
*/
|
|
589
|
+
pageNo?: number;
|
|
590
|
+
/**
|
|
591
|
+
* - Page Size
|
|
592
|
+
*/
|
|
593
|
+
pageSize?: number;
|
|
594
|
+
/**
|
|
595
|
+
* - Search type for filter
|
|
596
|
+
*/
|
|
597
|
+
searchType?: string;
|
|
598
|
+
/**
|
|
599
|
+
* - Search value for filter
|
|
600
|
+
*/
|
|
601
|
+
searchValue?: string;
|
|
602
|
+
};
|
|
571
603
|
type FetchRefundModeConfigParam = {
|
|
572
604
|
body: OrderPlatformModel.RefundModeConfigRequestPayload;
|
|
573
605
|
};
|
|
@@ -65,6 +65,15 @@ const OrderPlatformModel = require("./OrderPlatformModel");
|
|
|
65
65
|
* @property {string} logId - Log Error ID
|
|
66
66
|
*/
|
|
67
67
|
|
|
68
|
+
/**
|
|
69
|
+
* @typedef FailedOrderLogsParam
|
|
70
|
+
* @property {string} [applicationId] - Application ID
|
|
71
|
+
* @property {number} [pageNo] - Page Number
|
|
72
|
+
* @property {number} [pageSize] - Page Size
|
|
73
|
+
* @property {string} [searchType] - Search type for filter
|
|
74
|
+
* @property {string} [searchValue] - Search value for filter
|
|
75
|
+
*/
|
|
76
|
+
|
|
68
77
|
/**
|
|
69
78
|
* @typedef FetchRefundModeConfigParam
|
|
70
79
|
* @property {OrderPlatformModel.RefundModeConfigRequestPayload} body
|
|
@@ -528,6 +537,17 @@ class OrderPlatformValidator {
|
|
|
528
537
|
}).required();
|
|
529
538
|
}
|
|
530
539
|
|
|
540
|
+
/** @returns {FailedOrderLogsParam} */
|
|
541
|
+
static failedOrderLogs() {
|
|
542
|
+
return Joi.object({
|
|
543
|
+
applicationId: Joi.string().allow(""),
|
|
544
|
+
pageNo: Joi.number(),
|
|
545
|
+
pageSize: Joi.number(),
|
|
546
|
+
searchType: Joi.string().allow(""),
|
|
547
|
+
searchValue: Joi.string().allow(""),
|
|
548
|
+
}).required();
|
|
549
|
+
}
|
|
550
|
+
|
|
531
551
|
/** @returns {FetchRefundModeConfigParam} */
|
|
532
552
|
static fetchRefundModeConfig() {
|
|
533
553
|
return Joi.object({
|
|
@@ -126,16 +126,6 @@ declare class Serviceability {
|
|
|
126
126
|
* @description: Retrieves an existing order routing setup for a single application - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getStoreRules/).
|
|
127
127
|
*/
|
|
128
128
|
getStoreRules({ pageNo, pageSize, status, requestHeaders }?: ServiceabilityPlatformApplicationValidator.GetStoreRulesParam, { responseHeaders }?: object): Promise<ServiceabilityPlatformModel.GetStoreRulesApiResponse>;
|
|
129
|
-
/**
|
|
130
|
-
* @param {ServiceabilityPlatformApplicationValidator.GetZonesParam} arg - Arg object
|
|
131
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
132
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
133
|
-
* @returns {Promise<ServiceabilityPlatformModel.ListViewResponse>} - Success response
|
|
134
|
-
* @name getZones
|
|
135
|
-
* @summary: Get zones
|
|
136
|
-
* @description: Retrieves a list of delivery zones. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getZones/).
|
|
137
|
-
*/
|
|
138
|
-
getZones({ pageNo, pageSize, isActive, q, countryIsoCode, state, city, pincode, sector, requestHeaders, }?: ServiceabilityPlatformApplicationValidator.GetZonesParam, { responseHeaders }?: object): Promise<ServiceabilityPlatformModel.ListViewResponse>;
|
|
139
129
|
/**
|
|
140
130
|
* @param {ServiceabilityPlatformApplicationValidator.InsertApplicationConfigParam} arg
|
|
141
131
|
* - Arg object
|
|
@@ -761,124 +761,6 @@ class Serviceability {
|
|
|
761
761
|
return response;
|
|
762
762
|
}
|
|
763
763
|
|
|
764
|
-
/**
|
|
765
|
-
* @param {ServiceabilityPlatformApplicationValidator.GetZonesParam} arg - Arg object
|
|
766
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
767
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
768
|
-
* @returns {Promise<ServiceabilityPlatformModel.ListViewResponse>} - Success response
|
|
769
|
-
* @name getZones
|
|
770
|
-
* @summary: Get zones
|
|
771
|
-
* @description: Retrieves a list of delivery zones. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getZones/).
|
|
772
|
-
*/
|
|
773
|
-
async getZones(
|
|
774
|
-
{
|
|
775
|
-
pageNo,
|
|
776
|
-
pageSize,
|
|
777
|
-
isActive,
|
|
778
|
-
q,
|
|
779
|
-
countryIsoCode,
|
|
780
|
-
state,
|
|
781
|
-
city,
|
|
782
|
-
pincode,
|
|
783
|
-
sector,
|
|
784
|
-
requestHeaders,
|
|
785
|
-
} = { requestHeaders: {} },
|
|
786
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
787
|
-
) {
|
|
788
|
-
const {
|
|
789
|
-
error,
|
|
790
|
-
} = ServiceabilityPlatformApplicationValidator.getZones().validate(
|
|
791
|
-
{
|
|
792
|
-
pageNo,
|
|
793
|
-
pageSize,
|
|
794
|
-
isActive,
|
|
795
|
-
|
|
796
|
-
q,
|
|
797
|
-
countryIsoCode,
|
|
798
|
-
state,
|
|
799
|
-
city,
|
|
800
|
-
pincode,
|
|
801
|
-
sector,
|
|
802
|
-
},
|
|
803
|
-
{ abortEarly: false, allowUnknown: true }
|
|
804
|
-
);
|
|
805
|
-
if (error) {
|
|
806
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
807
|
-
}
|
|
808
|
-
|
|
809
|
-
// Showing warrnings if extra unknown parameters are found
|
|
810
|
-
const {
|
|
811
|
-
error: warrning,
|
|
812
|
-
} = ServiceabilityPlatformApplicationValidator.getZones().validate(
|
|
813
|
-
{
|
|
814
|
-
pageNo,
|
|
815
|
-
pageSize,
|
|
816
|
-
isActive,
|
|
817
|
-
|
|
818
|
-
q,
|
|
819
|
-
countryIsoCode,
|
|
820
|
-
state,
|
|
821
|
-
city,
|
|
822
|
-
pincode,
|
|
823
|
-
sector,
|
|
824
|
-
},
|
|
825
|
-
{ abortEarly: false, allowUnknown: false }
|
|
826
|
-
);
|
|
827
|
-
if (warrning) {
|
|
828
|
-
Logger({
|
|
829
|
-
level: "WARN",
|
|
830
|
-
message: `Parameter Validation warrnings for platform > Serviceability > getZones \n ${warrning}`,
|
|
831
|
-
});
|
|
832
|
-
}
|
|
833
|
-
|
|
834
|
-
const query_params = {};
|
|
835
|
-
query_params["page_no"] = pageNo;
|
|
836
|
-
query_params["page_size"] = pageSize;
|
|
837
|
-
query_params["is_active"] = isActive;
|
|
838
|
-
query_params["application_id"] = applicationId;
|
|
839
|
-
query_params["q"] = q;
|
|
840
|
-
query_params["country_iso_code"] = countryIsoCode;
|
|
841
|
-
query_params["state"] = state;
|
|
842
|
-
query_params["city"] = city;
|
|
843
|
-
query_params["pincode"] = pincode;
|
|
844
|
-
query_params["sector"] = sector;
|
|
845
|
-
|
|
846
|
-
const response = await PlatformAPIClient.execute(
|
|
847
|
-
this.config,
|
|
848
|
-
"get",
|
|
849
|
-
`/service/platform/logistics/v2.0/company/${this.config.companyId}/zones`,
|
|
850
|
-
query_params,
|
|
851
|
-
undefined,
|
|
852
|
-
requestHeaders,
|
|
853
|
-
{ responseHeaders }
|
|
854
|
-
);
|
|
855
|
-
|
|
856
|
-
let responseData = response;
|
|
857
|
-
if (responseHeaders) {
|
|
858
|
-
responseData = response[0];
|
|
859
|
-
}
|
|
860
|
-
|
|
861
|
-
const {
|
|
862
|
-
error: res_error,
|
|
863
|
-
} = ServiceabilityPlatformModel.ListViewResponse().validate(responseData, {
|
|
864
|
-
abortEarly: false,
|
|
865
|
-
allowUnknown: true,
|
|
866
|
-
});
|
|
867
|
-
|
|
868
|
-
if (res_error) {
|
|
869
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
870
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
871
|
-
} else {
|
|
872
|
-
Logger({
|
|
873
|
-
level: "WARN",
|
|
874
|
-
message: `Response Validation Warnings for platform > Serviceability > getZones \n ${res_error}`,
|
|
875
|
-
});
|
|
876
|
-
}
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
return response;
|
|
880
|
-
}
|
|
881
|
-
|
|
882
764
|
/**
|
|
883
765
|
* @param {ServiceabilityPlatformApplicationValidator.InsertApplicationConfigParam} arg
|
|
884
766
|
* - Arg object
|
|
@@ -31,18 +31,6 @@ export = ServiceabilityPlatformApplicationValidator;
|
|
|
31
31
|
* @property {number} [pageSize]
|
|
32
32
|
* @property {string} [status]
|
|
33
33
|
*/
|
|
34
|
-
/**
|
|
35
|
-
* @typedef GetZonesParam
|
|
36
|
-
* @property {number} [pageNo] - Index of the item to start returning with
|
|
37
|
-
* @property {number} [pageSize] - Determines the items to be displayed in a page
|
|
38
|
-
* @property {boolean} [isActive] - Status of Zone (either active or inactive)
|
|
39
|
-
* @property {string} [q] - Search with name as a free text
|
|
40
|
-
* @property {string} [countryIsoCode] - ISO2 code of the country
|
|
41
|
-
* @property {string} [state] - State name
|
|
42
|
-
* @property {string} [city] - City name
|
|
43
|
-
* @property {string} [pincode] - Pincode value to search zones
|
|
44
|
-
* @property {string} [sector] - Sector value to search zones
|
|
45
|
-
*/
|
|
46
34
|
/**
|
|
47
35
|
* @typedef InsertApplicationConfigParam
|
|
48
36
|
* @property {ServiceabilityPlatformModel.StoreRuleConfigData} body
|
|
@@ -109,8 +97,6 @@ declare class ServiceabilityPlatformApplicationValidator {
|
|
|
109
97
|
static getStoreRule(): GetStoreRuleParam;
|
|
110
98
|
/** @returns {GetStoreRulesParam} */
|
|
111
99
|
static getStoreRules(): GetStoreRulesParam;
|
|
112
|
-
/** @returns {GetZonesParam} */
|
|
113
|
-
static getZones(): GetZonesParam;
|
|
114
100
|
/** @returns {InsertApplicationConfigParam} */
|
|
115
101
|
static insertApplicationConfig(): InsertApplicationConfigParam;
|
|
116
102
|
/** @returns {PatchApplicationServiceabilitySelfShipmentParam} */
|
|
@@ -135,7 +121,7 @@ declare class ServiceabilityPlatformApplicationValidator {
|
|
|
135
121
|
static updateStoreRulesConfig(): UpdateStoreRulesConfigParam;
|
|
136
122
|
}
|
|
137
123
|
declare namespace ServiceabilityPlatformApplicationValidator {
|
|
138
|
-
export { CreateCourierPartnerRuleParam, CreateStoreRulesParam, GetApplicationConfigParam, GetApplicationConfigurationParam, GetApplicationServiceabilitySelfShipmentParam, GetCourierPartnerRuleParam, GetCourierPartnerRulesParam, GetStoreRuleParam, GetStoreRulesParam,
|
|
124
|
+
export { CreateCourierPartnerRuleParam, CreateStoreRulesParam, GetApplicationConfigParam, GetApplicationConfigurationParam, GetApplicationServiceabilitySelfShipmentParam, GetCourierPartnerRuleParam, GetCourierPartnerRulesParam, GetStoreRuleParam, GetStoreRulesParam, InsertApplicationConfigParam, PatchApplicationServiceabilitySelfShipmentParam, UpdateApplicationConfigurationParam, UpdateCourierPartnerRulePriorityParam, UpdateCourierRuleParam, UpdatePincodeAuditHistoryParam, UpdatePincodeBulkViewParam, UpdatePincodeCoDListingParam, UpdatePincodeMopViewParam, UpdateStoreRulesParam, UpdateStoreRulesConfigParam };
|
|
139
125
|
}
|
|
140
126
|
type CreateCourierPartnerRuleParam = {
|
|
141
127
|
body: ServiceabilityPlatformModel.CourierPartnerRule;
|
|
@@ -175,44 +161,6 @@ type GetStoreRulesParam = {
|
|
|
175
161
|
pageSize?: number;
|
|
176
162
|
status?: string;
|
|
177
163
|
};
|
|
178
|
-
type GetZonesParam = {
|
|
179
|
-
/**
|
|
180
|
-
* - Index of the item to start returning with
|
|
181
|
-
*/
|
|
182
|
-
pageNo?: number;
|
|
183
|
-
/**
|
|
184
|
-
* - Determines the items to be displayed in a page
|
|
185
|
-
*/
|
|
186
|
-
pageSize?: number;
|
|
187
|
-
/**
|
|
188
|
-
* - Status of Zone (either active or inactive)
|
|
189
|
-
*/
|
|
190
|
-
isActive?: boolean;
|
|
191
|
-
/**
|
|
192
|
-
* - Search with name as a free text
|
|
193
|
-
*/
|
|
194
|
-
q?: string;
|
|
195
|
-
/**
|
|
196
|
-
* - ISO2 code of the country
|
|
197
|
-
*/
|
|
198
|
-
countryIsoCode?: string;
|
|
199
|
-
/**
|
|
200
|
-
* - State name
|
|
201
|
-
*/
|
|
202
|
-
state?: string;
|
|
203
|
-
/**
|
|
204
|
-
* - City name
|
|
205
|
-
*/
|
|
206
|
-
city?: string;
|
|
207
|
-
/**
|
|
208
|
-
* - Pincode value to search zones
|
|
209
|
-
*/
|
|
210
|
-
pincode?: string;
|
|
211
|
-
/**
|
|
212
|
-
* - Sector value to search zones
|
|
213
|
-
*/
|
|
214
|
-
sector?: string;
|
|
215
|
-
};
|
|
216
164
|
type InsertApplicationConfigParam = {
|
|
217
165
|
body: ServiceabilityPlatformModel.StoreRuleConfigData;
|
|
218
166
|
};
|
|
@@ -43,19 +43,6 @@ const ServiceabilityPlatformModel = require("./ServiceabilityPlatformModel");
|
|
|
43
43
|
* @property {string} [status]
|
|
44
44
|
*/
|
|
45
45
|
|
|
46
|
-
/**
|
|
47
|
-
* @typedef GetZonesParam
|
|
48
|
-
* @property {number} [pageNo] - Index of the item to start returning with
|
|
49
|
-
* @property {number} [pageSize] - Determines the items to be displayed in a page
|
|
50
|
-
* @property {boolean} [isActive] - Status of Zone (either active or inactive)
|
|
51
|
-
* @property {string} [q] - Search with name as a free text
|
|
52
|
-
* @property {string} [countryIsoCode] - ISO2 code of the country
|
|
53
|
-
* @property {string} [state] - State name
|
|
54
|
-
* @property {string} [city] - City name
|
|
55
|
-
* @property {string} [pincode] - Pincode value to search zones
|
|
56
|
-
* @property {string} [sector] - Sector value to search zones
|
|
57
|
-
*/
|
|
58
|
-
|
|
59
46
|
/**
|
|
60
47
|
* @typedef InsertApplicationConfigParam
|
|
61
48
|
* @property {ServiceabilityPlatformModel.StoreRuleConfigData} body
|
|
@@ -176,22 +163,6 @@ class ServiceabilityPlatformApplicationValidator {
|
|
|
176
163
|
}).required();
|
|
177
164
|
}
|
|
178
165
|
|
|
179
|
-
/** @returns {GetZonesParam} */
|
|
180
|
-
static getZones() {
|
|
181
|
-
return Joi.object({
|
|
182
|
-
pageNo: Joi.number(),
|
|
183
|
-
pageSize: Joi.number(),
|
|
184
|
-
isActive: Joi.boolean(),
|
|
185
|
-
|
|
186
|
-
q: Joi.string().allow(""),
|
|
187
|
-
countryIsoCode: Joi.string().allow(""),
|
|
188
|
-
state: Joi.string().allow(""),
|
|
189
|
-
city: Joi.string().allow(""),
|
|
190
|
-
pincode: Joi.string().allow(""),
|
|
191
|
-
sector: Joi.string().allow(""),
|
|
192
|
-
}).required();
|
|
193
|
-
}
|
|
194
|
-
|
|
195
166
|
/** @returns {InsertApplicationConfigParam} */
|
|
196
167
|
static insertApplicationConfig() {
|
|
197
168
|
return Joi.object({
|
|
@@ -236,6 +236,16 @@ declare class Serviceability {
|
|
|
236
236
|
* @description: Retrieves a single delivery zone. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getZoneById/).
|
|
237
237
|
*/
|
|
238
238
|
getZoneById({ zoneId, requestHeaders }?: ServiceabilityPlatformValidator.GetZoneByIdParam, { responseHeaders }?: object): Promise<ServiceabilityPlatformModel.GetZoneByIdSchema>;
|
|
239
|
+
/**
|
|
240
|
+
* @param {ServiceabilityPlatformValidator.GetZonesParam} arg - Arg object
|
|
241
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
242
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
243
|
+
* @returns {Promise<ServiceabilityPlatformModel.ListViewResponse>} - Success response
|
|
244
|
+
* @name getZones
|
|
245
|
+
* @summary: Get zones
|
|
246
|
+
* @description: Retrieves a list of delivery zones. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getZones/).
|
|
247
|
+
*/
|
|
248
|
+
getZones({ pageNo, pageSize, isActive, applicationIds, q, countryIsoCode, state, city, pincode, sector, requestHeaders, }?: ServiceabilityPlatformValidator.GetZonesParam, { responseHeaders }?: object): Promise<ServiceabilityPlatformModel.ListViewResponse>;
|
|
239
249
|
/**
|
|
240
250
|
* @param {ServiceabilityPlatformValidator.UpdateCompanyConfigurationParam} arg
|
|
241
251
|
* - Arg object
|
|
@@ -1714,6 +1714,125 @@ class Serviceability {
|
|
|
1714
1714
|
return response;
|
|
1715
1715
|
}
|
|
1716
1716
|
|
|
1717
|
+
/**
|
|
1718
|
+
* @param {ServiceabilityPlatformValidator.GetZonesParam} arg - Arg object
|
|
1719
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1720
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1721
|
+
* @returns {Promise<ServiceabilityPlatformModel.ListViewResponse>} - Success response
|
|
1722
|
+
* @name getZones
|
|
1723
|
+
* @summary: Get zones
|
|
1724
|
+
* @description: Retrieves a list of delivery zones. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getZones/).
|
|
1725
|
+
*/
|
|
1726
|
+
async getZones(
|
|
1727
|
+
{
|
|
1728
|
+
pageNo,
|
|
1729
|
+
pageSize,
|
|
1730
|
+
isActive,
|
|
1731
|
+
applicationIds,
|
|
1732
|
+
q,
|
|
1733
|
+
countryIsoCode,
|
|
1734
|
+
state,
|
|
1735
|
+
city,
|
|
1736
|
+
pincode,
|
|
1737
|
+
sector,
|
|
1738
|
+
requestHeaders,
|
|
1739
|
+
} = { requestHeaders: {} },
|
|
1740
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1741
|
+
) {
|
|
1742
|
+
const { error } = ServiceabilityPlatformValidator.getZones().validate(
|
|
1743
|
+
{
|
|
1744
|
+
pageNo,
|
|
1745
|
+
pageSize,
|
|
1746
|
+
isActive,
|
|
1747
|
+
applicationIds,
|
|
1748
|
+
q,
|
|
1749
|
+
countryIsoCode,
|
|
1750
|
+
state,
|
|
1751
|
+
city,
|
|
1752
|
+
pincode,
|
|
1753
|
+
sector,
|
|
1754
|
+
},
|
|
1755
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1756
|
+
);
|
|
1757
|
+
if (error) {
|
|
1758
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1759
|
+
}
|
|
1760
|
+
|
|
1761
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1762
|
+
const {
|
|
1763
|
+
error: warrning,
|
|
1764
|
+
} = ServiceabilityPlatformValidator.getZones().validate(
|
|
1765
|
+
{
|
|
1766
|
+
pageNo,
|
|
1767
|
+
pageSize,
|
|
1768
|
+
isActive,
|
|
1769
|
+
applicationIds,
|
|
1770
|
+
q,
|
|
1771
|
+
countryIsoCode,
|
|
1772
|
+
state,
|
|
1773
|
+
city,
|
|
1774
|
+
pincode,
|
|
1775
|
+
sector,
|
|
1776
|
+
},
|
|
1777
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1778
|
+
);
|
|
1779
|
+
if (warrning) {
|
|
1780
|
+
Logger({
|
|
1781
|
+
level: "WARN",
|
|
1782
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getZones \n ${warrning}`,
|
|
1783
|
+
});
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1786
|
+
const query_params = {};
|
|
1787
|
+
query_params["page_no"] = pageNo;
|
|
1788
|
+
query_params["page_size"] = pageSize;
|
|
1789
|
+
query_params["is_active"] = isActive;
|
|
1790
|
+
query_params["application_ids"] = applicationIds;
|
|
1791
|
+
query_params["q"] = q;
|
|
1792
|
+
query_params["country_iso_code"] = countryIsoCode;
|
|
1793
|
+
query_params["state"] = state;
|
|
1794
|
+
query_params["city"] = city;
|
|
1795
|
+
query_params["pincode"] = pincode;
|
|
1796
|
+
query_params["sector"] = sector;
|
|
1797
|
+
|
|
1798
|
+
const xHeaders = {};
|
|
1799
|
+
|
|
1800
|
+
const response = await PlatformAPIClient.execute(
|
|
1801
|
+
this.config,
|
|
1802
|
+
"get",
|
|
1803
|
+
`/service/platform/logistics/v2.0/company/${this.config.companyId}/zones`,
|
|
1804
|
+
query_params,
|
|
1805
|
+
undefined,
|
|
1806
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1807
|
+
{ responseHeaders }
|
|
1808
|
+
);
|
|
1809
|
+
|
|
1810
|
+
let responseData = response;
|
|
1811
|
+
if (responseHeaders) {
|
|
1812
|
+
responseData = response[0];
|
|
1813
|
+
}
|
|
1814
|
+
|
|
1815
|
+
const {
|
|
1816
|
+
error: res_error,
|
|
1817
|
+
} = ServiceabilityPlatformModel.ListViewResponse().validate(responseData, {
|
|
1818
|
+
abortEarly: false,
|
|
1819
|
+
allowUnknown: true,
|
|
1820
|
+
});
|
|
1821
|
+
|
|
1822
|
+
if (res_error) {
|
|
1823
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
1824
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1825
|
+
} else {
|
|
1826
|
+
Logger({
|
|
1827
|
+
level: "WARN",
|
|
1828
|
+
message: `Response Validation Warnings for platform > Serviceability > getZones \n ${res_error}`,
|
|
1829
|
+
});
|
|
1830
|
+
}
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
return response;
|
|
1834
|
+
}
|
|
1835
|
+
|
|
1717
1836
|
/**
|
|
1718
1837
|
* @param {ServiceabilityPlatformValidator.UpdateCompanyConfigurationParam} arg
|
|
1719
1838
|
* - Arg object
|