@gofynd/fdk-client-javascript 1.3.11-beta.7 → 1.3.11-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 +1 -1
- package/sdk/application/Cart/CartApplicationClient.js +5 -3
- package/sdk/application/Cart/CartApplicationModel.d.ts +107 -1
- package/sdk/application/Cart/CartApplicationModel.js +74 -0
- package/sdk/application/Cart/CartApplicationValidator.d.ts +4 -0
- package/sdk/application/Cart/CartApplicationValidator.js +4 -0
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +3 -6
- package/sdk/application/Catalog/CatalogApplicationClient.js +7 -20
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +2 -2
- package/sdk/application/Catalog/CatalogApplicationModel.js +2 -2
- package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +0 -14
- package/sdk/application/Catalog/CatalogApplicationValidator.js +0 -6
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +183 -49
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +173 -31
- package/sdk/application/Content/ContentApplicationClient.d.ts +36 -0
- package/sdk/application/Content/ContentApplicationClient.js +246 -0
- package/sdk/application/Content/ContentApplicationModel.d.ts +208 -1
- package/sdk/application/Content/ContentApplicationModel.js +252 -0
- package/sdk/application/Content/ContentApplicationValidator.d.ts +40 -1
- package/sdk/application/Content/ContentApplicationValidator.js +41 -0
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +67 -0
- package/sdk/application/Logistic/LogisticApplicationClient.js +547 -0
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +456 -1
- package/sdk/application/Logistic/LogisticApplicationModel.js +488 -0
- package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +211 -1
- package/sdk/application/Logistic/LogisticApplicationValidator.js +131 -0
- package/sdk/application/Order/OrderApplicationClient.d.ts +3 -3
- package/sdk/application/Order/OrderApplicationClient.js +32 -8
- package/sdk/application/Order/OrderApplicationModel.d.ts +6 -0
- package/sdk/application/Order/OrderApplicationModel.js +6 -0
- package/sdk/application/Order/OrderApplicationValidator.d.ts +20 -0
- package/sdk/application/Order/OrderApplicationValidator.js +8 -0
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +46 -2
- package/sdk/application/Payment/PaymentApplicationClient.js +341 -10
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +493 -186
- package/sdk/application/Payment/PaymentApplicationModel.js +341 -70
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +59 -14
- package/sdk/application/Payment/PaymentApplicationValidator.js +64 -10
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +34 -1
- package/sdk/application/PosCart/PosCartApplicationModel.js +24 -0
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +1 -1
- package/sdk/application/Theme/ThemeApplicationClient.js +7 -3
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +222 -36
- package/sdk/application/Theme/ThemeApplicationModel.js +322 -26
- package/sdk/application/Theme/ThemeApplicationValidator.d.ts +10 -0
- package/sdk/application/Theme/ThemeApplicationValidator.js +4 -0
- package/sdk/application/User/UserApplicationClient.d.ts +33 -0
- package/sdk/application/User/UserApplicationClient.js +239 -0
- package/sdk/application/User/UserApplicationModel.d.ts +28 -13
- package/sdk/application/User/UserApplicationModel.js +36 -12
- package/sdk/application/User/UserApplicationValidator.d.ts +34 -1
- package/sdk/application/User/UserApplicationValidator.js +36 -0
- package/sdk/partner/Lead/LeadPartnerClient.d.ts +125 -0
- package/sdk/partner/Lead/LeadPartnerClient.js +785 -0
- package/sdk/partner/Lead/LeadPartnerModel.d.ts +1127 -0
- package/sdk/partner/Lead/LeadPartnerModel.js +896 -0
- package/sdk/partner/Lead/LeadPartnerValidator.d.ts +12 -0
- package/sdk/partner/Lead/LeadPartnerValidator.js +67 -0
- package/sdk/partner/Logistics/LogisticsPartnerClient.d.ts +155 -0
- package/sdk/partner/Logistics/LogisticsPartnerClient.js +1195 -0
- package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +372 -0
- package/sdk/partner/Logistics/LogisticsPartnerModel.js +442 -0
- package/sdk/partner/Logistics/LogisticsPartnerValidator.d.ts +16 -0
- package/sdk/partner/Logistics/LogisticsPartnerValidator.js +123 -0
- package/sdk/partner/PartnerClient.d.ts +6 -0
- package/sdk/partner/PartnerClient.js +9 -0
- package/sdk/partner/Theme/ThemePartnerClient.d.ts +10 -0
- package/sdk/partner/Theme/ThemePartnerClient.js +80 -0
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +100 -43
- package/sdk/partner/Theme/ThemePartnerModel.js +74 -30
- package/sdk/partner/Theme/ThemePartnerValidator.d.ts +1 -0
- package/sdk/partner/Theme/ThemePartnerValidator.js +9 -0
- package/sdk/partner/Webhook/WebhookPartnerClient.d.ts +99 -0
- package/sdk/partner/Webhook/WebhookPartnerClient.js +753 -0
- package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +566 -0
- package/sdk/partner/Webhook/WebhookPartnerModel.js +583 -0
- package/sdk/partner/Webhook/WebhookPartnerValidator.d.ts +12 -0
- package/sdk/partner/Webhook/WebhookPartnerValidator.js +74 -0
- package/sdk/partner/index.d.ts +3 -0
- package/sdk/partner/index.js +6 -0
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +2 -2
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +11 -1
- package/sdk/platform/Billing/BillingPlatformClient.js +110 -3
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +67 -1
- package/sdk/platform/Billing/BillingPlatformModel.js +78 -0
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +43 -4
- package/sdk/platform/Billing/BillingPlatformValidator.js +29 -2
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +1 -1
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +7 -1
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +4 -0
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +4 -0
- package/sdk/platform/Cart/CartPlatformModel.d.ts +100 -5
- package/sdk/platform/Cart/CartPlatformModel.js +71 -4
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +15 -11
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +52 -21
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +27 -0
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +11 -0
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +26 -4
- package/sdk/platform/Catalog/CatalogPlatformClient.js +173 -7
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +304 -1
- package/sdk/platform/Catalog/CatalogPlatformModel.js +335 -0
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +31 -3
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +27 -2
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +138 -36
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +739 -57
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +128 -3
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +111 -1
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +150 -1
- package/sdk/platform/Communication/CommunicationPlatformModel.js +172 -0
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +8 -2
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +32 -4
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +38 -9
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +42 -8
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +14 -0
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +6 -0
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +8 -8
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +4 -4
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +371 -132
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +288 -77
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +2 -2
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +2 -2
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +391 -0
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +3630 -1059
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +342 -1
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +401 -0
- package/sdk/platform/Content/ContentPlatformClient.d.ts +277 -0
- package/sdk/platform/Content/ContentPlatformClient.js +2000 -0
- package/sdk/platform/Content/ContentPlatformModel.d.ts +1094 -1
- package/sdk/platform/Content/ContentPlatformModel.js +1356 -46
- package/sdk/platform/Content/ContentPlatformValidator.d.ts +238 -0
- package/sdk/platform/Content/ContentPlatformValidator.js +310 -0
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +2 -2
- package/sdk/platform/Discount/DiscountPlatformClient.js +2 -2
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +96 -13
- package/sdk/platform/Discount/DiscountPlatformModel.js +104 -12
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +16 -6
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +117 -8
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +55 -4
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +39 -2
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +16 -5
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +18 -4
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +33 -0
- package/sdk/platform/Finance/FinancePlatformClient.js +240 -0
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +151 -5
- package/sdk/platform/Finance/FinancePlatformModel.js +190 -4
- package/sdk/platform/Finance/FinancePlatformValidator.d.ts +38 -1
- package/sdk/platform/Finance/FinancePlatformValidator.js +38 -0
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +38 -28
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +137 -56
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +41 -29
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +33 -21
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +12 -3
- package/sdk/platform/Lead/LeadPlatformModel.js +16 -2
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +23 -1
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +178 -1
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +39 -1
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +32 -0
- package/sdk/platform/Order/OrderPlatformClient.d.ts +202 -31
- package/sdk/platform/Order/OrderPlatformClient.js +2010 -586
- package/sdk/platform/Order/OrderPlatformModel.d.ts +1032 -470
- package/sdk/platform/Order/OrderPlatformModel.js +1187 -534
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +318 -35
- package/sdk/platform/Order/OrderPlatformValidator.js +292 -29
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +119 -13
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +749 -39
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +143 -7
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +133 -6
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +1 -1
- package/sdk/platform/Payment/PaymentPlatformClient.js +1 -1
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +996 -134
- package/sdk/platform/Payment/PaymentPlatformModel.js +721 -58
- package/sdk/platform/PlatformApplicationClient.d.ts +2 -2
- package/sdk/platform/PlatformApplicationClient.js +4 -4
- package/sdk/platform/PlatformClient.d.ts +4 -2
- package/sdk/platform/PlatformClient.js +8 -4
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +142 -66
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +645 -147
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +131 -63
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +126 -47
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +217 -105
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +1136 -347
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +912 -313
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +1071 -355
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +382 -133
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +266 -102
- package/sdk/platform/Theme/ThemePlatformClient.d.ts +11 -1
- package/sdk/platform/Theme/ThemePlatformClient.js +87 -3
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +333 -47
- package/sdk/platform/Theme/ThemePlatformModel.js +395 -35
- package/sdk/platform/Theme/ThemePlatformValidator.d.ts +28 -4
- package/sdk/platform/Theme/ThemePlatformValidator.js +21 -2
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +116 -1
- package/sdk/platform/User/UserPlatformApplicationClient.js +931 -85
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +224 -7
- package/sdk/platform/User/UserPlatformApplicationValidator.js +173 -5
- package/sdk/platform/User/UserPlatformModel.d.ts +344 -7
- package/sdk/platform/User/UserPlatformModel.js +256 -5
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +47 -39
- package/sdk/platform/Webhook/WebhookPlatformClient.js +63 -61
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +264 -156
- package/sdk/platform/Webhook/WebhookPlatformModel.js +276 -153
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +7 -10
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +6 -6
- package/sdk/platform/index.d.ts +1 -1
- package/sdk/platform/index.js +2 -2
- package/sdk/public/Billing/BillingPublicClient.d.ts +23 -0
- package/sdk/public/Billing/BillingPublicClient.js +116 -0
- package/sdk/public/Billing/BillingPublicModel.d.ts +92 -0
- package/sdk/public/Billing/BillingPublicModel.js +96 -0
- package/sdk/public/Billing/BillingPublicValidator.d.ts +18 -0
- package/sdk/public/Billing/BillingPublicValidator.js +19 -0
- package/sdk/public/Content/ContentPublicClient.d.ts +22 -0
- package/sdk/public/Content/ContentPublicClient.js +114 -0
- package/sdk/public/Content/ContentPublicModel.d.ts +53 -0
- package/sdk/public/Content/ContentPublicModel.js +60 -0
- package/sdk/public/Content/ContentPublicValidator.d.ts +18 -0
- package/sdk/public/Content/ContentPublicValidator.js +19 -0
- package/sdk/public/PublicClient.d.ts +4 -0
- package/sdk/public/PublicClient.js +8 -0
- package/sdk/public/Webhook/WebhookPublicClient.d.ts +33 -0
- package/sdk/public/Webhook/WebhookPublicClient.js +242 -0
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +147 -1
- package/sdk/public/Webhook/WebhookPublicModel.js +177 -1
- package/sdk/public/Webhook/WebhookPublicValidator.d.ts +23 -1
- package/sdk/public/Webhook/WebhookPublicValidator.js +31 -0
- package/sdk/public/index.d.ts +2 -0
- package/sdk/public/index.js +4 -0
|
@@ -14,14 +14,438 @@ class Serviceability {
|
|
|
14
14
|
this.config = config;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* @param {ServiceabilityPlatformValidator.BulkServiceabilityParam} arg - Arg object
|
|
19
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
20
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
21
|
+
* @returns {Promise<ServiceabilityPlatformModel.BulkRegionResponseItemData>}
|
|
22
|
+
* - Success response
|
|
23
|
+
*
|
|
24
|
+
* @name bulkServiceability
|
|
25
|
+
* @summary: Serviceability Import or Export
|
|
26
|
+
* @description: Serviceability Import or Export - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/bulkServiceability/).
|
|
27
|
+
*/
|
|
28
|
+
async bulkServiceability(
|
|
29
|
+
{ extensionId, schemeId, body, requestHeaders } = { requestHeaders: {} },
|
|
30
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
31
|
+
) {
|
|
32
|
+
const {
|
|
33
|
+
error,
|
|
34
|
+
} = ServiceabilityPlatformValidator.bulkServiceability().validate(
|
|
35
|
+
{
|
|
36
|
+
extensionId,
|
|
37
|
+
schemeId,
|
|
38
|
+
body,
|
|
39
|
+
},
|
|
40
|
+
{ abortEarly: false, allowUnknown: true }
|
|
41
|
+
);
|
|
42
|
+
if (error) {
|
|
43
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Showing warrnings if extra unknown parameters are found
|
|
47
|
+
const {
|
|
48
|
+
error: warrning,
|
|
49
|
+
} = ServiceabilityPlatformValidator.bulkServiceability().validate(
|
|
50
|
+
{
|
|
51
|
+
extensionId,
|
|
52
|
+
schemeId,
|
|
53
|
+
body,
|
|
54
|
+
},
|
|
55
|
+
{ abortEarly: false, allowUnknown: false }
|
|
56
|
+
);
|
|
57
|
+
if (warrning) {
|
|
58
|
+
Logger({
|
|
59
|
+
level: "WARN",
|
|
60
|
+
message: `Parameter Validation warrnings for platform > Serviceability > bulkServiceability \n ${warrning}`,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const query_params = {};
|
|
65
|
+
|
|
66
|
+
const xHeaders = {};
|
|
67
|
+
|
|
68
|
+
const response = await PlatformAPIClient.execute(
|
|
69
|
+
this.config,
|
|
70
|
+
"post",
|
|
71
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/courier-partner/${extensionId}/scheme/${schemeId}/serviceability/bulk`,
|
|
72
|
+
query_params,
|
|
73
|
+
body,
|
|
74
|
+
{ ...xHeaders, ...requestHeaders },
|
|
75
|
+
{ responseHeaders }
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
let responseData = response;
|
|
79
|
+
if (responseHeaders) {
|
|
80
|
+
responseData = response[0];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const {
|
|
84
|
+
error: res_error,
|
|
85
|
+
} = ServiceabilityPlatformModel.BulkRegionResponseItemData().validate(
|
|
86
|
+
responseData,
|
|
87
|
+
{ abortEarly: false, allowUnknown: true }
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
if (res_error) {
|
|
91
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
92
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
93
|
+
} else {
|
|
94
|
+
Logger({
|
|
95
|
+
level: "WARN",
|
|
96
|
+
message: `Response Validation Warnings for platform > Serviceability > bulkServiceability \n ${res_error}`,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return response;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* @param {ServiceabilityPlatformValidator.BulkTatParam} arg - Arg object
|
|
106
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
107
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
108
|
+
* @returns {Promise<ServiceabilityPlatformModel.BulkRegionResponseItemData>}
|
|
109
|
+
* - Success response
|
|
110
|
+
*
|
|
111
|
+
* @name bulkTat
|
|
112
|
+
* @summary: Region TAT Import or Export
|
|
113
|
+
* @description: Region TAT Import or Export - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/bulkTat/).
|
|
114
|
+
*/
|
|
115
|
+
async bulkTat(
|
|
116
|
+
{ extensionId, schemeId, body, requestHeaders } = { requestHeaders: {} },
|
|
117
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
118
|
+
) {
|
|
119
|
+
const { error } = ServiceabilityPlatformValidator.bulkTat().validate(
|
|
120
|
+
{
|
|
121
|
+
extensionId,
|
|
122
|
+
schemeId,
|
|
123
|
+
body,
|
|
124
|
+
},
|
|
125
|
+
{ abortEarly: false, allowUnknown: true }
|
|
126
|
+
);
|
|
127
|
+
if (error) {
|
|
128
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// Showing warrnings if extra unknown parameters are found
|
|
132
|
+
const {
|
|
133
|
+
error: warrning,
|
|
134
|
+
} = ServiceabilityPlatformValidator.bulkTat().validate(
|
|
135
|
+
{
|
|
136
|
+
extensionId,
|
|
137
|
+
schemeId,
|
|
138
|
+
body,
|
|
139
|
+
},
|
|
140
|
+
{ abortEarly: false, allowUnknown: false }
|
|
141
|
+
);
|
|
142
|
+
if (warrning) {
|
|
143
|
+
Logger({
|
|
144
|
+
level: "WARN",
|
|
145
|
+
message: `Parameter Validation warrnings for platform > Serviceability > bulkTat \n ${warrning}`,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const query_params = {};
|
|
150
|
+
|
|
151
|
+
const xHeaders = {};
|
|
152
|
+
|
|
153
|
+
const response = await PlatformAPIClient.execute(
|
|
154
|
+
this.config,
|
|
155
|
+
"post",
|
|
156
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/courier-partner/${extensionId}/scheme/${schemeId}/tat`,
|
|
157
|
+
query_params,
|
|
158
|
+
body,
|
|
159
|
+
{ ...xHeaders, ...requestHeaders },
|
|
160
|
+
{ responseHeaders }
|
|
161
|
+
);
|
|
162
|
+
|
|
163
|
+
let responseData = response;
|
|
164
|
+
if (responseHeaders) {
|
|
165
|
+
responseData = response[0];
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const {
|
|
169
|
+
error: res_error,
|
|
170
|
+
} = ServiceabilityPlatformModel.BulkRegionResponseItemData().validate(
|
|
171
|
+
responseData,
|
|
172
|
+
{ abortEarly: false, allowUnknown: true }
|
|
173
|
+
);
|
|
174
|
+
|
|
175
|
+
if (res_error) {
|
|
176
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
177
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
178
|
+
} else {
|
|
179
|
+
Logger({
|
|
180
|
+
level: "WARN",
|
|
181
|
+
message: `Response Validation Warnings for platform > Serviceability > bulkTat \n ${res_error}`,
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
return response;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* @param {ServiceabilityPlatformValidator.CreateCourierPartnerAccountParam} arg
|
|
191
|
+
* - Arg object
|
|
192
|
+
*
|
|
193
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
194
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
195
|
+
* @returns {Promise<ServiceabilityPlatformModel.CourierAccount>} - Success response
|
|
196
|
+
* @name createCourierPartnerAccount
|
|
197
|
+
* @summary: Creation of Courier Account
|
|
198
|
+
* @description: This API Creates a new Courier Account - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/createCourierPartnerAccount/).
|
|
199
|
+
*/
|
|
200
|
+
async createCourierPartnerAccount(
|
|
201
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
202
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
203
|
+
) {
|
|
204
|
+
const {
|
|
205
|
+
error,
|
|
206
|
+
} = ServiceabilityPlatformValidator.createCourierPartnerAccount().validate(
|
|
207
|
+
{
|
|
208
|
+
body,
|
|
209
|
+
},
|
|
210
|
+
{ abortEarly: false, allowUnknown: true }
|
|
211
|
+
);
|
|
212
|
+
if (error) {
|
|
213
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// Showing warrnings if extra unknown parameters are found
|
|
217
|
+
const {
|
|
218
|
+
error: warrning,
|
|
219
|
+
} = ServiceabilityPlatformValidator.createCourierPartnerAccount().validate(
|
|
220
|
+
{
|
|
221
|
+
body,
|
|
222
|
+
},
|
|
223
|
+
{ abortEarly: false, allowUnknown: false }
|
|
224
|
+
);
|
|
225
|
+
if (warrning) {
|
|
226
|
+
Logger({
|
|
227
|
+
level: "WARN",
|
|
228
|
+
message: `Parameter Validation warrnings for platform > Serviceability > createCourierPartnerAccount \n ${warrning}`,
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
const query_params = {};
|
|
233
|
+
|
|
234
|
+
const xHeaders = {};
|
|
235
|
+
|
|
236
|
+
const response = await PlatformAPIClient.execute(
|
|
237
|
+
this.config,
|
|
238
|
+
"post",
|
|
239
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/courier-partner/account`,
|
|
240
|
+
query_params,
|
|
241
|
+
body,
|
|
242
|
+
{ ...xHeaders, ...requestHeaders },
|
|
243
|
+
{ responseHeaders }
|
|
244
|
+
);
|
|
245
|
+
|
|
246
|
+
let responseData = response;
|
|
247
|
+
if (responseHeaders) {
|
|
248
|
+
responseData = response[0];
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
const {
|
|
252
|
+
error: res_error,
|
|
253
|
+
} = ServiceabilityPlatformModel.CourierAccount().validate(responseData, {
|
|
254
|
+
abortEarly: false,
|
|
255
|
+
allowUnknown: true,
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
if (res_error) {
|
|
259
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
260
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
261
|
+
} else {
|
|
262
|
+
Logger({
|
|
263
|
+
level: "WARN",
|
|
264
|
+
message: `Response Validation Warnings for platform > Serviceability > createCourierPartnerAccount \n ${res_error}`,
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
return response;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* @param {ServiceabilityPlatformValidator.CreatePackageMaterialParam} arg
|
|
274
|
+
* - Arg object
|
|
275
|
+
*
|
|
276
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
277
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
278
|
+
* @returns {Promise<ServiceabilityPlatformModel.PackageMaterialResponse>}
|
|
279
|
+
* - Success response
|
|
280
|
+
*
|
|
281
|
+
* @name createPackageMaterial
|
|
282
|
+
* @summary: Upsert of PackageMaterial in database.
|
|
283
|
+
* @description: This API returns response of upsert of PackageMaterial in mongo database. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/createPackageMaterial/).
|
|
284
|
+
*/
|
|
285
|
+
async createPackageMaterial(
|
|
286
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
287
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
288
|
+
) {
|
|
289
|
+
const {
|
|
290
|
+
error,
|
|
291
|
+
} = ServiceabilityPlatformValidator.createPackageMaterial().validate(
|
|
292
|
+
{
|
|
293
|
+
body,
|
|
294
|
+
},
|
|
295
|
+
{ abortEarly: false, allowUnknown: true }
|
|
296
|
+
);
|
|
297
|
+
if (error) {
|
|
298
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
// Showing warrnings if extra unknown parameters are found
|
|
302
|
+
const {
|
|
303
|
+
error: warrning,
|
|
304
|
+
} = ServiceabilityPlatformValidator.createPackageMaterial().validate(
|
|
305
|
+
{
|
|
306
|
+
body,
|
|
307
|
+
},
|
|
308
|
+
{ abortEarly: false, allowUnknown: false }
|
|
309
|
+
);
|
|
310
|
+
if (warrning) {
|
|
311
|
+
Logger({
|
|
312
|
+
level: "WARN",
|
|
313
|
+
message: `Parameter Validation warrnings for platform > Serviceability > createPackageMaterial \n ${warrning}`,
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
const query_params = {};
|
|
318
|
+
|
|
319
|
+
const xHeaders = {};
|
|
320
|
+
|
|
321
|
+
const response = await PlatformAPIClient.execute(
|
|
322
|
+
this.config,
|
|
323
|
+
"post",
|
|
324
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/packaging-materials`,
|
|
325
|
+
query_params,
|
|
326
|
+
body,
|
|
327
|
+
{ ...xHeaders, ...requestHeaders },
|
|
328
|
+
{ responseHeaders }
|
|
329
|
+
);
|
|
330
|
+
|
|
331
|
+
let responseData = response;
|
|
332
|
+
if (responseHeaders) {
|
|
333
|
+
responseData = response[0];
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
const {
|
|
337
|
+
error: res_error,
|
|
338
|
+
} = ServiceabilityPlatformModel.PackageMaterialResponse().validate(
|
|
339
|
+
responseData,
|
|
340
|
+
{ abortEarly: false, allowUnknown: true }
|
|
341
|
+
);
|
|
342
|
+
|
|
343
|
+
if (res_error) {
|
|
344
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
345
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
346
|
+
} else {
|
|
347
|
+
Logger({
|
|
348
|
+
level: "WARN",
|
|
349
|
+
message: `Response Validation Warnings for platform > Serviceability > createPackageMaterial \n ${res_error}`,
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
return response;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* @param {ServiceabilityPlatformValidator.CreatePackageMaterialRuleParam} arg
|
|
359
|
+
* - Arg object
|
|
360
|
+
*
|
|
361
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
362
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
363
|
+
* @returns {Promise<ServiceabilityPlatformModel.PackageRuleResponse>} -
|
|
364
|
+
* Success response
|
|
365
|
+
* @name createPackageMaterialRule
|
|
366
|
+
* @summary: Upsert of Package Material Rule in database.
|
|
367
|
+
* @description: This API returns response of upsert of Package Material Rule in mongo database. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/createPackageMaterialRule/).
|
|
368
|
+
*/
|
|
369
|
+
async createPackageMaterialRule(
|
|
370
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
371
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
372
|
+
) {
|
|
373
|
+
const {
|
|
374
|
+
error,
|
|
375
|
+
} = ServiceabilityPlatformValidator.createPackageMaterialRule().validate(
|
|
376
|
+
{
|
|
377
|
+
body,
|
|
378
|
+
},
|
|
379
|
+
{ abortEarly: false, allowUnknown: true }
|
|
380
|
+
);
|
|
381
|
+
if (error) {
|
|
382
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
// Showing warrnings if extra unknown parameters are found
|
|
386
|
+
const {
|
|
387
|
+
error: warrning,
|
|
388
|
+
} = ServiceabilityPlatformValidator.createPackageMaterialRule().validate(
|
|
389
|
+
{
|
|
390
|
+
body,
|
|
391
|
+
},
|
|
392
|
+
{ abortEarly: false, allowUnknown: false }
|
|
393
|
+
);
|
|
394
|
+
if (warrning) {
|
|
395
|
+
Logger({
|
|
396
|
+
level: "WARN",
|
|
397
|
+
message: `Parameter Validation warrnings for platform > Serviceability > createPackageMaterialRule \n ${warrning}`,
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
const query_params = {};
|
|
402
|
+
|
|
403
|
+
const xHeaders = {};
|
|
404
|
+
|
|
405
|
+
const response = await PlatformAPIClient.execute(
|
|
406
|
+
this.config,
|
|
407
|
+
"post",
|
|
408
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/packaging-material/rules`,
|
|
409
|
+
query_params,
|
|
410
|
+
body,
|
|
411
|
+
{ ...xHeaders, ...requestHeaders },
|
|
412
|
+
{ responseHeaders }
|
|
413
|
+
);
|
|
414
|
+
|
|
415
|
+
let responseData = response;
|
|
416
|
+
if (responseHeaders) {
|
|
417
|
+
responseData = response[0];
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
const {
|
|
421
|
+
error: res_error,
|
|
422
|
+
} = ServiceabilityPlatformModel.PackageRuleResponse().validate(
|
|
423
|
+
responseData,
|
|
424
|
+
{ abortEarly: false, allowUnknown: true }
|
|
425
|
+
);
|
|
426
|
+
|
|
427
|
+
if (res_error) {
|
|
428
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
429
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
430
|
+
} else {
|
|
431
|
+
Logger({
|
|
432
|
+
level: "WARN",
|
|
433
|
+
message: `Response Validation Warnings for platform > Serviceability > createPackageMaterialRule \n ${res_error}`,
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
return response;
|
|
439
|
+
}
|
|
440
|
+
|
|
17
441
|
/**
|
|
18
442
|
* @param {ServiceabilityPlatformValidator.CreateZoneParam} arg - Arg object
|
|
19
443
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
20
444
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
21
445
|
* @returns {Promise<ServiceabilityPlatformModel.ZoneResponse>} - Success response
|
|
22
446
|
* @name createZone
|
|
23
|
-
* @summary:
|
|
24
|
-
* @description:
|
|
447
|
+
* @summary: Creates a new Zone
|
|
448
|
+
* @description: Creates a new zone with the specified mapping. A zone enables serviceability based on given regions. By creating a zone and including specific regions, you can ensure that the stores associated with the zone are serviceable for those added regions. This functionality is particularly useful when you need to ensure serviceability for multiple regions by grouping them into a single zone. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/createZone/).
|
|
25
449
|
*/
|
|
26
450
|
async createZone(
|
|
27
451
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
@@ -60,7 +484,7 @@ class Serviceability {
|
|
|
60
484
|
const response = await PlatformAPIClient.execute(
|
|
61
485
|
this.config,
|
|
62
486
|
"post",
|
|
63
|
-
`/service/platform/logistics/
|
|
487
|
+
`/service/platform/logistics/v2.0/company/${this.config.companyId}/zones`,
|
|
64
488
|
query_params,
|
|
65
489
|
body,
|
|
66
490
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -97,17 +521,344 @@ class Serviceability {
|
|
|
97
521
|
* @param {ServiceabilityPlatformValidator.GetAllStoresParam} arg - Arg object
|
|
98
522
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
99
523
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
100
|
-
* @returns {Promise<ServiceabilityPlatformModel.GetStoresViewResponse>} -
|
|
101
|
-
* Success response
|
|
102
|
-
* @name getAllStores
|
|
103
|
-
* @summary: GET stores data
|
|
104
|
-
* @description: This API returns stores data. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getAllStores/).
|
|
524
|
+
* @returns {Promise<ServiceabilityPlatformModel.GetStoresViewResponse>} -
|
|
525
|
+
* Success response
|
|
526
|
+
* @name getAllStores
|
|
527
|
+
* @summary: GET stores data
|
|
528
|
+
* @description: This API returns stores data. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getAllStores/).
|
|
529
|
+
*/
|
|
530
|
+
async getAllStores(
|
|
531
|
+
{ requestHeaders } = { requestHeaders: {} },
|
|
532
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
533
|
+
) {
|
|
534
|
+
const { error } = ServiceabilityPlatformValidator.getAllStores().validate(
|
|
535
|
+
{},
|
|
536
|
+
{ abortEarly: false, allowUnknown: true }
|
|
537
|
+
);
|
|
538
|
+
if (error) {
|
|
539
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
// Showing warrnings if extra unknown parameters are found
|
|
543
|
+
const {
|
|
544
|
+
error: warrning,
|
|
545
|
+
} = ServiceabilityPlatformValidator.getAllStores().validate(
|
|
546
|
+
{},
|
|
547
|
+
{ abortEarly: false, allowUnknown: false }
|
|
548
|
+
);
|
|
549
|
+
if (warrning) {
|
|
550
|
+
Logger({
|
|
551
|
+
level: "WARN",
|
|
552
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getAllStores \n ${warrning}`,
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
const query_params = {};
|
|
557
|
+
|
|
558
|
+
const xHeaders = {};
|
|
559
|
+
|
|
560
|
+
const response = await PlatformAPIClient.execute(
|
|
561
|
+
this.config,
|
|
562
|
+
"get",
|
|
563
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/logistics/stores`,
|
|
564
|
+
query_params,
|
|
565
|
+
undefined,
|
|
566
|
+
{ ...xHeaders, ...requestHeaders },
|
|
567
|
+
{ responseHeaders }
|
|
568
|
+
);
|
|
569
|
+
|
|
570
|
+
let responseData = response;
|
|
571
|
+
if (responseHeaders) {
|
|
572
|
+
responseData = response[0];
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
const {
|
|
576
|
+
error: res_error,
|
|
577
|
+
} = ServiceabilityPlatformModel.GetStoresViewResponse().validate(
|
|
578
|
+
responseData,
|
|
579
|
+
{ abortEarly: false, allowUnknown: true }
|
|
580
|
+
);
|
|
581
|
+
|
|
582
|
+
if (res_error) {
|
|
583
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
584
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
585
|
+
} else {
|
|
586
|
+
Logger({
|
|
587
|
+
level: "WARN",
|
|
588
|
+
message: `Response Validation Warnings for platform > Serviceability > getAllStores \n ${res_error}`,
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
return response;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
/**
|
|
597
|
+
* @param {ServiceabilityPlatformValidator.GetBulkServiceabilityParam} arg
|
|
598
|
+
* - Arg object
|
|
599
|
+
*
|
|
600
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
601
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
602
|
+
* @returns {Promise<ServiceabilityPlatformModel.BulkRegionResponse>} -
|
|
603
|
+
* Success response
|
|
604
|
+
* @name getBulkServiceability
|
|
605
|
+
* @summary: Get Region Serviceability Bulk History
|
|
606
|
+
* @description: Get Region Serviceability Bulk History - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getBulkServiceability/).
|
|
607
|
+
*/
|
|
608
|
+
async getBulkServiceability(
|
|
609
|
+
{
|
|
610
|
+
extensionId,
|
|
611
|
+
schemeId,
|
|
612
|
+
pageNo,
|
|
613
|
+
pageSize,
|
|
614
|
+
batchId,
|
|
615
|
+
action,
|
|
616
|
+
status,
|
|
617
|
+
country,
|
|
618
|
+
region,
|
|
619
|
+
startDate,
|
|
620
|
+
endDate,
|
|
621
|
+
requestHeaders,
|
|
622
|
+
} = { requestHeaders: {} },
|
|
623
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
624
|
+
) {
|
|
625
|
+
const {
|
|
626
|
+
error,
|
|
627
|
+
} = ServiceabilityPlatformValidator.getBulkServiceability().validate(
|
|
628
|
+
{
|
|
629
|
+
extensionId,
|
|
630
|
+
schemeId,
|
|
631
|
+
pageNo,
|
|
632
|
+
pageSize,
|
|
633
|
+
batchId,
|
|
634
|
+
action,
|
|
635
|
+
status,
|
|
636
|
+
country,
|
|
637
|
+
region,
|
|
638
|
+
startDate,
|
|
639
|
+
endDate,
|
|
640
|
+
},
|
|
641
|
+
{ abortEarly: false, allowUnknown: true }
|
|
642
|
+
);
|
|
643
|
+
if (error) {
|
|
644
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
// Showing warrnings if extra unknown parameters are found
|
|
648
|
+
const {
|
|
649
|
+
error: warrning,
|
|
650
|
+
} = ServiceabilityPlatformValidator.getBulkServiceability().validate(
|
|
651
|
+
{
|
|
652
|
+
extensionId,
|
|
653
|
+
schemeId,
|
|
654
|
+
pageNo,
|
|
655
|
+
pageSize,
|
|
656
|
+
batchId,
|
|
657
|
+
action,
|
|
658
|
+
status,
|
|
659
|
+
country,
|
|
660
|
+
region,
|
|
661
|
+
startDate,
|
|
662
|
+
endDate,
|
|
663
|
+
},
|
|
664
|
+
{ abortEarly: false, allowUnknown: false }
|
|
665
|
+
);
|
|
666
|
+
if (warrning) {
|
|
667
|
+
Logger({
|
|
668
|
+
level: "WARN",
|
|
669
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getBulkServiceability \n ${warrning}`,
|
|
670
|
+
});
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
const query_params = {};
|
|
674
|
+
query_params["page_no"] = pageNo;
|
|
675
|
+
query_params["page_size"] = pageSize;
|
|
676
|
+
query_params["batch_id"] = batchId;
|
|
677
|
+
query_params["action"] = action;
|
|
678
|
+
query_params["status"] = status;
|
|
679
|
+
query_params["country"] = country;
|
|
680
|
+
query_params["region"] = region;
|
|
681
|
+
query_params["start_date"] = startDate;
|
|
682
|
+
query_params["end_date"] = endDate;
|
|
683
|
+
|
|
684
|
+
const xHeaders = {};
|
|
685
|
+
|
|
686
|
+
const response = await PlatformAPIClient.execute(
|
|
687
|
+
this.config,
|
|
688
|
+
"get",
|
|
689
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/courier-partner/${extensionId}/scheme/${schemeId}/serviceability/bulk`,
|
|
690
|
+
query_params,
|
|
691
|
+
undefined,
|
|
692
|
+
{ ...xHeaders, ...requestHeaders },
|
|
693
|
+
{ responseHeaders }
|
|
694
|
+
);
|
|
695
|
+
|
|
696
|
+
let responseData = response;
|
|
697
|
+
if (responseHeaders) {
|
|
698
|
+
responseData = response[0];
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
const {
|
|
702
|
+
error: res_error,
|
|
703
|
+
} = ServiceabilityPlatformModel.BulkRegionResponse().validate(
|
|
704
|
+
responseData,
|
|
705
|
+
{ abortEarly: false, allowUnknown: true }
|
|
706
|
+
);
|
|
707
|
+
|
|
708
|
+
if (res_error) {
|
|
709
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
710
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
711
|
+
} else {
|
|
712
|
+
Logger({
|
|
713
|
+
level: "WARN",
|
|
714
|
+
message: `Response Validation Warnings for platform > Serviceability > getBulkServiceability \n ${res_error}`,
|
|
715
|
+
});
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
return response;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* @param {ServiceabilityPlatformValidator.GetBulkTatParam} arg - Arg object
|
|
724
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
725
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
726
|
+
* @returns {Promise<ServiceabilityPlatformModel.BulkRegionResponse>} -
|
|
727
|
+
* Success response
|
|
728
|
+
* @name getBulkTat
|
|
729
|
+
* @summary: Get region tat bulk history
|
|
730
|
+
* @description: Get region tat bulk history - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getBulkTat/).
|
|
731
|
+
*/
|
|
732
|
+
async getBulkTat(
|
|
733
|
+
{
|
|
734
|
+
extensionId,
|
|
735
|
+
schemeId,
|
|
736
|
+
pageNo,
|
|
737
|
+
pageSize,
|
|
738
|
+
batchId,
|
|
739
|
+
action,
|
|
740
|
+
status,
|
|
741
|
+
country,
|
|
742
|
+
region,
|
|
743
|
+
startDate,
|
|
744
|
+
endDate,
|
|
745
|
+
requestHeaders,
|
|
746
|
+
} = { requestHeaders: {} },
|
|
747
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
748
|
+
) {
|
|
749
|
+
const { error } = ServiceabilityPlatformValidator.getBulkTat().validate(
|
|
750
|
+
{
|
|
751
|
+
extensionId,
|
|
752
|
+
schemeId,
|
|
753
|
+
pageNo,
|
|
754
|
+
pageSize,
|
|
755
|
+
batchId,
|
|
756
|
+
action,
|
|
757
|
+
status,
|
|
758
|
+
country,
|
|
759
|
+
region,
|
|
760
|
+
startDate,
|
|
761
|
+
endDate,
|
|
762
|
+
},
|
|
763
|
+
{ abortEarly: false, allowUnknown: true }
|
|
764
|
+
);
|
|
765
|
+
if (error) {
|
|
766
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
// Showing warrnings if extra unknown parameters are found
|
|
770
|
+
const {
|
|
771
|
+
error: warrning,
|
|
772
|
+
} = ServiceabilityPlatformValidator.getBulkTat().validate(
|
|
773
|
+
{
|
|
774
|
+
extensionId,
|
|
775
|
+
schemeId,
|
|
776
|
+
pageNo,
|
|
777
|
+
pageSize,
|
|
778
|
+
batchId,
|
|
779
|
+
action,
|
|
780
|
+
status,
|
|
781
|
+
country,
|
|
782
|
+
region,
|
|
783
|
+
startDate,
|
|
784
|
+
endDate,
|
|
785
|
+
},
|
|
786
|
+
{ abortEarly: false, allowUnknown: false }
|
|
787
|
+
);
|
|
788
|
+
if (warrning) {
|
|
789
|
+
Logger({
|
|
790
|
+
level: "WARN",
|
|
791
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getBulkTat \n ${warrning}`,
|
|
792
|
+
});
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
const query_params = {};
|
|
796
|
+
query_params["page_no"] = pageNo;
|
|
797
|
+
query_params["page_size"] = pageSize;
|
|
798
|
+
query_params["batch_id"] = batchId;
|
|
799
|
+
query_params["action"] = action;
|
|
800
|
+
query_params["status"] = status;
|
|
801
|
+
query_params["country"] = country;
|
|
802
|
+
query_params["region"] = region;
|
|
803
|
+
query_params["start_date"] = startDate;
|
|
804
|
+
query_params["end_date"] = endDate;
|
|
805
|
+
|
|
806
|
+
const xHeaders = {};
|
|
807
|
+
|
|
808
|
+
const response = await PlatformAPIClient.execute(
|
|
809
|
+
this.config,
|
|
810
|
+
"get",
|
|
811
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/courier-partner/${extensionId}/scheme/${schemeId}/tat`,
|
|
812
|
+
query_params,
|
|
813
|
+
undefined,
|
|
814
|
+
{ ...xHeaders, ...requestHeaders },
|
|
815
|
+
{ responseHeaders }
|
|
816
|
+
);
|
|
817
|
+
|
|
818
|
+
let responseData = response;
|
|
819
|
+
if (responseHeaders) {
|
|
820
|
+
responseData = response[0];
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
const {
|
|
824
|
+
error: res_error,
|
|
825
|
+
} = ServiceabilityPlatformModel.BulkRegionResponse().validate(
|
|
826
|
+
responseData,
|
|
827
|
+
{ abortEarly: false, allowUnknown: true }
|
|
828
|
+
);
|
|
829
|
+
|
|
830
|
+
if (res_error) {
|
|
831
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
832
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
833
|
+
} else {
|
|
834
|
+
Logger({
|
|
835
|
+
level: "WARN",
|
|
836
|
+
message: `Response Validation Warnings for platform > Serviceability > getBulkTat \n ${res_error}`,
|
|
837
|
+
});
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
return response;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
/**
|
|
845
|
+
* @param {ServiceabilityPlatformValidator.GetCompanyConfigurationParam} arg
|
|
846
|
+
* - Arg object
|
|
847
|
+
*
|
|
848
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
849
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
850
|
+
* @returns {Promise<ServiceabilityPlatformModel.CompanyConfig>} - Success response
|
|
851
|
+
* @name getCompanyConfiguration
|
|
852
|
+
* @summary: Get All Courier Rules applied to company.
|
|
853
|
+
* @description: This API returns all Courier Rules applied for company. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getCompanyConfiguration/).
|
|
105
854
|
*/
|
|
106
|
-
async
|
|
855
|
+
async getCompanyConfiguration(
|
|
107
856
|
{ requestHeaders } = { requestHeaders: {} },
|
|
108
857
|
{ responseHeaders } = { responseHeaders: false }
|
|
109
858
|
) {
|
|
110
|
-
const {
|
|
859
|
+
const {
|
|
860
|
+
error,
|
|
861
|
+
} = ServiceabilityPlatformValidator.getCompanyConfiguration().validate(
|
|
111
862
|
{},
|
|
112
863
|
{ abortEarly: false, allowUnknown: true }
|
|
113
864
|
);
|
|
@@ -118,14 +869,14 @@ class Serviceability {
|
|
|
118
869
|
// Showing warrnings if extra unknown parameters are found
|
|
119
870
|
const {
|
|
120
871
|
error: warrning,
|
|
121
|
-
} = ServiceabilityPlatformValidator.
|
|
872
|
+
} = ServiceabilityPlatformValidator.getCompanyConfiguration().validate(
|
|
122
873
|
{},
|
|
123
874
|
{ abortEarly: false, allowUnknown: false }
|
|
124
875
|
);
|
|
125
876
|
if (warrning) {
|
|
126
877
|
Logger({
|
|
127
878
|
level: "WARN",
|
|
128
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
879
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getCompanyConfiguration \n ${warrning}`,
|
|
129
880
|
});
|
|
130
881
|
}
|
|
131
882
|
|
|
@@ -136,7 +887,7 @@ class Serviceability {
|
|
|
136
887
|
const response = await PlatformAPIClient.execute(
|
|
137
888
|
this.config,
|
|
138
889
|
"get",
|
|
139
|
-
`/service/platform/logistics/v1.0/company/${this.config.companyId}/
|
|
890
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/configuration`,
|
|
140
891
|
query_params,
|
|
141
892
|
undefined,
|
|
142
893
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -150,10 +901,10 @@ class Serviceability {
|
|
|
150
901
|
|
|
151
902
|
const {
|
|
152
903
|
error: res_error,
|
|
153
|
-
} = ServiceabilityPlatformModel.
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
);
|
|
904
|
+
} = ServiceabilityPlatformModel.CompanyConfig().validate(responseData, {
|
|
905
|
+
abortEarly: false,
|
|
906
|
+
allowUnknown: true,
|
|
907
|
+
});
|
|
157
908
|
|
|
158
909
|
if (res_error) {
|
|
159
910
|
if (this.config.options.strictResponseCheck === true) {
|
|
@@ -161,7 +912,7 @@ class Serviceability {
|
|
|
161
912
|
} else {
|
|
162
913
|
Logger({
|
|
163
914
|
level: "WARN",
|
|
164
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
915
|
+
message: `Response Validation Warnings for platform > Serviceability > getCompanyConfiguration \n ${res_error}`,
|
|
165
916
|
});
|
|
166
917
|
}
|
|
167
918
|
}
|
|
@@ -170,26 +921,26 @@ class Serviceability {
|
|
|
170
921
|
}
|
|
171
922
|
|
|
172
923
|
/**
|
|
173
|
-
* @param {ServiceabilityPlatformValidator.
|
|
924
|
+
* @param {ServiceabilityPlatformValidator.GetCourierPartnerAccountParam} arg
|
|
925
|
+
* - Arg object
|
|
926
|
+
*
|
|
174
927
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
175
928
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
176
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
* @
|
|
180
|
-
* @
|
|
181
|
-
* @description: This API returns Company Store View of the application. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getCompanyStoreView/).
|
|
929
|
+
* @returns {Promise<ServiceabilityPlatformModel.CourierAccountResponse>} -
|
|
930
|
+
* Success response
|
|
931
|
+
* @name getCourierPartnerAccount
|
|
932
|
+
* @summary: Getting Courier Account of a company from database.
|
|
933
|
+
* @description: This API returns response DpAccount of a company from mongo database. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getCourierPartnerAccount/).
|
|
182
934
|
*/
|
|
183
|
-
async
|
|
184
|
-
{
|
|
935
|
+
async getCourierPartnerAccount(
|
|
936
|
+
{ accountId, requestHeaders } = { requestHeaders: {} },
|
|
185
937
|
{ responseHeaders } = { responseHeaders: false }
|
|
186
938
|
) {
|
|
187
939
|
const {
|
|
188
940
|
error,
|
|
189
|
-
} = ServiceabilityPlatformValidator.
|
|
941
|
+
} = ServiceabilityPlatformValidator.getCourierPartnerAccount().validate(
|
|
190
942
|
{
|
|
191
|
-
|
|
192
|
-
pageSize,
|
|
943
|
+
accountId,
|
|
193
944
|
},
|
|
194
945
|
{ abortEarly: false, allowUnknown: true }
|
|
195
946
|
);
|
|
@@ -200,30 +951,27 @@ class Serviceability {
|
|
|
200
951
|
// Showing warrnings if extra unknown parameters are found
|
|
201
952
|
const {
|
|
202
953
|
error: warrning,
|
|
203
|
-
} = ServiceabilityPlatformValidator.
|
|
954
|
+
} = ServiceabilityPlatformValidator.getCourierPartnerAccount().validate(
|
|
204
955
|
{
|
|
205
|
-
|
|
206
|
-
pageSize,
|
|
956
|
+
accountId,
|
|
207
957
|
},
|
|
208
958
|
{ abortEarly: false, allowUnknown: false }
|
|
209
959
|
);
|
|
210
960
|
if (warrning) {
|
|
211
961
|
Logger({
|
|
212
962
|
level: "WARN",
|
|
213
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
963
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getCourierPartnerAccount \n ${warrning}`,
|
|
214
964
|
});
|
|
215
965
|
}
|
|
216
966
|
|
|
217
967
|
const query_params = {};
|
|
218
|
-
query_params["page_number"] = pageNumber;
|
|
219
|
-
query_params["page_size"] = pageSize;
|
|
220
968
|
|
|
221
969
|
const xHeaders = {};
|
|
222
970
|
|
|
223
971
|
const response = await PlatformAPIClient.execute(
|
|
224
972
|
this.config,
|
|
225
973
|
"get",
|
|
226
|
-
`/service/platform/logistics/v1.0/company/${this.config.companyId}/
|
|
974
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/courier-partner/account/${accountId}`,
|
|
227
975
|
query_params,
|
|
228
976
|
undefined,
|
|
229
977
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -237,7 +985,7 @@ class Serviceability {
|
|
|
237
985
|
|
|
238
986
|
const {
|
|
239
987
|
error: res_error,
|
|
240
|
-
} = ServiceabilityPlatformModel.
|
|
988
|
+
} = ServiceabilityPlatformModel.CourierAccountResponse().validate(
|
|
241
989
|
responseData,
|
|
242
990
|
{ abortEarly: false, allowUnknown: true }
|
|
243
991
|
);
|
|
@@ -248,7 +996,7 @@ class Serviceability {
|
|
|
248
996
|
} else {
|
|
249
997
|
Logger({
|
|
250
998
|
level: "WARN",
|
|
251
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
999
|
+
message: `Response Validation Warnings for platform > Serviceability > getCourierPartnerAccount \n ${res_error}`,
|
|
252
1000
|
});
|
|
253
1001
|
}
|
|
254
1002
|
}
|
|
@@ -257,30 +1005,29 @@ class Serviceability {
|
|
|
257
1005
|
}
|
|
258
1006
|
|
|
259
1007
|
/**
|
|
260
|
-
* @param {ServiceabilityPlatformValidator.
|
|
1008
|
+
* @param {ServiceabilityPlatformValidator.GetCourierPartnerAccountsParam} arg
|
|
1009
|
+
* - Arg object
|
|
1010
|
+
*
|
|
261
1011
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
262
1012
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
263
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
1013
|
+
* @returns {Promise<ServiceabilityPlatformModel.CompanyCourierPartnerAccountListResponse>}
|
|
264
1014
|
* - Success response
|
|
265
1015
|
*
|
|
266
|
-
* @name
|
|
267
|
-
* @summary: Getting
|
|
268
|
-
* @description: This API returns
|
|
1016
|
+
* @name getCourierPartnerAccounts
|
|
1017
|
+
* @summary: Getting Courier Account list of a company.
|
|
1018
|
+
* @description: This API returns Courier Account of a company. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getCourierPartnerAccounts/).
|
|
269
1019
|
*/
|
|
270
|
-
async
|
|
271
|
-
{
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
stage,
|
|
275
|
-
paymentMode,
|
|
276
|
-
transportType,
|
|
277
|
-
requestHeaders,
|
|
278
|
-
} = { requestHeaders: {} },
|
|
1020
|
+
async getCourierPartnerAccounts(
|
|
1021
|
+
{ pageNo, pageSize, stage, paymentMode, transportType, requestHeaders } = {
|
|
1022
|
+
requestHeaders: {},
|
|
1023
|
+
},
|
|
279
1024
|
{ responseHeaders } = { responseHeaders: false }
|
|
280
1025
|
) {
|
|
281
|
-
const {
|
|
1026
|
+
const {
|
|
1027
|
+
error,
|
|
1028
|
+
} = ServiceabilityPlatformValidator.getCourierPartnerAccounts().validate(
|
|
282
1029
|
{
|
|
283
|
-
|
|
1030
|
+
pageNo,
|
|
284
1031
|
pageSize,
|
|
285
1032
|
stage,
|
|
286
1033
|
paymentMode,
|
|
@@ -295,9 +1042,9 @@ class Serviceability {
|
|
|
295
1042
|
// Showing warrnings if extra unknown parameters are found
|
|
296
1043
|
const {
|
|
297
1044
|
error: warrning,
|
|
298
|
-
} = ServiceabilityPlatformValidator.
|
|
1045
|
+
} = ServiceabilityPlatformValidator.getCourierPartnerAccounts().validate(
|
|
299
1046
|
{
|
|
300
|
-
|
|
1047
|
+
pageNo,
|
|
301
1048
|
pageSize,
|
|
302
1049
|
stage,
|
|
303
1050
|
paymentMode,
|
|
@@ -308,12 +1055,12 @@ class Serviceability {
|
|
|
308
1055
|
if (warrning) {
|
|
309
1056
|
Logger({
|
|
310
1057
|
level: "WARN",
|
|
311
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
1058
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getCourierPartnerAccounts \n ${warrning}`,
|
|
312
1059
|
});
|
|
313
1060
|
}
|
|
314
1061
|
|
|
315
1062
|
const query_params = {};
|
|
316
|
-
query_params["
|
|
1063
|
+
query_params["page_no"] = pageNo;
|
|
317
1064
|
query_params["page_size"] = pageSize;
|
|
318
1065
|
query_params["stage"] = stage;
|
|
319
1066
|
query_params["payment_mode"] = paymentMode;
|
|
@@ -324,7 +1071,7 @@ class Serviceability {
|
|
|
324
1071
|
const response = await PlatformAPIClient.execute(
|
|
325
1072
|
this.config,
|
|
326
1073
|
"get",
|
|
327
|
-
`/service/platform/logistics/v1.0/company/${this.config.companyId}/courier/account`,
|
|
1074
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/courier-partner/account`,
|
|
328
1075
|
query_params,
|
|
329
1076
|
undefined,
|
|
330
1077
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -338,7 +1085,7 @@ class Serviceability {
|
|
|
338
1085
|
|
|
339
1086
|
const {
|
|
340
1087
|
error: res_error,
|
|
341
|
-
} = ServiceabilityPlatformModel.
|
|
1088
|
+
} = ServiceabilityPlatformModel.CompanyCourierPartnerAccountListResponse().validate(
|
|
342
1089
|
responseData,
|
|
343
1090
|
{ abortEarly: false, allowUnknown: true }
|
|
344
1091
|
);
|
|
@@ -349,7 +1096,7 @@ class Serviceability {
|
|
|
349
1096
|
} else {
|
|
350
1097
|
Logger({
|
|
351
1098
|
level: "WARN",
|
|
352
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
1099
|
+
message: `Response Validation Warnings for platform > Serviceability > getCourierPartnerAccounts \n ${res_error}`,
|
|
353
1100
|
});
|
|
354
1101
|
}
|
|
355
1102
|
}
|
|
@@ -358,23 +1105,25 @@ class Serviceability {
|
|
|
358
1105
|
}
|
|
359
1106
|
|
|
360
1107
|
/**
|
|
361
|
-
* @param {ServiceabilityPlatformValidator.
|
|
1108
|
+
* @param {ServiceabilityPlatformValidator.GetOptimalLocationsParam} arg - Arg object
|
|
362
1109
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
363
1110
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
364
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
1111
|
+
* @returns {Promise<ServiceabilityPlatformModel.ReAssignStoreResponse>} -
|
|
365
1112
|
* Success response
|
|
366
|
-
* @name
|
|
367
|
-
* @summary: Get
|
|
368
|
-
* @description: This API returns
|
|
1113
|
+
* @name getOptimalLocations
|
|
1114
|
+
* @summary: Get serviceable store of the item
|
|
1115
|
+
* @description: This API returns serviceable store of the item. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getOptimalLocations/).
|
|
369
1116
|
*/
|
|
370
|
-
async
|
|
371
|
-
{ requestHeaders } = { requestHeaders: {} },
|
|
1117
|
+
async getOptimalLocations(
|
|
1118
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
372
1119
|
{ responseHeaders } = { responseHeaders: false }
|
|
373
1120
|
) {
|
|
374
1121
|
const {
|
|
375
1122
|
error,
|
|
376
|
-
} = ServiceabilityPlatformValidator.
|
|
377
|
-
{
|
|
1123
|
+
} = ServiceabilityPlatformValidator.getOptimalLocations().validate(
|
|
1124
|
+
{
|
|
1125
|
+
body,
|
|
1126
|
+
},
|
|
378
1127
|
{ abortEarly: false, allowUnknown: true }
|
|
379
1128
|
);
|
|
380
1129
|
if (error) {
|
|
@@ -384,14 +1133,16 @@ class Serviceability {
|
|
|
384
1133
|
// Showing warrnings if extra unknown parameters are found
|
|
385
1134
|
const {
|
|
386
1135
|
error: warrning,
|
|
387
|
-
} = ServiceabilityPlatformValidator.
|
|
388
|
-
{
|
|
1136
|
+
} = ServiceabilityPlatformValidator.getOptimalLocations().validate(
|
|
1137
|
+
{
|
|
1138
|
+
body,
|
|
1139
|
+
},
|
|
389
1140
|
{ abortEarly: false, allowUnknown: false }
|
|
390
1141
|
);
|
|
391
1142
|
if (warrning) {
|
|
392
1143
|
Logger({
|
|
393
1144
|
level: "WARN",
|
|
394
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
1145
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getOptimalLocations \n ${warrning}`,
|
|
395
1146
|
});
|
|
396
1147
|
}
|
|
397
1148
|
|
|
@@ -401,10 +1152,10 @@ class Serviceability {
|
|
|
401
1152
|
|
|
402
1153
|
const response = await PlatformAPIClient.execute(
|
|
403
1154
|
this.config,
|
|
404
|
-
"
|
|
405
|
-
`/service/platform/logistics/v1.0/company/${this.config.companyId}/
|
|
1155
|
+
"post",
|
|
1156
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/reassign`,
|
|
406
1157
|
query_params,
|
|
407
|
-
|
|
1158
|
+
body,
|
|
408
1159
|
{ ...xHeaders, ...requestHeaders },
|
|
409
1160
|
{ responseHeaders }
|
|
410
1161
|
);
|
|
@@ -416,7 +1167,7 @@ class Serviceability {
|
|
|
416
1167
|
|
|
417
1168
|
const {
|
|
418
1169
|
error: res_error,
|
|
419
|
-
} = ServiceabilityPlatformModel.
|
|
1170
|
+
} = ServiceabilityPlatformModel.ReAssignStoreResponse().validate(
|
|
420
1171
|
responseData,
|
|
421
1172
|
{ abortEarly: false, allowUnknown: true }
|
|
422
1173
|
);
|
|
@@ -427,7 +1178,7 @@ class Serviceability {
|
|
|
427
1178
|
} else {
|
|
428
1179
|
Logger({
|
|
429
1180
|
level: "WARN",
|
|
430
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
1181
|
+
message: `Response Validation Warnings for platform > Serviceability > getOptimalLocations \n ${res_error}`,
|
|
431
1182
|
});
|
|
432
1183
|
}
|
|
433
1184
|
}
|
|
@@ -436,26 +1187,32 @@ class Serviceability {
|
|
|
436
1187
|
}
|
|
437
1188
|
|
|
438
1189
|
/**
|
|
439
|
-
* @param {ServiceabilityPlatformValidator.
|
|
1190
|
+
* @param {ServiceabilityPlatformValidator.GetPackageMaterialListParam} arg
|
|
1191
|
+
* - Arg object
|
|
1192
|
+
*
|
|
440
1193
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
441
1194
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
442
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
443
|
-
*
|
|
444
|
-
*
|
|
445
|
-
* @
|
|
446
|
-
* @
|
|
447
|
-
* @description: This API returns response of DpRules from mongo database. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getDpRuleInsert/).
|
|
1195
|
+
* @returns {Promise<ServiceabilityPlatformModel.PackageMaterialList>} -
|
|
1196
|
+
* Success response
|
|
1197
|
+
* @name getPackageMaterialList
|
|
1198
|
+
* @summary: Fetching of PackageMaterials from database.
|
|
1199
|
+
* @description: This API returns response of PackageMaterials from mongo database. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getPackageMaterialList/).
|
|
448
1200
|
*/
|
|
449
|
-
async
|
|
450
|
-
{
|
|
1201
|
+
async getPackageMaterialList(
|
|
1202
|
+
{ pageNo, pageSize, q, size, packageType, requestHeaders } = {
|
|
1203
|
+
requestHeaders: {},
|
|
1204
|
+
},
|
|
451
1205
|
{ responseHeaders } = { responseHeaders: false }
|
|
452
1206
|
) {
|
|
453
1207
|
const {
|
|
454
1208
|
error,
|
|
455
|
-
} = ServiceabilityPlatformValidator.
|
|
1209
|
+
} = ServiceabilityPlatformValidator.getPackageMaterialList().validate(
|
|
456
1210
|
{
|
|
457
|
-
|
|
1211
|
+
pageNo,
|
|
458
1212
|
pageSize,
|
|
1213
|
+
q,
|
|
1214
|
+
size,
|
|
1215
|
+
packageType,
|
|
459
1216
|
},
|
|
460
1217
|
{ abortEarly: false, allowUnknown: true }
|
|
461
1218
|
);
|
|
@@ -466,30 +1223,36 @@ class Serviceability {
|
|
|
466
1223
|
// Showing warrnings if extra unknown parameters are found
|
|
467
1224
|
const {
|
|
468
1225
|
error: warrning,
|
|
469
|
-
} = ServiceabilityPlatformValidator.
|
|
1226
|
+
} = ServiceabilityPlatformValidator.getPackageMaterialList().validate(
|
|
470
1227
|
{
|
|
471
|
-
|
|
1228
|
+
pageNo,
|
|
472
1229
|
pageSize,
|
|
1230
|
+
q,
|
|
1231
|
+
size,
|
|
1232
|
+
packageType,
|
|
473
1233
|
},
|
|
474
1234
|
{ abortEarly: false, allowUnknown: false }
|
|
475
1235
|
);
|
|
476
1236
|
if (warrning) {
|
|
477
1237
|
Logger({
|
|
478
1238
|
level: "WARN",
|
|
479
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
1239
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getPackageMaterialList \n ${warrning}`,
|
|
480
1240
|
});
|
|
481
1241
|
}
|
|
482
1242
|
|
|
483
1243
|
const query_params = {};
|
|
484
|
-
query_params["
|
|
1244
|
+
query_params["page_no"] = pageNo;
|
|
485
1245
|
query_params["page_size"] = pageSize;
|
|
1246
|
+
query_params["q"] = q;
|
|
1247
|
+
query_params["size"] = size;
|
|
1248
|
+
query_params["package_type"] = packageType;
|
|
486
1249
|
|
|
487
1250
|
const xHeaders = {};
|
|
488
1251
|
|
|
489
1252
|
const response = await PlatformAPIClient.execute(
|
|
490
1253
|
this.config,
|
|
491
1254
|
"get",
|
|
492
|
-
`/service/platform/logistics/v1.0/company/${this.config.companyId}/
|
|
1255
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/packaging-materials`,
|
|
493
1256
|
query_params,
|
|
494
1257
|
undefined,
|
|
495
1258
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -503,7 +1266,7 @@ class Serviceability {
|
|
|
503
1266
|
|
|
504
1267
|
const {
|
|
505
1268
|
error: res_error,
|
|
506
|
-
} = ServiceabilityPlatformModel.
|
|
1269
|
+
} = ServiceabilityPlatformModel.PackageMaterialList().validate(
|
|
507
1270
|
responseData,
|
|
508
1271
|
{ abortEarly: false, allowUnknown: true }
|
|
509
1272
|
);
|
|
@@ -514,7 +1277,7 @@ class Serviceability {
|
|
|
514
1277
|
} else {
|
|
515
1278
|
Logger({
|
|
516
1279
|
level: "WARN",
|
|
517
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
1280
|
+
message: `Response Validation Warnings for platform > Serviceability > getPackageMaterialList \n ${res_error}`,
|
|
518
1281
|
});
|
|
519
1282
|
}
|
|
520
1283
|
}
|
|
@@ -523,22 +1286,26 @@ class Serviceability {
|
|
|
523
1286
|
}
|
|
524
1287
|
|
|
525
1288
|
/**
|
|
526
|
-
* @param {ServiceabilityPlatformValidator.
|
|
1289
|
+
* @param {ServiceabilityPlatformValidator.GetPackageMaterialRuleParam} arg
|
|
1290
|
+
* - Arg object
|
|
1291
|
+
*
|
|
527
1292
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
528
1293
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
529
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
1294
|
+
* @returns {Promise<ServiceabilityPlatformModel.PackageRuleResponse>} -
|
|
530
1295
|
* Success response
|
|
531
|
-
* @name
|
|
532
|
-
* @summary: Fetching of
|
|
533
|
-
* @description: This API returns response of
|
|
1296
|
+
* @name getPackageMaterialRule
|
|
1297
|
+
* @summary: Fetching of Package Material from database.
|
|
1298
|
+
* @description: This API returns response of Package Material from mongo database. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getPackageMaterialRule/).
|
|
534
1299
|
*/
|
|
535
|
-
async
|
|
536
|
-
{
|
|
1300
|
+
async getPackageMaterialRule(
|
|
1301
|
+
{ ruleId, requestHeaders } = { requestHeaders: {} },
|
|
537
1302
|
{ responseHeaders } = { responseHeaders: false }
|
|
538
1303
|
) {
|
|
539
|
-
const {
|
|
1304
|
+
const {
|
|
1305
|
+
error,
|
|
1306
|
+
} = ServiceabilityPlatformValidator.getPackageMaterialRule().validate(
|
|
540
1307
|
{
|
|
541
|
-
|
|
1308
|
+
ruleId,
|
|
542
1309
|
},
|
|
543
1310
|
{ abortEarly: false, allowUnknown: true }
|
|
544
1311
|
);
|
|
@@ -549,16 +1316,16 @@ class Serviceability {
|
|
|
549
1316
|
// Showing warrnings if extra unknown parameters are found
|
|
550
1317
|
const {
|
|
551
1318
|
error: warrning,
|
|
552
|
-
} = ServiceabilityPlatformValidator.
|
|
1319
|
+
} = ServiceabilityPlatformValidator.getPackageMaterialRule().validate(
|
|
553
1320
|
{
|
|
554
|
-
|
|
1321
|
+
ruleId,
|
|
555
1322
|
},
|
|
556
1323
|
{ abortEarly: false, allowUnknown: false }
|
|
557
1324
|
);
|
|
558
1325
|
if (warrning) {
|
|
559
1326
|
Logger({
|
|
560
1327
|
level: "WARN",
|
|
561
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
1328
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getPackageMaterialRule \n ${warrning}`,
|
|
562
1329
|
});
|
|
563
1330
|
}
|
|
564
1331
|
|
|
@@ -569,7 +1336,7 @@ class Serviceability {
|
|
|
569
1336
|
const response = await PlatformAPIClient.execute(
|
|
570
1337
|
this.config,
|
|
571
1338
|
"get",
|
|
572
|
-
`/service/platform/logistics/v1.0/company/${this.config.companyId}/
|
|
1339
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/packaging-material/rules/${ruleId}`,
|
|
573
1340
|
query_params,
|
|
574
1341
|
undefined,
|
|
575
1342
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -583,7 +1350,7 @@ class Serviceability {
|
|
|
583
1350
|
|
|
584
1351
|
const {
|
|
585
1352
|
error: res_error,
|
|
586
|
-
} = ServiceabilityPlatformModel.
|
|
1353
|
+
} = ServiceabilityPlatformModel.PackageRuleResponse().validate(
|
|
587
1354
|
responseData,
|
|
588
1355
|
{ abortEarly: false, allowUnknown: true }
|
|
589
1356
|
);
|
|
@@ -594,7 +1361,7 @@ class Serviceability {
|
|
|
594
1361
|
} else {
|
|
595
1362
|
Logger({
|
|
596
1363
|
level: "WARN",
|
|
597
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
1364
|
+
message: `Response Validation Warnings for platform > Serviceability > getPackageMaterialRule \n ${res_error}`,
|
|
598
1365
|
});
|
|
599
1366
|
}
|
|
600
1367
|
}
|
|
@@ -603,25 +1370,29 @@ class Serviceability {
|
|
|
603
1370
|
}
|
|
604
1371
|
|
|
605
1372
|
/**
|
|
606
|
-
* @param {ServiceabilityPlatformValidator.
|
|
1373
|
+
* @param {ServiceabilityPlatformValidator.GetPackageMaterialRulesParam} arg
|
|
1374
|
+
* - Arg object
|
|
1375
|
+
*
|
|
607
1376
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
608
1377
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
609
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
1378
|
+
* @returns {Promise<ServiceabilityPlatformModel.PackageMaterialRuleList>}
|
|
610
1379
|
* - Success response
|
|
611
1380
|
*
|
|
612
|
-
* @name
|
|
613
|
-
* @summary:
|
|
614
|
-
* @description: This API returns response
|
|
1381
|
+
* @name getPackageMaterialRules
|
|
1382
|
+
* @summary: Fetching of Package Material Rules from database.
|
|
1383
|
+
* @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/getPackageMaterialRules/).
|
|
615
1384
|
*/
|
|
616
|
-
async
|
|
617
|
-
{
|
|
1385
|
+
async getPackageMaterialRules(
|
|
1386
|
+
{ pageNo, pageSize, isActive, requestHeaders } = { requestHeaders: {} },
|
|
618
1387
|
{ responseHeaders } = { responseHeaders: false }
|
|
619
1388
|
) {
|
|
620
1389
|
const {
|
|
621
1390
|
error,
|
|
622
|
-
} = ServiceabilityPlatformValidator.
|
|
1391
|
+
} = ServiceabilityPlatformValidator.getPackageMaterialRules().validate(
|
|
623
1392
|
{
|
|
624
|
-
|
|
1393
|
+
pageNo,
|
|
1394
|
+
pageSize,
|
|
1395
|
+
isActive,
|
|
625
1396
|
},
|
|
626
1397
|
{ abortEarly: false, allowUnknown: true }
|
|
627
1398
|
);
|
|
@@ -632,29 +1403,34 @@ class Serviceability {
|
|
|
632
1403
|
// Showing warrnings if extra unknown parameters are found
|
|
633
1404
|
const {
|
|
634
1405
|
error: warrning,
|
|
635
|
-
} = ServiceabilityPlatformValidator.
|
|
1406
|
+
} = ServiceabilityPlatformValidator.getPackageMaterialRules().validate(
|
|
636
1407
|
{
|
|
637
|
-
|
|
1408
|
+
pageNo,
|
|
1409
|
+
pageSize,
|
|
1410
|
+
isActive,
|
|
638
1411
|
},
|
|
639
1412
|
{ abortEarly: false, allowUnknown: false }
|
|
640
1413
|
);
|
|
641
1414
|
if (warrning) {
|
|
642
1415
|
Logger({
|
|
643
1416
|
level: "WARN",
|
|
644
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
1417
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getPackageMaterialRules \n ${warrning}`,
|
|
645
1418
|
});
|
|
646
1419
|
}
|
|
647
1420
|
|
|
648
1421
|
const query_params = {};
|
|
1422
|
+
query_params["page_no"] = pageNo;
|
|
1423
|
+
query_params["page_size"] = pageSize;
|
|
1424
|
+
query_params["is_active"] = isActive;
|
|
649
1425
|
|
|
650
1426
|
const xHeaders = {};
|
|
651
1427
|
|
|
652
1428
|
const response = await PlatformAPIClient.execute(
|
|
653
1429
|
this.config,
|
|
654
|
-
"
|
|
655
|
-
`/service/platform/logistics/v1.0/company/${this.config.companyId}/
|
|
1430
|
+
"get",
|
|
1431
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/packaging-material/rules`,
|
|
656
1432
|
query_params,
|
|
657
|
-
|
|
1433
|
+
undefined,
|
|
658
1434
|
{ ...xHeaders, ...requestHeaders },
|
|
659
1435
|
{ responseHeaders }
|
|
660
1436
|
);
|
|
@@ -666,7 +1442,7 @@ class Serviceability {
|
|
|
666
1442
|
|
|
667
1443
|
const {
|
|
668
1444
|
error: res_error,
|
|
669
|
-
} = ServiceabilityPlatformModel.
|
|
1445
|
+
} = ServiceabilityPlatformModel.PackageMaterialRuleList().validate(
|
|
670
1446
|
responseData,
|
|
671
1447
|
{ abortEarly: false, allowUnknown: true }
|
|
672
1448
|
);
|
|
@@ -677,7 +1453,7 @@ class Serviceability {
|
|
|
677
1453
|
} else {
|
|
678
1454
|
Logger({
|
|
679
1455
|
level: "WARN",
|
|
680
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
1456
|
+
message: `Response Validation Warnings for platform > Serviceability > getPackageMaterialRules \n ${res_error}`,
|
|
681
1457
|
});
|
|
682
1458
|
}
|
|
683
1459
|
}
|
|
@@ -686,28 +1462,25 @@ class Serviceability {
|
|
|
686
1462
|
}
|
|
687
1463
|
|
|
688
1464
|
/**
|
|
689
|
-
* @param {ServiceabilityPlatformValidator.
|
|
1465
|
+
* @param {ServiceabilityPlatformValidator.GetPackageMaterialsParam} arg - Arg object
|
|
690
1466
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
691
1467
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
692
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
693
|
-
*
|
|
694
|
-
*
|
|
695
|
-
* @
|
|
1468
|
+
* @returns {Promise<ServiceabilityPlatformModel.PackageMaterialResponse>}
|
|
1469
|
+
* - Success response
|
|
1470
|
+
*
|
|
1471
|
+
* @name getPackageMaterials
|
|
1472
|
+
* @summary: Fetching of Package Material from database.
|
|
1473
|
+
* @description: This API returns response of Package Material from mongo database. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getPackageMaterials/).
|
|
696
1474
|
*/
|
|
697
|
-
async
|
|
698
|
-
{
|
|
699
|
-
requestHeaders: {},
|
|
700
|
-
},
|
|
1475
|
+
async getPackageMaterials(
|
|
1476
|
+
{ packageMaterialId, requestHeaders } = { requestHeaders: {} },
|
|
701
1477
|
{ responseHeaders } = { responseHeaders: false }
|
|
702
1478
|
) {
|
|
703
|
-
const {
|
|
1479
|
+
const {
|
|
1480
|
+
error,
|
|
1481
|
+
} = ServiceabilityPlatformValidator.getPackageMaterials().validate(
|
|
704
1482
|
{
|
|
705
|
-
|
|
706
|
-
pageSize,
|
|
707
|
-
name,
|
|
708
|
-
isActive,
|
|
709
|
-
channelIds,
|
|
710
|
-
q,
|
|
1483
|
+
packageMaterialId,
|
|
711
1484
|
},
|
|
712
1485
|
{ abortEarly: false, allowUnknown: true }
|
|
713
1486
|
);
|
|
@@ -718,38 +1491,27 @@ class Serviceability {
|
|
|
718
1491
|
// Showing warrnings if extra unknown parameters are found
|
|
719
1492
|
const {
|
|
720
1493
|
error: warrning,
|
|
721
|
-
} = ServiceabilityPlatformValidator.
|
|
1494
|
+
} = ServiceabilityPlatformValidator.getPackageMaterials().validate(
|
|
722
1495
|
{
|
|
723
|
-
|
|
724
|
-
pageSize,
|
|
725
|
-
name,
|
|
726
|
-
isActive,
|
|
727
|
-
channelIds,
|
|
728
|
-
q,
|
|
1496
|
+
packageMaterialId,
|
|
729
1497
|
},
|
|
730
1498
|
{ abortEarly: false, allowUnknown: false }
|
|
731
1499
|
);
|
|
732
1500
|
if (warrning) {
|
|
733
1501
|
Logger({
|
|
734
1502
|
level: "WARN",
|
|
735
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
1503
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getPackageMaterials \n ${warrning}`,
|
|
736
1504
|
});
|
|
737
1505
|
}
|
|
738
1506
|
|
|
739
1507
|
const query_params = {};
|
|
740
|
-
query_params["page_number"] = pageNumber;
|
|
741
|
-
query_params["page_size"] = pageSize;
|
|
742
|
-
query_params["name"] = name;
|
|
743
|
-
query_params["is_active"] = isActive;
|
|
744
|
-
query_params["channel_ids"] = channelIds;
|
|
745
|
-
query_params["q"] = q;
|
|
746
1508
|
|
|
747
1509
|
const xHeaders = {};
|
|
748
1510
|
|
|
749
1511
|
const response = await PlatformAPIClient.execute(
|
|
750
1512
|
this.config,
|
|
751
1513
|
"get",
|
|
752
|
-
`/service/platform/logistics/v1.0/company/${this.config.companyId}/
|
|
1514
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/packaging-material/${packageMaterialId}`,
|
|
753
1515
|
query_params,
|
|
754
1516
|
undefined,
|
|
755
1517
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -763,10 +1525,10 @@ class Serviceability {
|
|
|
763
1525
|
|
|
764
1526
|
const {
|
|
765
1527
|
error: res_error,
|
|
766
|
-
} = ServiceabilityPlatformModel.
|
|
767
|
-
|
|
768
|
-
allowUnknown: true
|
|
769
|
-
|
|
1528
|
+
} = ServiceabilityPlatformModel.PackageMaterialResponse().validate(
|
|
1529
|
+
responseData,
|
|
1530
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1531
|
+
);
|
|
770
1532
|
|
|
771
1533
|
if (res_error) {
|
|
772
1534
|
if (this.config.options.strictResponseCheck === true) {
|
|
@@ -774,7 +1536,7 @@ class Serviceability {
|
|
|
774
1536
|
} else {
|
|
775
1537
|
Logger({
|
|
776
1538
|
level: "WARN",
|
|
777
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
1539
|
+
message: `Response Validation Warnings for platform > Serviceability > getPackageMaterials \n ${res_error}`,
|
|
778
1540
|
});
|
|
779
1541
|
}
|
|
780
1542
|
}
|
|
@@ -783,24 +1545,28 @@ class Serviceability {
|
|
|
783
1545
|
}
|
|
784
1546
|
|
|
785
1547
|
/**
|
|
786
|
-
* @param {ServiceabilityPlatformValidator.
|
|
1548
|
+
* @param {ServiceabilityPlatformValidator.GetServiceabilityParam} arg - Arg object
|
|
787
1549
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
788
1550
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
789
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
1551
|
+
* @returns {Promise<ServiceabilityPlatformModel.ServiceabilityModel>} -
|
|
790
1552
|
* Success response
|
|
791
|
-
* @name
|
|
792
|
-
* @summary: Get
|
|
793
|
-
* @description:
|
|
1553
|
+
* @name getServiceability
|
|
1554
|
+
* @summary: Get Serviceability of a region
|
|
1555
|
+
* @description: Get Serviceability of a region - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getServiceability/).
|
|
794
1556
|
*/
|
|
795
|
-
async
|
|
796
|
-
{
|
|
1557
|
+
async getServiceability(
|
|
1558
|
+
{ extensionId, schemeId, regionId, requestHeaders } = {
|
|
1559
|
+
requestHeaders: {},
|
|
1560
|
+
},
|
|
797
1561
|
{ responseHeaders } = { responseHeaders: false }
|
|
798
1562
|
) {
|
|
799
1563
|
const {
|
|
800
1564
|
error,
|
|
801
|
-
} = ServiceabilityPlatformValidator.
|
|
1565
|
+
} = ServiceabilityPlatformValidator.getServiceability().validate(
|
|
802
1566
|
{
|
|
803
|
-
|
|
1567
|
+
extensionId,
|
|
1568
|
+
schemeId,
|
|
1569
|
+
regionId,
|
|
804
1570
|
},
|
|
805
1571
|
{ abortEarly: false, allowUnknown: true }
|
|
806
1572
|
);
|
|
@@ -811,16 +1577,18 @@ class Serviceability {
|
|
|
811
1577
|
// Showing warrnings if extra unknown parameters are found
|
|
812
1578
|
const {
|
|
813
1579
|
error: warrning,
|
|
814
|
-
} = ServiceabilityPlatformValidator.
|
|
1580
|
+
} = ServiceabilityPlatformValidator.getServiceability().validate(
|
|
815
1581
|
{
|
|
816
|
-
|
|
1582
|
+
extensionId,
|
|
1583
|
+
schemeId,
|
|
1584
|
+
regionId,
|
|
817
1585
|
},
|
|
818
1586
|
{ abortEarly: false, allowUnknown: false }
|
|
819
1587
|
);
|
|
820
1588
|
if (warrning) {
|
|
821
1589
|
Logger({
|
|
822
1590
|
level: "WARN",
|
|
823
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
1591
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getServiceability \n ${warrning}`,
|
|
824
1592
|
});
|
|
825
1593
|
}
|
|
826
1594
|
|
|
@@ -830,10 +1598,10 @@ class Serviceability {
|
|
|
830
1598
|
|
|
831
1599
|
const response = await PlatformAPIClient.execute(
|
|
832
1600
|
this.config,
|
|
833
|
-
"
|
|
834
|
-
`/service/platform/logistics/v1.0/company/${this.config.companyId}/
|
|
1601
|
+
"get",
|
|
1602
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/courier-partner/${extensionId}/scheme/${schemeId}/serviceability/region/${regionId}`,
|
|
835
1603
|
query_params,
|
|
836
|
-
|
|
1604
|
+
undefined,
|
|
837
1605
|
{ ...xHeaders, ...requestHeaders },
|
|
838
1606
|
{ responseHeaders }
|
|
839
1607
|
);
|
|
@@ -845,7 +1613,7 @@ class Serviceability {
|
|
|
845
1613
|
|
|
846
1614
|
const {
|
|
847
1615
|
error: res_error,
|
|
848
|
-
} = ServiceabilityPlatformModel.
|
|
1616
|
+
} = ServiceabilityPlatformModel.ServiceabilityModel().validate(
|
|
849
1617
|
responseData,
|
|
850
1618
|
{ abortEarly: false, allowUnknown: true }
|
|
851
1619
|
);
|
|
@@ -856,7 +1624,7 @@ class Serviceability {
|
|
|
856
1624
|
} else {
|
|
857
1625
|
Logger({
|
|
858
1626
|
level: "WARN",
|
|
859
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
1627
|
+
message: `Response Validation Warnings for platform > Serviceability > getServiceability \n ${res_error}`,
|
|
860
1628
|
});
|
|
861
1629
|
}
|
|
862
1630
|
}
|
|
@@ -865,22 +1633,22 @@ class Serviceability {
|
|
|
865
1633
|
}
|
|
866
1634
|
|
|
867
1635
|
/**
|
|
868
|
-
* @param {ServiceabilityPlatformValidator.
|
|
1636
|
+
* @param {ServiceabilityPlatformValidator.GetZoneByIdParam} arg - Arg object
|
|
869
1637
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
870
1638
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
871
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
1639
|
+
* @returns {Promise<ServiceabilityPlatformModel.GetZoneByIdSchema>} -
|
|
872
1640
|
* Success response
|
|
873
|
-
* @name
|
|
874
|
-
* @summary:
|
|
875
|
-
* @description:
|
|
1641
|
+
* @name getZoneById
|
|
1642
|
+
* @summary: Get details of the Zone
|
|
1643
|
+
* @description: Returns the region, application, store mapping and other details in the Zone. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getZoneById/).
|
|
876
1644
|
*/
|
|
877
|
-
async
|
|
878
|
-
{
|
|
1645
|
+
async getZoneById(
|
|
1646
|
+
{ zoneId, requestHeaders } = { requestHeaders: {} },
|
|
879
1647
|
{ responseHeaders } = { responseHeaders: false }
|
|
880
1648
|
) {
|
|
881
|
-
const { error } = ServiceabilityPlatformValidator.
|
|
1649
|
+
const { error } = ServiceabilityPlatformValidator.getZoneById().validate(
|
|
882
1650
|
{
|
|
883
|
-
|
|
1651
|
+
zoneId,
|
|
884
1652
|
},
|
|
885
1653
|
{ abortEarly: false, allowUnknown: true }
|
|
886
1654
|
);
|
|
@@ -891,16 +1659,16 @@ class Serviceability {
|
|
|
891
1659
|
// Showing warrnings if extra unknown parameters are found
|
|
892
1660
|
const {
|
|
893
1661
|
error: warrning,
|
|
894
|
-
} = ServiceabilityPlatformValidator.
|
|
1662
|
+
} = ServiceabilityPlatformValidator.getZoneById().validate(
|
|
895
1663
|
{
|
|
896
|
-
|
|
1664
|
+
zoneId,
|
|
897
1665
|
},
|
|
898
1666
|
{ abortEarly: false, allowUnknown: false }
|
|
899
1667
|
);
|
|
900
1668
|
if (warrning) {
|
|
901
1669
|
Logger({
|
|
902
1670
|
level: "WARN",
|
|
903
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
1671
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getZoneById \n ${warrning}`,
|
|
904
1672
|
});
|
|
905
1673
|
}
|
|
906
1674
|
|
|
@@ -911,7 +1679,7 @@ class Serviceability {
|
|
|
911
1679
|
const response = await PlatformAPIClient.execute(
|
|
912
1680
|
this.config,
|
|
913
1681
|
"get",
|
|
914
|
-
`/service/platform/logistics/
|
|
1682
|
+
`/service/platform/logistics/v2.0/company/${this.config.companyId}/zones/${zoneId}`,
|
|
915
1683
|
query_params,
|
|
916
1684
|
undefined,
|
|
917
1685
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -925,10 +1693,10 @@ class Serviceability {
|
|
|
925
1693
|
|
|
926
1694
|
const {
|
|
927
1695
|
error: res_error,
|
|
928
|
-
} = ServiceabilityPlatformModel.
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
);
|
|
1696
|
+
} = ServiceabilityPlatformModel.GetZoneByIdSchema().validate(responseData, {
|
|
1697
|
+
abortEarly: false,
|
|
1698
|
+
allowUnknown: true,
|
|
1699
|
+
});
|
|
932
1700
|
|
|
933
1701
|
if (res_error) {
|
|
934
1702
|
if (this.config.options.strictResponseCheck === true) {
|
|
@@ -936,7 +1704,7 @@ class Serviceability {
|
|
|
936
1704
|
} else {
|
|
937
1705
|
Logger({
|
|
938
1706
|
level: "WARN",
|
|
939
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
1707
|
+
message: `Response Validation Warnings for platform > Serviceability > getZoneById \n ${res_error}`,
|
|
940
1708
|
});
|
|
941
1709
|
}
|
|
942
1710
|
}
|
|
@@ -945,25 +1713,42 @@ class Serviceability {
|
|
|
945
1713
|
}
|
|
946
1714
|
|
|
947
1715
|
/**
|
|
948
|
-
* @param {ServiceabilityPlatformValidator.
|
|
1716
|
+
* @param {ServiceabilityPlatformValidator.GetZonesParam} arg - Arg object
|
|
949
1717
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
950
1718
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
951
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
952
|
-
*
|
|
953
|
-
*
|
|
954
|
-
* @
|
|
955
|
-
* @summary: Zone Data View of application.
|
|
956
|
-
* @description: This API returns Zone Data View of the application. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getZoneDataView/).
|
|
1719
|
+
* @returns {Promise<ServiceabilityPlatformModel.ListViewResponse>} - Success response
|
|
1720
|
+
* @name getZones
|
|
1721
|
+
* @summary: Shows zones defined at the company level
|
|
1722
|
+
* @description: Return the list of zones that are defined at the company level. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getZones/).
|
|
957
1723
|
*/
|
|
958
|
-
async
|
|
959
|
-
{
|
|
1724
|
+
async getZones(
|
|
1725
|
+
{
|
|
1726
|
+
pageNo,
|
|
1727
|
+
pageSize,
|
|
1728
|
+
isActive,
|
|
1729
|
+
channelId,
|
|
1730
|
+
q,
|
|
1731
|
+
country,
|
|
1732
|
+
state,
|
|
1733
|
+
city,
|
|
1734
|
+
pincode,
|
|
1735
|
+
sector,
|
|
1736
|
+
requestHeaders,
|
|
1737
|
+
} = { requestHeaders: {} },
|
|
960
1738
|
{ responseHeaders } = { responseHeaders: false }
|
|
961
1739
|
) {
|
|
962
|
-
const {
|
|
963
|
-
error,
|
|
964
|
-
} = ServiceabilityPlatformValidator.getZoneDataView().validate(
|
|
1740
|
+
const { error } = ServiceabilityPlatformValidator.getZones().validate(
|
|
965
1741
|
{
|
|
966
|
-
|
|
1742
|
+
pageNo,
|
|
1743
|
+
pageSize,
|
|
1744
|
+
isActive,
|
|
1745
|
+
channelId,
|
|
1746
|
+
q,
|
|
1747
|
+
country,
|
|
1748
|
+
state,
|
|
1749
|
+
city,
|
|
1750
|
+
pincode,
|
|
1751
|
+
sector,
|
|
967
1752
|
},
|
|
968
1753
|
{ abortEarly: false, allowUnknown: true }
|
|
969
1754
|
);
|
|
@@ -974,27 +1759,46 @@ class Serviceability {
|
|
|
974
1759
|
// Showing warrnings if extra unknown parameters are found
|
|
975
1760
|
const {
|
|
976
1761
|
error: warrning,
|
|
977
|
-
} = ServiceabilityPlatformValidator.
|
|
1762
|
+
} = ServiceabilityPlatformValidator.getZones().validate(
|
|
978
1763
|
{
|
|
979
|
-
|
|
1764
|
+
pageNo,
|
|
1765
|
+
pageSize,
|
|
1766
|
+
isActive,
|
|
1767
|
+
channelId,
|
|
1768
|
+
q,
|
|
1769
|
+
country,
|
|
1770
|
+
state,
|
|
1771
|
+
city,
|
|
1772
|
+
pincode,
|
|
1773
|
+
sector,
|
|
980
1774
|
},
|
|
981
1775
|
{ abortEarly: false, allowUnknown: false }
|
|
982
1776
|
);
|
|
983
1777
|
if (warrning) {
|
|
984
1778
|
Logger({
|
|
985
1779
|
level: "WARN",
|
|
986
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
1780
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getZones \n ${warrning}`,
|
|
987
1781
|
});
|
|
988
1782
|
}
|
|
989
1783
|
|
|
990
1784
|
const query_params = {};
|
|
1785
|
+
query_params["page_no"] = pageNo;
|
|
1786
|
+
query_params["page_size"] = pageSize;
|
|
1787
|
+
query_params["is_active"] = isActive;
|
|
1788
|
+
query_params["channel_id"] = channelId;
|
|
1789
|
+
query_params["q"] = q;
|
|
1790
|
+
query_params["country"] = country;
|
|
1791
|
+
query_params["state"] = state;
|
|
1792
|
+
query_params["city"] = city;
|
|
1793
|
+
query_params["pincode"] = pincode;
|
|
1794
|
+
query_params["sector"] = sector;
|
|
991
1795
|
|
|
992
1796
|
const xHeaders = {};
|
|
993
1797
|
|
|
994
1798
|
const response = await PlatformAPIClient.execute(
|
|
995
1799
|
this.config,
|
|
996
1800
|
"get",
|
|
997
|
-
`/service/platform/logistics/
|
|
1801
|
+
`/service/platform/logistics/v2.0/company/${this.config.companyId}/zones`,
|
|
998
1802
|
query_params,
|
|
999
1803
|
undefined,
|
|
1000
1804
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -1008,10 +1812,10 @@ class Serviceability {
|
|
|
1008
1812
|
|
|
1009
1813
|
const {
|
|
1010
1814
|
error: res_error,
|
|
1011
|
-
} = ServiceabilityPlatformModel.
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
);
|
|
1815
|
+
} = ServiceabilityPlatformModel.ListViewResponse().validate(responseData, {
|
|
1816
|
+
abortEarly: false,
|
|
1817
|
+
allowUnknown: true,
|
|
1818
|
+
});
|
|
1015
1819
|
|
|
1016
1820
|
if (res_error) {
|
|
1017
1821
|
if (this.config.options.strictResponseCheck === true) {
|
|
@@ -1019,7 +1823,7 @@ class Serviceability {
|
|
|
1019
1823
|
} else {
|
|
1020
1824
|
Logger({
|
|
1021
1825
|
level: "WARN",
|
|
1022
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
1826
|
+
message: `Response Validation Warnings for platform > Serviceability > getZones \n ${res_error}`,
|
|
1023
1827
|
});
|
|
1024
1828
|
}
|
|
1025
1829
|
}
|
|
@@ -1028,40 +1832,25 @@ class Serviceability {
|
|
|
1028
1832
|
}
|
|
1029
1833
|
|
|
1030
1834
|
/**
|
|
1031
|
-
* @param {ServiceabilityPlatformValidator.
|
|
1835
|
+
* @param {ServiceabilityPlatformValidator.UpdateCompanyConfigurationParam} arg
|
|
1836
|
+
* - Arg object
|
|
1837
|
+
*
|
|
1032
1838
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1033
1839
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1034
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
1035
|
-
* @name
|
|
1036
|
-
* @summary:
|
|
1037
|
-
* @description:
|
|
1840
|
+
* @returns {Promise<ServiceabilityPlatformModel.CompanyConfig>} - Success response
|
|
1841
|
+
* @name updateCompanyConfiguration
|
|
1842
|
+
* @summary: Apply Courier Rule to company.
|
|
1843
|
+
* @description: Apply Courier Rule to company with rules priority - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/updateCompanyConfiguration/).
|
|
1038
1844
|
*/
|
|
1039
|
-
async
|
|
1040
|
-
{
|
|
1041
|
-
pageNumber,
|
|
1042
|
-
pageNo,
|
|
1043
|
-
pageSize,
|
|
1044
|
-
name,
|
|
1045
|
-
isActive,
|
|
1046
|
-
channelIds,
|
|
1047
|
-
q,
|
|
1048
|
-
zoneId,
|
|
1049
|
-
requestHeaders,
|
|
1050
|
-
} = { requestHeaders: {} },
|
|
1845
|
+
async updateCompanyConfiguration(
|
|
1846
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
1051
1847
|
{ responseHeaders } = { responseHeaders: false }
|
|
1052
1848
|
) {
|
|
1053
1849
|
const {
|
|
1054
1850
|
error,
|
|
1055
|
-
} = ServiceabilityPlatformValidator.
|
|
1851
|
+
} = ServiceabilityPlatformValidator.updateCompanyConfiguration().validate(
|
|
1056
1852
|
{
|
|
1057
|
-
|
|
1058
|
-
pageNo,
|
|
1059
|
-
pageSize,
|
|
1060
|
-
name,
|
|
1061
|
-
isActive,
|
|
1062
|
-
channelIds,
|
|
1063
|
-
q,
|
|
1064
|
-
zoneId,
|
|
1853
|
+
body,
|
|
1065
1854
|
},
|
|
1066
1855
|
{ abortEarly: false, allowUnknown: true }
|
|
1067
1856
|
);
|
|
@@ -1072,44 +1861,29 @@ class Serviceability {
|
|
|
1072
1861
|
// Showing warrnings if extra unknown parameters are found
|
|
1073
1862
|
const {
|
|
1074
1863
|
error: warrning,
|
|
1075
|
-
} = ServiceabilityPlatformValidator.
|
|
1864
|
+
} = ServiceabilityPlatformValidator.updateCompanyConfiguration().validate(
|
|
1076
1865
|
{
|
|
1077
|
-
|
|
1078
|
-
pageNo,
|
|
1079
|
-
pageSize,
|
|
1080
|
-
name,
|
|
1081
|
-
isActive,
|
|
1082
|
-
channelIds,
|
|
1083
|
-
q,
|
|
1084
|
-
zoneId,
|
|
1866
|
+
body,
|
|
1085
1867
|
},
|
|
1086
1868
|
{ abortEarly: false, allowUnknown: false }
|
|
1087
1869
|
);
|
|
1088
1870
|
if (warrning) {
|
|
1089
1871
|
Logger({
|
|
1090
1872
|
level: "WARN",
|
|
1091
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
1873
|
+
message: `Parameter Validation warrnings for platform > Serviceability > updateCompanyConfiguration \n ${warrning}`,
|
|
1092
1874
|
});
|
|
1093
1875
|
}
|
|
1094
1876
|
|
|
1095
1877
|
const query_params = {};
|
|
1096
|
-
query_params["page_number"] = pageNumber;
|
|
1097
|
-
query_params["page_no"] = pageNo;
|
|
1098
|
-
query_params["page_size"] = pageSize;
|
|
1099
|
-
query_params["name"] = name;
|
|
1100
|
-
query_params["is_active"] = isActive;
|
|
1101
|
-
query_params["channel_ids"] = channelIds;
|
|
1102
|
-
query_params["q"] = q;
|
|
1103
|
-
query_params["zone_id"] = zoneId;
|
|
1104
1878
|
|
|
1105
1879
|
const xHeaders = {};
|
|
1106
1880
|
|
|
1107
1881
|
const response = await PlatformAPIClient.execute(
|
|
1108
1882
|
this.config,
|
|
1109
|
-
"
|
|
1110
|
-
`/service/platform/logistics/v1.0/company/${this.config.companyId}/
|
|
1883
|
+
"put",
|
|
1884
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/configuration`,
|
|
1111
1885
|
query_params,
|
|
1112
|
-
|
|
1886
|
+
body,
|
|
1113
1887
|
{ ...xHeaders, ...requestHeaders },
|
|
1114
1888
|
{ responseHeaders }
|
|
1115
1889
|
);
|
|
@@ -1121,7 +1895,7 @@ class Serviceability {
|
|
|
1121
1895
|
|
|
1122
1896
|
const {
|
|
1123
1897
|
error: res_error,
|
|
1124
|
-
} = ServiceabilityPlatformModel.
|
|
1898
|
+
} = ServiceabilityPlatformModel.CompanyConfig().validate(responseData, {
|
|
1125
1899
|
abortEarly: false,
|
|
1126
1900
|
allowUnknown: true,
|
|
1127
1901
|
});
|
|
@@ -1132,7 +1906,7 @@ class Serviceability {
|
|
|
1132
1906
|
} else {
|
|
1133
1907
|
Logger({
|
|
1134
1908
|
level: "WARN",
|
|
1135
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
1909
|
+
message: `Response Validation Warnings for platform > Serviceability > updateCompanyConfiguration \n ${res_error}`,
|
|
1136
1910
|
});
|
|
1137
1911
|
}
|
|
1138
1912
|
}
|
|
@@ -1141,23 +1915,26 @@ class Serviceability {
|
|
|
1141
1915
|
}
|
|
1142
1916
|
|
|
1143
1917
|
/**
|
|
1144
|
-
* @param {ServiceabilityPlatformValidator.
|
|
1918
|
+
* @param {ServiceabilityPlatformValidator.UpdateCourierPartnerAccountParam} arg
|
|
1919
|
+
* - Arg object
|
|
1920
|
+
*
|
|
1145
1921
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1146
1922
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1147
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
1148
|
-
*
|
|
1149
|
-
*
|
|
1150
|
-
* @
|
|
1151
|
-
* @
|
|
1152
|
-
* @description: This API updates and returns response of DpRules from mongo database. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/updateDpRule/).
|
|
1923
|
+
* @returns {Promise<ServiceabilityPlatformModel.CourierAccountResponse>} -
|
|
1924
|
+
* Success response
|
|
1925
|
+
* @name updateCourierPartnerAccount
|
|
1926
|
+
* @summary: Update Courier Account in database.
|
|
1927
|
+
* @description: Updates Courier Account - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/updateCourierPartnerAccount/).
|
|
1153
1928
|
*/
|
|
1154
|
-
async
|
|
1155
|
-
{
|
|
1929
|
+
async updateCourierPartnerAccount(
|
|
1930
|
+
{ accountId, body, requestHeaders } = { requestHeaders: {} },
|
|
1156
1931
|
{ responseHeaders } = { responseHeaders: false }
|
|
1157
1932
|
) {
|
|
1158
|
-
const {
|
|
1933
|
+
const {
|
|
1934
|
+
error,
|
|
1935
|
+
} = ServiceabilityPlatformValidator.updateCourierPartnerAccount().validate(
|
|
1159
1936
|
{
|
|
1160
|
-
|
|
1937
|
+
accountId,
|
|
1161
1938
|
body,
|
|
1162
1939
|
},
|
|
1163
1940
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -1169,9 +1946,9 @@ class Serviceability {
|
|
|
1169
1946
|
// Showing warrnings if extra unknown parameters are found
|
|
1170
1947
|
const {
|
|
1171
1948
|
error: warrning,
|
|
1172
|
-
} = ServiceabilityPlatformValidator.
|
|
1949
|
+
} = ServiceabilityPlatformValidator.updateCourierPartnerAccount().validate(
|
|
1173
1950
|
{
|
|
1174
|
-
|
|
1951
|
+
accountId,
|
|
1175
1952
|
body,
|
|
1176
1953
|
},
|
|
1177
1954
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -1179,7 +1956,7 @@ class Serviceability {
|
|
|
1179
1956
|
if (warrning) {
|
|
1180
1957
|
Logger({
|
|
1181
1958
|
level: "WARN",
|
|
1182
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
1959
|
+
message: `Parameter Validation warrnings for platform > Serviceability > updateCourierPartnerAccount \n ${warrning}`,
|
|
1183
1960
|
});
|
|
1184
1961
|
}
|
|
1185
1962
|
|
|
@@ -1190,7 +1967,7 @@ class Serviceability {
|
|
|
1190
1967
|
const response = await PlatformAPIClient.execute(
|
|
1191
1968
|
this.config,
|
|
1192
1969
|
"put",
|
|
1193
|
-
`/service/platform/logistics/v1.0/company/${this.config.companyId}/courier/
|
|
1970
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/courier-partner/account/${accountId}`,
|
|
1194
1971
|
query_params,
|
|
1195
1972
|
body,
|
|
1196
1973
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -1204,7 +1981,7 @@ class Serviceability {
|
|
|
1204
1981
|
|
|
1205
1982
|
const {
|
|
1206
1983
|
error: res_error,
|
|
1207
|
-
} = ServiceabilityPlatformModel.
|
|
1984
|
+
} = ServiceabilityPlatformModel.CourierAccountResponse().validate(
|
|
1208
1985
|
responseData,
|
|
1209
1986
|
{ abortEarly: false, allowUnknown: true }
|
|
1210
1987
|
);
|
|
@@ -1215,7 +1992,7 @@ class Serviceability {
|
|
|
1215
1992
|
} else {
|
|
1216
1993
|
Logger({
|
|
1217
1994
|
level: "WARN",
|
|
1218
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
1995
|
+
message: `Response Validation Warnings for platform > Serviceability > updateCourierPartnerAccount \n ${res_error}`,
|
|
1219
1996
|
});
|
|
1220
1997
|
}
|
|
1221
1998
|
}
|
|
@@ -1224,27 +2001,26 @@ class Serviceability {
|
|
|
1224
2001
|
}
|
|
1225
2002
|
|
|
1226
2003
|
/**
|
|
1227
|
-
* @param {ServiceabilityPlatformValidator.
|
|
2004
|
+
* @param {ServiceabilityPlatformValidator.UpdatePackageMaterialRuleParam} arg
|
|
1228
2005
|
* - Arg object
|
|
1229
2006
|
*
|
|
1230
2007
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1231
2008
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1232
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
2009
|
+
* @returns {Promise<ServiceabilityPlatformModel.PackageRuleResponse>} -
|
|
1233
2010
|
* Success response
|
|
1234
|
-
* @name
|
|
1235
|
-
* @summary:
|
|
1236
|
-
* @description: This API
|
|
2011
|
+
* @name updatePackageMaterialRule
|
|
2012
|
+
* @summary: Fetching of Package Material Rules into database.
|
|
2013
|
+
* @description: This API updates Package Material Rules into mongo database. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/updatePackageMaterialRule/).
|
|
1237
2014
|
*/
|
|
1238
|
-
async
|
|
1239
|
-
{
|
|
2015
|
+
async updatePackageMaterialRule(
|
|
2016
|
+
{ ruleId, body, requestHeaders } = { requestHeaders: {} },
|
|
1240
2017
|
{ responseHeaders } = { responseHeaders: false }
|
|
1241
2018
|
) {
|
|
1242
2019
|
const {
|
|
1243
2020
|
error,
|
|
1244
|
-
} = ServiceabilityPlatformValidator.
|
|
2021
|
+
} = ServiceabilityPlatformValidator.updatePackageMaterialRule().validate(
|
|
1245
2022
|
{
|
|
1246
|
-
|
|
1247
|
-
|
|
2023
|
+
ruleId,
|
|
1248
2024
|
body,
|
|
1249
2025
|
},
|
|
1250
2026
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -1256,10 +2032,9 @@ class Serviceability {
|
|
|
1256
2032
|
// Showing warrnings if extra unknown parameters are found
|
|
1257
2033
|
const {
|
|
1258
2034
|
error: warrning,
|
|
1259
|
-
} = ServiceabilityPlatformValidator.
|
|
2035
|
+
} = ServiceabilityPlatformValidator.updatePackageMaterialRule().validate(
|
|
1260
2036
|
{
|
|
1261
|
-
|
|
1262
|
-
|
|
2037
|
+
ruleId,
|
|
1263
2038
|
body,
|
|
1264
2039
|
},
|
|
1265
2040
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -1267,7 +2042,7 @@ class Serviceability {
|
|
|
1267
2042
|
if (warrning) {
|
|
1268
2043
|
Logger({
|
|
1269
2044
|
level: "WARN",
|
|
1270
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
2045
|
+
message: `Parameter Validation warrnings for platform > Serviceability > updatePackageMaterialRule \n ${warrning}`,
|
|
1271
2046
|
});
|
|
1272
2047
|
}
|
|
1273
2048
|
|
|
@@ -1277,8 +2052,8 @@ class Serviceability {
|
|
|
1277
2052
|
|
|
1278
2053
|
const response = await PlatformAPIClient.execute(
|
|
1279
2054
|
this.config,
|
|
1280
|
-
"
|
|
1281
|
-
`/service/platform/logistics/v1.0/company/${this.config.companyId}/
|
|
2055
|
+
"patch",
|
|
2056
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/packaging-material/rules/${ruleId}`,
|
|
1282
2057
|
query_params,
|
|
1283
2058
|
body,
|
|
1284
2059
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -1292,7 +2067,7 @@ class Serviceability {
|
|
|
1292
2067
|
|
|
1293
2068
|
const {
|
|
1294
2069
|
error: res_error,
|
|
1295
|
-
} = ServiceabilityPlatformModel.
|
|
2070
|
+
} = ServiceabilityPlatformModel.PackageRuleResponse().validate(
|
|
1296
2071
|
responseData,
|
|
1297
2072
|
{ abortEarly: false, allowUnknown: true }
|
|
1298
2073
|
);
|
|
@@ -1303,7 +2078,7 @@ class Serviceability {
|
|
|
1303
2078
|
} else {
|
|
1304
2079
|
Logger({
|
|
1305
2080
|
level: "WARN",
|
|
1306
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
2081
|
+
message: `Response Validation Warnings for platform > Serviceability > updatePackageMaterialRule \n ${res_error}`,
|
|
1307
2082
|
});
|
|
1308
2083
|
}
|
|
1309
2084
|
}
|
|
@@ -1312,24 +2087,27 @@ class Serviceability {
|
|
|
1312
2087
|
}
|
|
1313
2088
|
|
|
1314
2089
|
/**
|
|
1315
|
-
* @param {ServiceabilityPlatformValidator.
|
|
2090
|
+
* @param {ServiceabilityPlatformValidator.UpdatePackageMaterialsParam} arg
|
|
2091
|
+
* - Arg object
|
|
2092
|
+
*
|
|
1316
2093
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1317
2094
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1318
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
2095
|
+
* @returns {Promise<ServiceabilityPlatformModel.PackageMaterialResponse>}
|
|
1319
2096
|
* - Success response
|
|
1320
2097
|
*
|
|
1321
|
-
* @name
|
|
1322
|
-
* @summary:
|
|
1323
|
-
* @description: This API
|
|
2098
|
+
* @name updatePackageMaterials
|
|
2099
|
+
* @summary: Update Package Material to database.
|
|
2100
|
+
* @description: This API updates Package Materials from into mongo database. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/updatePackageMaterials/).
|
|
1324
2101
|
*/
|
|
1325
|
-
async
|
|
1326
|
-
{ body, requestHeaders } = { requestHeaders: {} },
|
|
2102
|
+
async updatePackageMaterials(
|
|
2103
|
+
{ packageMaterialId, body, requestHeaders } = { requestHeaders: {} },
|
|
1327
2104
|
{ responseHeaders } = { responseHeaders: false }
|
|
1328
2105
|
) {
|
|
1329
2106
|
const {
|
|
1330
2107
|
error,
|
|
1331
|
-
} = ServiceabilityPlatformValidator.
|
|
2108
|
+
} = ServiceabilityPlatformValidator.updatePackageMaterials().validate(
|
|
1332
2109
|
{
|
|
2110
|
+
packageMaterialId,
|
|
1333
2111
|
body,
|
|
1334
2112
|
},
|
|
1335
2113
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -1341,8 +2119,9 @@ class Serviceability {
|
|
|
1341
2119
|
// Showing warrnings if extra unknown parameters are found
|
|
1342
2120
|
const {
|
|
1343
2121
|
error: warrning,
|
|
1344
|
-
} = ServiceabilityPlatformValidator.
|
|
2122
|
+
} = ServiceabilityPlatformValidator.updatePackageMaterials().validate(
|
|
1345
2123
|
{
|
|
2124
|
+
packageMaterialId,
|
|
1346
2125
|
body,
|
|
1347
2126
|
},
|
|
1348
2127
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -1350,7 +2129,7 @@ class Serviceability {
|
|
|
1350
2129
|
if (warrning) {
|
|
1351
2130
|
Logger({
|
|
1352
2131
|
level: "WARN",
|
|
1353
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
2132
|
+
message: `Parameter Validation warrnings for platform > Serviceability > updatePackageMaterials \n ${warrning}`,
|
|
1354
2133
|
});
|
|
1355
2134
|
}
|
|
1356
2135
|
|
|
@@ -1360,8 +2139,8 @@ class Serviceability {
|
|
|
1360
2139
|
|
|
1361
2140
|
const response = await PlatformAPIClient.execute(
|
|
1362
2141
|
this.config,
|
|
1363
|
-
"
|
|
1364
|
-
`/service/platform/logistics/v1.0/company/${this.config.companyId}/
|
|
2142
|
+
"patch",
|
|
2143
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/packaging-material/${packageMaterialId}`,
|
|
1365
2144
|
query_params,
|
|
1366
2145
|
body,
|
|
1367
2146
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -1375,7 +2154,7 @@ class Serviceability {
|
|
|
1375
2154
|
|
|
1376
2155
|
const {
|
|
1377
2156
|
error: res_error,
|
|
1378
|
-
} = ServiceabilityPlatformModel.
|
|
2157
|
+
} = ServiceabilityPlatformModel.PackageMaterialResponse().validate(
|
|
1379
2158
|
responseData,
|
|
1380
2159
|
{ abortEarly: false, allowUnknown: true }
|
|
1381
2160
|
);
|
|
@@ -1386,7 +2165,7 @@ class Serviceability {
|
|
|
1386
2165
|
} else {
|
|
1387
2166
|
Logger({
|
|
1388
2167
|
level: "WARN",
|
|
1389
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
2168
|
+
message: `Response Validation Warnings for platform > Serviceability > updatePackageMaterials \n ${res_error}`,
|
|
1390
2169
|
});
|
|
1391
2170
|
}
|
|
1392
2171
|
}
|
|
@@ -1395,23 +2174,28 @@ class Serviceability {
|
|
|
1395
2174
|
}
|
|
1396
2175
|
|
|
1397
2176
|
/**
|
|
1398
|
-
* @param {ServiceabilityPlatformValidator.
|
|
2177
|
+
* @param {ServiceabilityPlatformValidator.UpdateServiceabilityParam} arg - Arg object
|
|
1399
2178
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1400
2179
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1401
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
2180
|
+
* @returns {Promise<ServiceabilityPlatformModel.ServiceabilityModel>} -
|
|
1402
2181
|
* Success response
|
|
1403
|
-
* @name
|
|
1404
|
-
* @summary:
|
|
1405
|
-
* @description:
|
|
2182
|
+
* @name updateServiceability
|
|
2183
|
+
* @summary: Serviceability Update for a region
|
|
2184
|
+
* @description: Serviceability Update for a region - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/updateServiceability/).
|
|
1406
2185
|
*/
|
|
1407
|
-
async
|
|
1408
|
-
{ body, requestHeaders } = {
|
|
2186
|
+
async updateServiceability(
|
|
2187
|
+
{ extensionId, schemeId, regionId, body, requestHeaders } = {
|
|
2188
|
+
requestHeaders: {},
|
|
2189
|
+
},
|
|
1409
2190
|
{ responseHeaders } = { responseHeaders: false }
|
|
1410
2191
|
) {
|
|
1411
2192
|
const {
|
|
1412
2193
|
error,
|
|
1413
|
-
} = ServiceabilityPlatformValidator.
|
|
2194
|
+
} = ServiceabilityPlatformValidator.updateServiceability().validate(
|
|
1414
2195
|
{
|
|
2196
|
+
extensionId,
|
|
2197
|
+
schemeId,
|
|
2198
|
+
regionId,
|
|
1415
2199
|
body,
|
|
1416
2200
|
},
|
|
1417
2201
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -1423,8 +2207,11 @@ class Serviceability {
|
|
|
1423
2207
|
// Showing warrnings if extra unknown parameters are found
|
|
1424
2208
|
const {
|
|
1425
2209
|
error: warrning,
|
|
1426
|
-
} = ServiceabilityPlatformValidator.
|
|
2210
|
+
} = ServiceabilityPlatformValidator.updateServiceability().validate(
|
|
1427
2211
|
{
|
|
2212
|
+
extensionId,
|
|
2213
|
+
schemeId,
|
|
2214
|
+
regionId,
|
|
1428
2215
|
body,
|
|
1429
2216
|
},
|
|
1430
2217
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -1432,7 +2219,7 @@ class Serviceability {
|
|
|
1432
2219
|
if (warrning) {
|
|
1433
2220
|
Logger({
|
|
1434
2221
|
level: "WARN",
|
|
1435
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
2222
|
+
message: `Parameter Validation warrnings for platform > Serviceability > updateServiceability \n ${warrning}`,
|
|
1436
2223
|
});
|
|
1437
2224
|
}
|
|
1438
2225
|
|
|
@@ -1443,7 +2230,7 @@ class Serviceability {
|
|
|
1443
2230
|
const response = await PlatformAPIClient.execute(
|
|
1444
2231
|
this.config,
|
|
1445
2232
|
"put",
|
|
1446
|
-
`/service/platform/logistics/v1.0/company/${this.config.companyId}/courier/
|
|
2233
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/courier-partner/${extensionId}/scheme/${schemeId}/serviceability/region/${regionId}`,
|
|
1447
2234
|
query_params,
|
|
1448
2235
|
body,
|
|
1449
2236
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -1457,7 +2244,7 @@ class Serviceability {
|
|
|
1457
2244
|
|
|
1458
2245
|
const {
|
|
1459
2246
|
error: res_error,
|
|
1460
|
-
} = ServiceabilityPlatformModel.
|
|
2247
|
+
} = ServiceabilityPlatformModel.ServiceabilityModel().validate(
|
|
1461
2248
|
responseData,
|
|
1462
2249
|
{ abortEarly: false, allowUnknown: true }
|
|
1463
2250
|
);
|
|
@@ -1468,7 +2255,7 @@ class Serviceability {
|
|
|
1468
2255
|
} else {
|
|
1469
2256
|
Logger({
|
|
1470
2257
|
level: "WARN",
|
|
1471
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
2258
|
+
message: `Response Validation Warnings for platform > Serviceability > updateServiceability \n ${res_error}`,
|
|
1472
2259
|
});
|
|
1473
2260
|
}
|
|
1474
2261
|
}
|
|
@@ -1477,21 +2264,22 @@ class Serviceability {
|
|
|
1477
2264
|
}
|
|
1478
2265
|
|
|
1479
2266
|
/**
|
|
1480
|
-
* @param {ServiceabilityPlatformValidator.
|
|
2267
|
+
* @param {ServiceabilityPlatformValidator.UpdateZoneByIdParam} arg - Arg object
|
|
1481
2268
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1482
2269
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1483
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
2270
|
+
* @returns {Promise<ServiceabilityPlatformModel.ZoneSuccessResponse>} -
|
|
1484
2271
|
* Success response
|
|
1485
|
-
* @name
|
|
1486
|
-
* @summary:
|
|
1487
|
-
* @description:
|
|
2272
|
+
* @name updateZoneById
|
|
2273
|
+
* @summary: Update details of a Zone
|
|
2274
|
+
* @description: Updates the region, application, store mapping and other details in the Zone. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/updateZoneById/).
|
|
1488
2275
|
*/
|
|
1489
|
-
async
|
|
1490
|
-
{ body, requestHeaders } = { requestHeaders: {} },
|
|
2276
|
+
async updateZoneById(
|
|
2277
|
+
{ zoneId, body, requestHeaders } = { requestHeaders: {} },
|
|
1491
2278
|
{ responseHeaders } = { responseHeaders: false }
|
|
1492
2279
|
) {
|
|
1493
|
-
const { error } = ServiceabilityPlatformValidator.
|
|
2280
|
+
const { error } = ServiceabilityPlatformValidator.updateZoneById().validate(
|
|
1494
2281
|
{
|
|
2282
|
+
zoneId,
|
|
1495
2283
|
body,
|
|
1496
2284
|
},
|
|
1497
2285
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -1503,8 +2291,9 @@ class Serviceability {
|
|
|
1503
2291
|
// Showing warrnings if extra unknown parameters are found
|
|
1504
2292
|
const {
|
|
1505
2293
|
error: warrning,
|
|
1506
|
-
} = ServiceabilityPlatformValidator.
|
|
2294
|
+
} = ServiceabilityPlatformValidator.updateZoneById().validate(
|
|
1507
2295
|
{
|
|
2296
|
+
zoneId,
|
|
1508
2297
|
body,
|
|
1509
2298
|
},
|
|
1510
2299
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -1512,7 +2301,7 @@ class Serviceability {
|
|
|
1512
2301
|
if (warrning) {
|
|
1513
2302
|
Logger({
|
|
1514
2303
|
level: "WARN",
|
|
1515
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
2304
|
+
message: `Parameter Validation warrnings for platform > Serviceability > updateZoneById \n ${warrning}`,
|
|
1516
2305
|
});
|
|
1517
2306
|
}
|
|
1518
2307
|
|
|
@@ -1522,8 +2311,8 @@ class Serviceability {
|
|
|
1522
2311
|
|
|
1523
2312
|
const response = await PlatformAPIClient.execute(
|
|
1524
2313
|
this.config,
|
|
1525
|
-
"
|
|
1526
|
-
`/service/platform/logistics/
|
|
2314
|
+
"put",
|
|
2315
|
+
`/service/platform/logistics/v2.0/company/${this.config.companyId}/zones/${zoneId}`,
|
|
1527
2316
|
query_params,
|
|
1528
2317
|
body,
|
|
1529
2318
|
{ ...xHeaders, ...requestHeaders },
|
|
@@ -1537,7 +2326,7 @@ class Serviceability {
|
|
|
1537
2326
|
|
|
1538
2327
|
const {
|
|
1539
2328
|
error: res_error,
|
|
1540
|
-
} = ServiceabilityPlatformModel.
|
|
2329
|
+
} = ServiceabilityPlatformModel.ZoneSuccessResponse().validate(
|
|
1541
2330
|
responseData,
|
|
1542
2331
|
{ abortEarly: false, allowUnknown: true }
|
|
1543
2332
|
);
|
|
@@ -1548,7 +2337,7 @@ class Serviceability {
|
|
|
1548
2337
|
} else {
|
|
1549
2338
|
Logger({
|
|
1550
2339
|
level: "WARN",
|
|
1551
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
2340
|
+
message: `Response Validation Warnings for platform > Serviceability > updateZoneById \n ${res_error}`,
|
|
1552
2341
|
});
|
|
1553
2342
|
}
|
|
1554
2343
|
}
|