@gofynd/fdk-client-javascript 1.6.4 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/sdk/application/Cart/CartApplicationClient.d.ts +5 -5
- package/sdk/application/Cart/CartApplicationClient.js +26 -268
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +20 -20
- package/sdk/application/Catalog/CatalogApplicationClient.js +98 -347
- package/sdk/application/Common/CommonApplicationClient.js +1 -16
- package/sdk/application/Communication/CommunicationApplicationClient.js +1 -24
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +24 -2
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +58 -137
- package/sdk/application/Content/ContentApplicationClient.d.ts +47 -7
- package/sdk/application/Content/ContentApplicationClient.js +222 -191
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +2 -2
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +11 -30
- package/sdk/application/Finance/FinanceApplicationClient.js +1 -16
- package/sdk/application/Lead/LeadApplicationClient.d.ts +4 -4
- package/sdk/application/Lead/LeadApplicationClient.js +21 -52
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +16 -56
- package/sdk/application/Logistic/LogisticApplicationClient.js +57 -332
- package/sdk/application/Order/OrderApplicationClient.d.ts +11 -11
- package/sdk/application/Order/OrderApplicationClient.js +68 -153
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +2 -12
- package/sdk/application/Payment/PaymentApplicationClient.js +7 -487
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +1 -1
- package/sdk/application/Rewards/RewardsApplicationClient.js +6 -59
- package/sdk/application/Share/ShareApplicationClient.d.ts +4 -4
- package/sdk/application/Share/ShareApplicationClient.js +21 -75
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +3 -3
- package/sdk/application/Theme/ThemeApplicationClient.js +19 -47
- package/sdk/application/User/UserApplicationClient.js +1 -407
- package/sdk/application/Webhook/WebhookApplicationClient.js +1 -8
- package/sdk/common/Utility.d.ts +1 -1
- package/sdk/common/Utility.js +10 -7
- package/sdk/common/Validator.d.ts +1 -0
- package/sdk/common/Validator.js +20 -0
- package/sdk/common/utils.d.ts +0 -1
- package/sdk/common/utils.js +0 -14
- package/sdk/partner/FileStorage/FileStoragePartnerClient.d.ts +1 -55
- package/sdk/partner/FileStorage/FileStoragePartnerClient.js +1 -408
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.d.ts +0 -5
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.js +0 -37
- package/sdk/partner/Lead/LeadPartnerModel.d.ts +5 -0
- package/sdk/partner/Lead/LeadPartnerModel.js +2 -0
- package/sdk/partner/Logistics/LogisticsPartnerClient.d.ts +29 -25
- package/sdk/partner/Logistics/LogisticsPartnerClient.js +65 -42
- package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +1008 -794
- package/sdk/partner/Logistics/LogisticsPartnerModel.js +573 -460
- package/sdk/partner/Logistics/LogisticsPartnerValidator.js +10 -5
- package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +5 -0
- package/sdk/partner/Webhook/WebhookPartnerModel.js +2 -0
- package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +5 -0
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +2 -0
- package/sdk/platform/Cart/CartPlatformModel.d.ts +67 -9
- package/sdk/platform/Cart/CartPlatformModel.js +38 -5
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1 -1
- package/sdk/platform/Catalog/CatalogPlatformClient.js +4 -4
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +47 -13
- package/sdk/platform/Catalog/CatalogPlatformModel.js +29 -7
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +2 -2
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +7 -4
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +71 -7
- package/sdk/platform/Communication/CommunicationPlatformModel.js +70 -6
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +0 -27
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +8 -60
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +31 -20
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +18 -18
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +1 -1
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +3 -3
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +13 -0
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +30 -1
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +68 -11
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +49 -7
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +169 -0
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +1279 -132
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +156 -1
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +180 -0
- package/sdk/platform/Content/ContentPlatformClient.d.ts +162 -0
- package/sdk/platform/Content/ContentPlatformClient.js +1697 -497
- package/sdk/platform/Content/ContentPlatformModel.d.ts +1053 -35
- package/sdk/platform/Content/ContentPlatformModel.js +717 -34
- package/sdk/platform/Content/ContentPlatformValidator.d.ts +127 -1
- package/sdk/platform/Content/ContentPlatformValidator.js +171 -0
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +34 -0
- package/sdk/platform/Discount/DiscountPlatformClient.js +59 -0
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +365 -93
- package/sdk/platform/Discount/DiscountPlatformModel.js +98 -93
- package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +54 -34
- package/sdk/platform/Discount/DiscountPlatformValidator.js +27 -17
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +0 -156
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +0 -1072
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +1 -137
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +0 -173
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +1 -1105
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +0 -1125
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +5 -0
- package/sdk/platform/Lead/LeadPlatformModel.js +2 -0
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +0 -10
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +0 -92
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -28
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +0 -18
- package/sdk/platform/Order/OrderPlatformClient.d.ts +212 -0
- package/sdk/platform/Order/OrderPlatformClient.js +397 -0
- package/sdk/platform/Order/OrderPlatformModel.d.ts +41 -9
- package/sdk/platform/Order/OrderPlatformModel.js +20 -7
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +33 -1
- package/sdk/platform/Order/OrderPlatformValidator.js +20 -0
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +58 -10
- package/sdk/platform/Partner/PartnerPlatformModel.js +19 -10
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +12 -2
- package/sdk/platform/Payment/PaymentPlatformModel.js +8 -2
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +5 -0
- package/sdk/platform/Rewards/RewardsPlatformModel.js +2 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +240 -24
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +1753 -277
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +320 -22
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +269 -19
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +53 -104
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +201 -629
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +5720 -2891
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +3414 -2181
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +138 -216
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +81 -148
- package/sdk/platform/Share/SharePlatformModel.d.ts +5 -0
- package/sdk/platform/Share/SharePlatformModel.js +2 -0
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +10 -0
- package/sdk/platform/User/UserPlatformApplicationClient.js +79 -0
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +13 -1
- package/sdk/platform/User/UserPlatformApplicationValidator.js +12 -0
- package/sdk/platform/User/UserPlatformModel.d.ts +52 -1
- package/sdk/platform/User/UserPlatformModel.js +36 -0
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +5 -0
- package/sdk/platform/Webhook/WebhookPlatformModel.js +2 -0
- package/sdk/public/Catalog/CatalogPublicClient.d.ts +1 -1
- package/sdk/public/Catalog/CatalogPublicClient.js +6 -11
- package/sdk/public/Configuration/ConfigurationPublicClient.js +1 -16
- package/sdk/public/Content/ContentPublicClient.d.ts +36 -3
- package/sdk/public/Content/ContentPublicClient.js +261 -104
- package/sdk/public/Content/ContentPublicModel.d.ts +155 -1
- package/sdk/public/Content/ContentPublicModel.js +102 -0
- package/sdk/public/Content/ContentPublicValidator.d.ts +18 -1
- package/sdk/public/Content/ContentPublicValidator.js +26 -0
- package/sdk/public/Partner/PartnerPublicClient.d.ts +1 -1
- package/sdk/public/Partner/PartnerPublicClient.js +6 -11
- package/sdk/public/Partner/PartnerPublicModel.d.ts +248 -72
- package/sdk/public/Partner/PartnerPublicModel.js +81 -71
- package/sdk/public/Partner/PartnerPublicValidator.d.ts +2 -2
- package/sdk/public/Partner/PartnerPublicValidator.js +1 -1
- package/sdk/public/Webhook/WebhookPublicClient.js +1 -40
|
@@ -16,25 +16,23 @@ class Serviceability {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
* @param {ServiceabilityPlatformApplicationValidator.
|
|
19
|
+
* @param {ServiceabilityPlatformApplicationValidator.CreateBulkExportParam} arg
|
|
20
20
|
* - Arg object
|
|
21
21
|
*
|
|
22
22
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
23
23
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
24
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* @
|
|
28
|
-
* @summary: Create courier rule
|
|
29
|
-
* @description: Creates a rule within the delivery configuration. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/createCourierPartnerRule/).
|
|
24
|
+
* @returns {Promise<ServiceabilityPlatformModel.ZoneBulkExport>} - Success response
|
|
25
|
+
* @name createBulkExport
|
|
26
|
+
* @summary: Create Bulk Export of Zones
|
|
27
|
+
* @description: Export zones defined at the application level. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/createBulkExport/).
|
|
30
28
|
*/
|
|
31
|
-
async
|
|
29
|
+
async createBulkExport(
|
|
32
30
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
33
31
|
{ responseHeaders } = { responseHeaders: false }
|
|
34
32
|
) {
|
|
35
33
|
const {
|
|
36
34
|
error,
|
|
37
|
-
} = ServiceabilityPlatformApplicationValidator.
|
|
35
|
+
} = ServiceabilityPlatformApplicationValidator.createBulkExport().validate(
|
|
38
36
|
{
|
|
39
37
|
body,
|
|
40
38
|
},
|
|
@@ -47,7 +45,7 @@ class Serviceability {
|
|
|
47
45
|
// Showing warrnings if extra unknown parameters are found
|
|
48
46
|
const {
|
|
49
47
|
error: warrning,
|
|
50
|
-
} = ServiceabilityPlatformApplicationValidator.
|
|
48
|
+
} = ServiceabilityPlatformApplicationValidator.createBulkExport().validate(
|
|
51
49
|
{
|
|
52
50
|
body,
|
|
53
51
|
},
|
|
@@ -56,7 +54,7 @@ class Serviceability {
|
|
|
56
54
|
if (warrning) {
|
|
57
55
|
Logger({
|
|
58
56
|
level: "WARN",
|
|
59
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
57
|
+
message: `Parameter Validation warrnings for platform > Serviceability > createBulkExport \n ${warrning}`,
|
|
60
58
|
});
|
|
61
59
|
}
|
|
62
60
|
|
|
@@ -65,7 +63,7 @@ class Serviceability {
|
|
|
65
63
|
const response = await PlatformAPIClient.execute(
|
|
66
64
|
this.config,
|
|
67
65
|
"post",
|
|
68
|
-
`/service/platform/logistics/
|
|
66
|
+
`/service/platform/logistics/v2.0/company/${this.config.companyId}/application/${this.applicationId}/zones/bulk/export`,
|
|
69
67
|
query_params,
|
|
70
68
|
body,
|
|
71
69
|
requestHeaders,
|
|
@@ -79,10 +77,10 @@ class Serviceability {
|
|
|
79
77
|
|
|
80
78
|
const {
|
|
81
79
|
error: res_error,
|
|
82
|
-
} = ServiceabilityPlatformModel.
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
);
|
|
80
|
+
} = ServiceabilityPlatformModel.ZoneBulkExport().validate(responseData, {
|
|
81
|
+
abortEarly: false,
|
|
82
|
+
allowUnknown: true,
|
|
83
|
+
});
|
|
86
84
|
|
|
87
85
|
if (res_error) {
|
|
88
86
|
if (this.config.options.strictResponseCheck === true) {
|
|
@@ -90,7 +88,7 @@ class Serviceability {
|
|
|
90
88
|
} else {
|
|
91
89
|
Logger({
|
|
92
90
|
level: "WARN",
|
|
93
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
91
|
+
message: `Response Validation Warnings for platform > Serviceability > createBulkExport \n ${res_error}`,
|
|
94
92
|
});
|
|
95
93
|
}
|
|
96
94
|
}
|
|
@@ -99,24 +97,24 @@ class Serviceability {
|
|
|
99
97
|
}
|
|
100
98
|
|
|
101
99
|
/**
|
|
102
|
-
* @param {ServiceabilityPlatformApplicationValidator.
|
|
100
|
+
* @param {ServiceabilityPlatformApplicationValidator.CreateBulkGeoAreaParam} arg
|
|
103
101
|
* - Arg object
|
|
104
102
|
*
|
|
105
103
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
106
104
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
107
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
105
|
+
* @returns {Promise<ServiceabilityPlatformModel.BulkGeoAreaResult>} -
|
|
108
106
|
* Success response
|
|
109
|
-
* @name
|
|
110
|
-
* @summary:
|
|
111
|
-
* @description:
|
|
107
|
+
* @name createBulkGeoArea
|
|
108
|
+
* @summary: Bulk Creation of GeoArea Regions
|
|
109
|
+
* @description: Allows to create and manage GeoAreas, representing groups of geographic regions in bulk. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/createBulkGeoArea/).
|
|
112
110
|
*/
|
|
113
|
-
async
|
|
111
|
+
async createBulkGeoArea(
|
|
114
112
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
115
113
|
{ responseHeaders } = { responseHeaders: false }
|
|
116
114
|
) {
|
|
117
115
|
const {
|
|
118
116
|
error,
|
|
119
|
-
} = ServiceabilityPlatformApplicationValidator.
|
|
117
|
+
} = ServiceabilityPlatformApplicationValidator.createBulkGeoArea().validate(
|
|
120
118
|
{
|
|
121
119
|
body,
|
|
122
120
|
},
|
|
@@ -129,7 +127,7 @@ class Serviceability {
|
|
|
129
127
|
// Showing warrnings if extra unknown parameters are found
|
|
130
128
|
const {
|
|
131
129
|
error: warrning,
|
|
132
|
-
} = ServiceabilityPlatformApplicationValidator.
|
|
130
|
+
} = ServiceabilityPlatformApplicationValidator.createBulkGeoArea().validate(
|
|
133
131
|
{
|
|
134
132
|
body,
|
|
135
133
|
},
|
|
@@ -138,7 +136,7 @@ class Serviceability {
|
|
|
138
136
|
if (warrning) {
|
|
139
137
|
Logger({
|
|
140
138
|
level: "WARN",
|
|
141
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
139
|
+
message: `Parameter Validation warrnings for platform > Serviceability > createBulkGeoArea \n ${warrning}`,
|
|
142
140
|
});
|
|
143
141
|
}
|
|
144
142
|
|
|
@@ -147,7 +145,7 @@ class Serviceability {
|
|
|
147
145
|
const response = await PlatformAPIClient.execute(
|
|
148
146
|
this.config,
|
|
149
147
|
"post",
|
|
150
|
-
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
148
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/geoareas/regions/bulk`,
|
|
151
149
|
query_params,
|
|
152
150
|
body,
|
|
153
151
|
requestHeaders,
|
|
@@ -161,10 +159,10 @@ class Serviceability {
|
|
|
161
159
|
|
|
162
160
|
const {
|
|
163
161
|
error: res_error,
|
|
164
|
-
} = ServiceabilityPlatformModel.
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
);
|
|
162
|
+
} = ServiceabilityPlatformModel.BulkGeoAreaResult().validate(responseData, {
|
|
163
|
+
abortEarly: false,
|
|
164
|
+
allowUnknown: true,
|
|
165
|
+
});
|
|
168
166
|
|
|
169
167
|
if (res_error) {
|
|
170
168
|
if (this.config.options.strictResponseCheck === true) {
|
|
@@ -172,7 +170,7 @@ class Serviceability {
|
|
|
172
170
|
} else {
|
|
173
171
|
Logger({
|
|
174
172
|
level: "WARN",
|
|
175
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
173
|
+
message: `Response Validation Warnings for platform > Serviceability > createBulkGeoArea \n ${res_error}`,
|
|
176
174
|
});
|
|
177
175
|
}
|
|
178
176
|
}
|
|
@@ -181,25 +179,28 @@ class Serviceability {
|
|
|
181
179
|
}
|
|
182
180
|
|
|
183
181
|
/**
|
|
184
|
-
* @param {ServiceabilityPlatformApplicationValidator.
|
|
182
|
+
* @param {ServiceabilityPlatformApplicationValidator.CreateCourierPartnerRuleParam} arg
|
|
185
183
|
* - Arg object
|
|
186
184
|
*
|
|
187
185
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
188
186
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
189
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
190
|
-
* Success response
|
|
191
|
-
*
|
|
192
|
-
* @
|
|
193
|
-
* @
|
|
187
|
+
* @returns {Promise<ServiceabilityPlatformModel.CourierPartnerRuleResult>}
|
|
188
|
+
* - Success response
|
|
189
|
+
*
|
|
190
|
+
* @name createCourierPartnerRule
|
|
191
|
+
* @summary: Create courier rule
|
|
192
|
+
* @description: Creates a rule within the delivery configuration. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/createCourierPartnerRule/).
|
|
194
193
|
*/
|
|
195
|
-
async
|
|
196
|
-
{ requestHeaders } = { requestHeaders: {} },
|
|
194
|
+
async createCourierPartnerRule(
|
|
195
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
197
196
|
{ responseHeaders } = { responseHeaders: false }
|
|
198
197
|
) {
|
|
199
198
|
const {
|
|
200
199
|
error,
|
|
201
|
-
} = ServiceabilityPlatformApplicationValidator.
|
|
202
|
-
{
|
|
200
|
+
} = ServiceabilityPlatformApplicationValidator.createCourierPartnerRule().validate(
|
|
201
|
+
{
|
|
202
|
+
body,
|
|
203
|
+
},
|
|
203
204
|
{ abortEarly: false, allowUnknown: true }
|
|
204
205
|
);
|
|
205
206
|
if (error) {
|
|
@@ -209,14 +210,16 @@ class Serviceability {
|
|
|
209
210
|
// Showing warrnings if extra unknown parameters are found
|
|
210
211
|
const {
|
|
211
212
|
error: warrning,
|
|
212
|
-
} = ServiceabilityPlatformApplicationValidator.
|
|
213
|
-
{
|
|
213
|
+
} = ServiceabilityPlatformApplicationValidator.createCourierPartnerRule().validate(
|
|
214
|
+
{
|
|
215
|
+
body,
|
|
216
|
+
},
|
|
214
217
|
{ abortEarly: false, allowUnknown: false }
|
|
215
218
|
);
|
|
216
219
|
if (warrning) {
|
|
217
220
|
Logger({
|
|
218
221
|
level: "WARN",
|
|
219
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
222
|
+
message: `Parameter Validation warrnings for platform > Serviceability > createCourierPartnerRule \n ${warrning}`,
|
|
220
223
|
});
|
|
221
224
|
}
|
|
222
225
|
|
|
@@ -224,10 +227,10 @@ class Serviceability {
|
|
|
224
227
|
|
|
225
228
|
const response = await PlatformAPIClient.execute(
|
|
226
229
|
this.config,
|
|
227
|
-
"
|
|
228
|
-
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
230
|
+
"post",
|
|
231
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/courier-partner/rules`,
|
|
229
232
|
query_params,
|
|
230
|
-
|
|
233
|
+
body,
|
|
231
234
|
requestHeaders,
|
|
232
235
|
{ responseHeaders }
|
|
233
236
|
);
|
|
@@ -239,7 +242,7 @@ class Serviceability {
|
|
|
239
242
|
|
|
240
243
|
const {
|
|
241
244
|
error: res_error,
|
|
242
|
-
} = ServiceabilityPlatformModel.
|
|
245
|
+
} = ServiceabilityPlatformModel.CourierPartnerRuleResult().validate(
|
|
243
246
|
responseData,
|
|
244
247
|
{ abortEarly: false, allowUnknown: true }
|
|
245
248
|
);
|
|
@@ -250,7 +253,7 @@ class Serviceability {
|
|
|
250
253
|
} else {
|
|
251
254
|
Logger({
|
|
252
255
|
level: "WARN",
|
|
253
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
256
|
+
message: `Response Validation Warnings for platform > Serviceability > createCourierPartnerRule \n ${res_error}`,
|
|
254
257
|
});
|
|
255
258
|
}
|
|
256
259
|
}
|
|
@@ -259,25 +262,27 @@ class Serviceability {
|
|
|
259
262
|
}
|
|
260
263
|
|
|
261
264
|
/**
|
|
262
|
-
* @param {ServiceabilityPlatformApplicationValidator.
|
|
265
|
+
* @param {ServiceabilityPlatformApplicationValidator.CreateGeoAreaParam} arg
|
|
263
266
|
* - Arg object
|
|
264
267
|
*
|
|
265
268
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
266
269
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
267
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
270
|
+
* @returns {Promise<ServiceabilityPlatformModel.GeoAreaResponseBody>} -
|
|
268
271
|
* Success response
|
|
269
|
-
* @name
|
|
270
|
-
* @summary:
|
|
271
|
-
* @description:
|
|
272
|
+
* @name createGeoArea
|
|
273
|
+
* @summary: Creation of GeoArea
|
|
274
|
+
* @description: Allows to create and manage GeoAreas, representing groups of geographic regions. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/createGeoArea/).
|
|
272
275
|
*/
|
|
273
|
-
async
|
|
274
|
-
{ requestHeaders } = { requestHeaders: {} },
|
|
276
|
+
async createGeoArea(
|
|
277
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
275
278
|
{ responseHeaders } = { responseHeaders: false }
|
|
276
279
|
) {
|
|
277
280
|
const {
|
|
278
281
|
error,
|
|
279
|
-
} = ServiceabilityPlatformApplicationValidator.
|
|
280
|
-
{
|
|
282
|
+
} = ServiceabilityPlatformApplicationValidator.createGeoArea().validate(
|
|
283
|
+
{
|
|
284
|
+
body,
|
|
285
|
+
},
|
|
281
286
|
{ abortEarly: false, allowUnknown: true }
|
|
282
287
|
);
|
|
283
288
|
if (error) {
|
|
@@ -287,14 +292,16 @@ class Serviceability {
|
|
|
287
292
|
// Showing warrnings if extra unknown parameters are found
|
|
288
293
|
const {
|
|
289
294
|
error: warrning,
|
|
290
|
-
} = ServiceabilityPlatformApplicationValidator.
|
|
291
|
-
{
|
|
295
|
+
} = ServiceabilityPlatformApplicationValidator.createGeoArea().validate(
|
|
296
|
+
{
|
|
297
|
+
body,
|
|
298
|
+
},
|
|
292
299
|
{ abortEarly: false, allowUnknown: false }
|
|
293
300
|
);
|
|
294
301
|
if (warrning) {
|
|
295
302
|
Logger({
|
|
296
303
|
level: "WARN",
|
|
297
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
304
|
+
message: `Parameter Validation warrnings for platform > Serviceability > createGeoArea \n ${warrning}`,
|
|
298
305
|
});
|
|
299
306
|
}
|
|
300
307
|
|
|
@@ -302,10 +309,10 @@ class Serviceability {
|
|
|
302
309
|
|
|
303
310
|
const response = await PlatformAPIClient.execute(
|
|
304
311
|
this.config,
|
|
305
|
-
"
|
|
306
|
-
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
312
|
+
"post",
|
|
313
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/geoareas`,
|
|
307
314
|
query_params,
|
|
308
|
-
|
|
315
|
+
body,
|
|
309
316
|
requestHeaders,
|
|
310
317
|
{ responseHeaders }
|
|
311
318
|
);
|
|
@@ -317,10 +324,10 @@ class Serviceability {
|
|
|
317
324
|
|
|
318
325
|
const {
|
|
319
326
|
error: res_error,
|
|
320
|
-
} = ServiceabilityPlatformModel.
|
|
321
|
-
|
|
322
|
-
allowUnknown: true
|
|
323
|
-
|
|
327
|
+
} = ServiceabilityPlatformModel.GeoAreaResponseBody().validate(
|
|
328
|
+
responseData,
|
|
329
|
+
{ abortEarly: false, allowUnknown: true }
|
|
330
|
+
);
|
|
324
331
|
|
|
325
332
|
if (res_error) {
|
|
326
333
|
if (this.config.options.strictResponseCheck === true) {
|
|
@@ -328,7 +335,7 @@ class Serviceability {
|
|
|
328
335
|
} else {
|
|
329
336
|
Logger({
|
|
330
337
|
level: "WARN",
|
|
331
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
338
|
+
message: `Response Validation Warnings for platform > Serviceability > createGeoArea \n ${res_error}`,
|
|
332
339
|
});
|
|
333
340
|
}
|
|
334
341
|
}
|
|
@@ -337,26 +344,28 @@ class Serviceability {
|
|
|
337
344
|
}
|
|
338
345
|
|
|
339
346
|
/**
|
|
340
|
-
* @param {ServiceabilityPlatformApplicationValidator.
|
|
347
|
+
* @param {ServiceabilityPlatformApplicationValidator.CreateGeoAreaExportJobParam} arg
|
|
341
348
|
* - Arg object
|
|
342
349
|
*
|
|
343
350
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
344
351
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
345
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
352
|
+
* @returns {Promise<ServiceabilityPlatformModel.GeoAreaBulkCreationResult>}
|
|
346
353
|
* - Success response
|
|
347
354
|
*
|
|
348
|
-
* @name
|
|
349
|
-
* @summary:
|
|
350
|
-
* @description:
|
|
355
|
+
* @name createGeoAreaExportJob
|
|
356
|
+
* @summary: Create job for exporting Geoarea regions
|
|
357
|
+
* @description: Create the job for exporting the regions in Geoarea in CSV format. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/createGeoAreaExportJob/).
|
|
351
358
|
*/
|
|
352
|
-
async
|
|
353
|
-
{ requestHeaders } = { requestHeaders: {} },
|
|
359
|
+
async createGeoAreaExportJob(
|
|
360
|
+
{ geoareaId, requestHeaders } = { requestHeaders: {} },
|
|
354
361
|
{ responseHeaders } = { responseHeaders: false }
|
|
355
362
|
) {
|
|
356
363
|
const {
|
|
357
364
|
error,
|
|
358
|
-
} = ServiceabilityPlatformApplicationValidator.
|
|
359
|
-
{
|
|
365
|
+
} = ServiceabilityPlatformApplicationValidator.createGeoAreaExportJob().validate(
|
|
366
|
+
{
|
|
367
|
+
geoareaId,
|
|
368
|
+
},
|
|
360
369
|
{ abortEarly: false, allowUnknown: true }
|
|
361
370
|
);
|
|
362
371
|
if (error) {
|
|
@@ -366,14 +375,16 @@ class Serviceability {
|
|
|
366
375
|
// Showing warrnings if extra unknown parameters are found
|
|
367
376
|
const {
|
|
368
377
|
error: warrning,
|
|
369
|
-
} = ServiceabilityPlatformApplicationValidator.
|
|
370
|
-
{
|
|
378
|
+
} = ServiceabilityPlatformApplicationValidator.createGeoAreaExportJob().validate(
|
|
379
|
+
{
|
|
380
|
+
geoareaId,
|
|
381
|
+
},
|
|
371
382
|
{ abortEarly: false, allowUnknown: false }
|
|
372
383
|
);
|
|
373
384
|
if (warrning) {
|
|
374
385
|
Logger({
|
|
375
386
|
level: "WARN",
|
|
376
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
387
|
+
message: `Parameter Validation warrnings for platform > Serviceability > createGeoAreaExportJob \n ${warrning}`,
|
|
377
388
|
});
|
|
378
389
|
}
|
|
379
390
|
|
|
@@ -381,8 +392,8 @@ class Serviceability {
|
|
|
381
392
|
|
|
382
393
|
const response = await PlatformAPIClient.execute(
|
|
383
394
|
this.config,
|
|
384
|
-
"
|
|
385
|
-
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
395
|
+
"post",
|
|
396
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/geoareas/bulk/export/${geoareaId}`,
|
|
386
397
|
query_params,
|
|
387
398
|
undefined,
|
|
388
399
|
requestHeaders,
|
|
@@ -396,7 +407,7 @@ class Serviceability {
|
|
|
396
407
|
|
|
397
408
|
const {
|
|
398
409
|
error: res_error,
|
|
399
|
-
} = ServiceabilityPlatformModel.
|
|
410
|
+
} = ServiceabilityPlatformModel.GeoAreaBulkCreationResult().validate(
|
|
400
411
|
responseData,
|
|
401
412
|
{ abortEarly: false, allowUnknown: true }
|
|
402
413
|
);
|
|
@@ -407,7 +418,7 @@ class Serviceability {
|
|
|
407
418
|
} else {
|
|
408
419
|
Logger({
|
|
409
420
|
level: "WARN",
|
|
410
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
421
|
+
message: `Response Validation Warnings for platform > Serviceability > createGeoAreaExportJob \n ${res_error}`,
|
|
411
422
|
});
|
|
412
423
|
}
|
|
413
424
|
}
|
|
@@ -416,27 +427,26 @@ class Serviceability {
|
|
|
416
427
|
}
|
|
417
428
|
|
|
418
429
|
/**
|
|
419
|
-
* @param {ServiceabilityPlatformApplicationValidator.
|
|
430
|
+
* @param {ServiceabilityPlatformApplicationValidator.CreateStoreRulesParam} arg
|
|
420
431
|
* - Arg object
|
|
421
432
|
*
|
|
422
433
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
423
434
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
424
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
425
|
-
*
|
|
426
|
-
*
|
|
427
|
-
* @
|
|
428
|
-
* @
|
|
429
|
-
* @description: Retrieves a single rule within the delivery configuration. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getCourierPartnerRule/).
|
|
435
|
+
* @returns {Promise<ServiceabilityPlatformModel.StoreRuleResultSchema>} -
|
|
436
|
+
* Success response
|
|
437
|
+
* @name createStoreRules
|
|
438
|
+
* @summary: Create store rule
|
|
439
|
+
* @description: Create a rule within the order routing rules - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/createStoreRules/).
|
|
430
440
|
*/
|
|
431
|
-
async
|
|
432
|
-
{
|
|
441
|
+
async createStoreRules(
|
|
442
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
433
443
|
{ responseHeaders } = { responseHeaders: false }
|
|
434
444
|
) {
|
|
435
445
|
const {
|
|
436
446
|
error,
|
|
437
|
-
} = ServiceabilityPlatformApplicationValidator.
|
|
447
|
+
} = ServiceabilityPlatformApplicationValidator.createStoreRules().validate(
|
|
438
448
|
{
|
|
439
|
-
|
|
449
|
+
body,
|
|
440
450
|
},
|
|
441
451
|
{ abortEarly: false, allowUnknown: true }
|
|
442
452
|
);
|
|
@@ -447,16 +457,16 @@ class Serviceability {
|
|
|
447
457
|
// Showing warrnings if extra unknown parameters are found
|
|
448
458
|
const {
|
|
449
459
|
error: warrning,
|
|
450
|
-
} = ServiceabilityPlatformApplicationValidator.
|
|
460
|
+
} = ServiceabilityPlatformApplicationValidator.createStoreRules().validate(
|
|
451
461
|
{
|
|
452
|
-
|
|
462
|
+
body,
|
|
453
463
|
},
|
|
454
464
|
{ abortEarly: false, allowUnknown: false }
|
|
455
465
|
);
|
|
456
466
|
if (warrning) {
|
|
457
467
|
Logger({
|
|
458
468
|
level: "WARN",
|
|
459
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
469
|
+
message: `Parameter Validation warrnings for platform > Serviceability > createStoreRules \n ${warrning}`,
|
|
460
470
|
});
|
|
461
471
|
}
|
|
462
472
|
|
|
@@ -464,10 +474,10 @@ class Serviceability {
|
|
|
464
474
|
|
|
465
475
|
const response = await PlatformAPIClient.execute(
|
|
466
476
|
this.config,
|
|
467
|
-
"
|
|
468
|
-
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
477
|
+
"post",
|
|
478
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/store/rules`,
|
|
469
479
|
query_params,
|
|
470
|
-
|
|
480
|
+
body,
|
|
471
481
|
requestHeaders,
|
|
472
482
|
{ responseHeaders }
|
|
473
483
|
);
|
|
@@ -479,7 +489,7 @@ class Serviceability {
|
|
|
479
489
|
|
|
480
490
|
const {
|
|
481
491
|
error: res_error,
|
|
482
|
-
} = ServiceabilityPlatformModel.
|
|
492
|
+
} = ServiceabilityPlatformModel.StoreRuleResultSchema().validate(
|
|
483
493
|
responseData,
|
|
484
494
|
{ abortEarly: false, allowUnknown: true }
|
|
485
495
|
);
|
|
@@ -490,7 +500,7 @@ class Serviceability {
|
|
|
490
500
|
} else {
|
|
491
501
|
Logger({
|
|
492
502
|
level: "WARN",
|
|
493
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
503
|
+
message: `Response Validation Warnings for platform > Serviceability > createStoreRules \n ${res_error}`,
|
|
494
504
|
});
|
|
495
505
|
}
|
|
496
506
|
}
|
|
@@ -499,29 +509,25 @@ class Serviceability {
|
|
|
499
509
|
}
|
|
500
510
|
|
|
501
511
|
/**
|
|
502
|
-
* @param {ServiceabilityPlatformApplicationValidator.
|
|
512
|
+
* @param {ServiceabilityPlatformApplicationValidator.CreateZoneParam} arg
|
|
503
513
|
* - Arg object
|
|
504
514
|
*
|
|
505
515
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
506
516
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
507
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
508
|
-
*
|
|
509
|
-
*
|
|
510
|
-
* @
|
|
511
|
-
* @summary: Get courier rules
|
|
512
|
-
* @description: Retrieve a list of rules within the delivery configuration. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getCourierPartnerRules/).
|
|
517
|
+
* @returns {Promise<ServiceabilityPlatformModel.ZoneSchema>} - Success response
|
|
518
|
+
* @name createZone
|
|
519
|
+
* @summary: Create zone
|
|
520
|
+
* @description: Creates a delivery zone. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/createZone/).
|
|
513
521
|
*/
|
|
514
|
-
async
|
|
515
|
-
{
|
|
522
|
+
async createZone(
|
|
523
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
516
524
|
{ responseHeaders } = { responseHeaders: false }
|
|
517
525
|
) {
|
|
518
526
|
const {
|
|
519
527
|
error,
|
|
520
|
-
} = ServiceabilityPlatformApplicationValidator.
|
|
528
|
+
} = ServiceabilityPlatformApplicationValidator.createZone().validate(
|
|
521
529
|
{
|
|
522
|
-
|
|
523
|
-
pageSize,
|
|
524
|
-
status,
|
|
530
|
+
body,
|
|
525
531
|
},
|
|
526
532
|
{ abortEarly: false, allowUnknown: true }
|
|
527
533
|
);
|
|
@@ -532,32 +538,27 @@ class Serviceability {
|
|
|
532
538
|
// Showing warrnings if extra unknown parameters are found
|
|
533
539
|
const {
|
|
534
540
|
error: warrning,
|
|
535
|
-
} = ServiceabilityPlatformApplicationValidator.
|
|
541
|
+
} = ServiceabilityPlatformApplicationValidator.createZone().validate(
|
|
536
542
|
{
|
|
537
|
-
|
|
538
|
-
pageSize,
|
|
539
|
-
status,
|
|
543
|
+
body,
|
|
540
544
|
},
|
|
541
545
|
{ abortEarly: false, allowUnknown: false }
|
|
542
546
|
);
|
|
543
547
|
if (warrning) {
|
|
544
548
|
Logger({
|
|
545
549
|
level: "WARN",
|
|
546
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
550
|
+
message: `Parameter Validation warrnings for platform > Serviceability > createZone \n ${warrning}`,
|
|
547
551
|
});
|
|
548
552
|
}
|
|
549
553
|
|
|
550
554
|
const query_params = {};
|
|
551
|
-
query_params["page_no"] = pageNo;
|
|
552
|
-
query_params["page_size"] = pageSize;
|
|
553
|
-
query_params["status"] = status;
|
|
554
555
|
|
|
555
556
|
const response = await PlatformAPIClient.execute(
|
|
556
557
|
this.config,
|
|
557
|
-
"
|
|
558
|
-
`/service/platform/logistics/
|
|
558
|
+
"post",
|
|
559
|
+
`/service/platform/logistics/v2.0/company/${this.config.companyId}/application/${this.applicationId}/zones`,
|
|
559
560
|
query_params,
|
|
560
|
-
|
|
561
|
+
body,
|
|
561
562
|
requestHeaders,
|
|
562
563
|
{ responseHeaders }
|
|
563
564
|
);
|
|
@@ -569,10 +570,10 @@ class Serviceability {
|
|
|
569
570
|
|
|
570
571
|
const {
|
|
571
572
|
error: res_error,
|
|
572
|
-
} = ServiceabilityPlatformModel.
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
);
|
|
573
|
+
} = ServiceabilityPlatformModel.ZoneSchema().validate(responseData, {
|
|
574
|
+
abortEarly: false,
|
|
575
|
+
allowUnknown: true,
|
|
576
|
+
});
|
|
576
577
|
|
|
577
578
|
if (res_error) {
|
|
578
579
|
if (this.config.options.strictResponseCheck === true) {
|
|
@@ -580,7 +581,7 @@ class Serviceability {
|
|
|
580
581
|
} else {
|
|
581
582
|
Logger({
|
|
582
583
|
level: "WARN",
|
|
583
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
584
|
+
message: `Response Validation Warnings for platform > Serviceability > createZone \n ${res_error}`,
|
|
584
585
|
});
|
|
585
586
|
}
|
|
586
587
|
}
|
|
@@ -589,27 +590,27 @@ class Serviceability {
|
|
|
589
590
|
}
|
|
590
591
|
|
|
591
592
|
/**
|
|
592
|
-
* @param {ServiceabilityPlatformApplicationValidator.
|
|
593
|
+
* @param {ServiceabilityPlatformApplicationValidator.DeleteZoneParam} arg
|
|
593
594
|
* - Arg object
|
|
594
595
|
*
|
|
595
596
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
596
597
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
597
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
598
|
+
* @returns {Promise<ServiceabilityPlatformModel.ZoneDeleteSuccessResult>}
|
|
598
599
|
* - Success response
|
|
599
600
|
*
|
|
600
|
-
* @name
|
|
601
|
-
* @summary:
|
|
602
|
-
* @description:
|
|
601
|
+
* @name deleteZone
|
|
602
|
+
* @summary: Delete a Specific Zone
|
|
603
|
+
* @description: Delete a Zone under that application. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/deleteZone/).
|
|
603
604
|
*/
|
|
604
|
-
async
|
|
605
|
-
{
|
|
605
|
+
async deleteZone(
|
|
606
|
+
{ zoneId, requestHeaders } = { requestHeaders: {} },
|
|
606
607
|
{ responseHeaders } = { responseHeaders: false }
|
|
607
608
|
) {
|
|
608
609
|
const {
|
|
609
610
|
error,
|
|
610
|
-
} = ServiceabilityPlatformApplicationValidator.
|
|
611
|
+
} = ServiceabilityPlatformApplicationValidator.deleteZone().validate(
|
|
611
612
|
{
|
|
612
|
-
|
|
613
|
+
zoneId,
|
|
613
614
|
},
|
|
614
615
|
{ abortEarly: false, allowUnknown: true }
|
|
615
616
|
);
|
|
@@ -620,16 +621,16 @@ class Serviceability {
|
|
|
620
621
|
// Showing warrnings if extra unknown parameters are found
|
|
621
622
|
const {
|
|
622
623
|
error: warrning,
|
|
623
|
-
} = ServiceabilityPlatformApplicationValidator.
|
|
624
|
+
} = ServiceabilityPlatformApplicationValidator.deleteZone().validate(
|
|
624
625
|
{
|
|
625
|
-
|
|
626
|
+
zoneId,
|
|
626
627
|
},
|
|
627
628
|
{ abortEarly: false, allowUnknown: false }
|
|
628
629
|
);
|
|
629
630
|
if (warrning) {
|
|
630
631
|
Logger({
|
|
631
632
|
level: "WARN",
|
|
632
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
633
|
+
message: `Parameter Validation warrnings for platform > Serviceability > deleteZone \n ${warrning}`,
|
|
633
634
|
});
|
|
634
635
|
}
|
|
635
636
|
|
|
@@ -637,10 +638,10 @@ class Serviceability {
|
|
|
637
638
|
|
|
638
639
|
const response = await PlatformAPIClient.execute(
|
|
639
640
|
this.config,
|
|
640
|
-
"
|
|
641
|
-
`/service/platform/logistics/
|
|
641
|
+
"delete",
|
|
642
|
+
`/service/platform/logistics/v2.0/company/${this.config.companyId}/application/${this.applicationId}/zones/${zoneId}`,
|
|
642
643
|
query_params,
|
|
643
|
-
|
|
644
|
+
undefined,
|
|
644
645
|
requestHeaders,
|
|
645
646
|
{ responseHeaders }
|
|
646
647
|
);
|
|
@@ -652,7 +653,7 @@ class Serviceability {
|
|
|
652
653
|
|
|
653
654
|
const {
|
|
654
655
|
error: res_error,
|
|
655
|
-
} = ServiceabilityPlatformModel.
|
|
656
|
+
} = ServiceabilityPlatformModel.ZoneDeleteSuccessResult().validate(
|
|
656
657
|
responseData,
|
|
657
658
|
{ abortEarly: false, allowUnknown: true }
|
|
658
659
|
);
|
|
@@ -663,7 +664,7 @@ class Serviceability {
|
|
|
663
664
|
} else {
|
|
664
665
|
Logger({
|
|
665
666
|
level: "WARN",
|
|
666
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
667
|
+
message: `Response Validation Warnings for platform > Serviceability > deleteZone \n ${res_error}`,
|
|
667
668
|
});
|
|
668
669
|
}
|
|
669
670
|
}
|
|
@@ -672,27 +673,24 @@ class Serviceability {
|
|
|
672
673
|
}
|
|
673
674
|
|
|
674
675
|
/**
|
|
675
|
-
* @param {ServiceabilityPlatformApplicationValidator.
|
|
676
|
+
* @param {ServiceabilityPlatformApplicationValidator.DownloadGeoareaSampleFileParam} arg
|
|
676
677
|
* - Arg object
|
|
677
678
|
*
|
|
678
679
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
679
680
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
680
|
-
* @returns {Promise<
|
|
681
|
-
*
|
|
682
|
-
* @
|
|
683
|
-
* @
|
|
684
|
-
* @description: Retrieves a single rule within the order routing rules - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getStoreRule/).
|
|
681
|
+
* @returns {Promise<string>} - Success response
|
|
682
|
+
* @name downloadGeoareaSampleFile
|
|
683
|
+
* @summary: Download geoarea sample file
|
|
684
|
+
* @description: Download a sample file for geoarea data. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/downloadGeoareaSampleFile/).
|
|
685
685
|
*/
|
|
686
|
-
async
|
|
687
|
-
{
|
|
686
|
+
async downloadGeoareaSampleFile(
|
|
687
|
+
{ requestHeaders } = { requestHeaders: {} },
|
|
688
688
|
{ responseHeaders } = { responseHeaders: false }
|
|
689
689
|
) {
|
|
690
690
|
const {
|
|
691
691
|
error,
|
|
692
|
-
} = ServiceabilityPlatformApplicationValidator.
|
|
693
|
-
{
|
|
694
|
-
ruleUid,
|
|
695
|
-
},
|
|
692
|
+
} = ServiceabilityPlatformApplicationValidator.downloadGeoareaSampleFile().validate(
|
|
693
|
+
{},
|
|
696
694
|
{ abortEarly: false, allowUnknown: true }
|
|
697
695
|
);
|
|
698
696
|
if (error) {
|
|
@@ -702,16 +700,14 @@ class Serviceability {
|
|
|
702
700
|
// Showing warrnings if extra unknown parameters are found
|
|
703
701
|
const {
|
|
704
702
|
error: warrning,
|
|
705
|
-
} = ServiceabilityPlatformApplicationValidator.
|
|
706
|
-
{
|
|
707
|
-
ruleUid,
|
|
708
|
-
},
|
|
703
|
+
} = ServiceabilityPlatformApplicationValidator.downloadGeoareaSampleFile().validate(
|
|
704
|
+
{},
|
|
709
705
|
{ abortEarly: false, allowUnknown: false }
|
|
710
706
|
);
|
|
711
707
|
if (warrning) {
|
|
712
708
|
Logger({
|
|
713
709
|
level: "WARN",
|
|
714
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
710
|
+
message: `Parameter Validation warrnings for platform > Serviceability > downloadGeoareaSampleFile \n ${warrning}`,
|
|
715
711
|
});
|
|
716
712
|
}
|
|
717
713
|
|
|
@@ -720,7 +716,7 @@ class Serviceability {
|
|
|
720
716
|
const response = await PlatformAPIClient.execute(
|
|
721
717
|
this.config,
|
|
722
718
|
"get",
|
|
723
|
-
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
719
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/geoareas/regions/bulk/sample`,
|
|
724
720
|
query_params,
|
|
725
721
|
undefined,
|
|
726
722
|
requestHeaders,
|
|
@@ -732,12 +728,9 @@ class Serviceability {
|
|
|
732
728
|
responseData = response[0];
|
|
733
729
|
}
|
|
734
730
|
|
|
735
|
-
const {
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
responseData,
|
|
739
|
-
{ abortEarly: false, allowUnknown: true }
|
|
740
|
-
);
|
|
731
|
+
const { error: res_error } = Joi.string()
|
|
732
|
+
.allow("")
|
|
733
|
+
.validate(responseData, { abortEarly: false, allowUnknown: true });
|
|
741
734
|
|
|
742
735
|
if (res_error) {
|
|
743
736
|
if (this.config.options.strictResponseCheck === true) {
|
|
@@ -745,7 +738,7 @@ class Serviceability {
|
|
|
745
738
|
} else {
|
|
746
739
|
Logger({
|
|
747
740
|
level: "WARN",
|
|
748
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
741
|
+
message: `Response Validation Warnings for platform > Serviceability > downloadGeoareaSampleFile \n ${res_error}`,
|
|
749
742
|
});
|
|
750
743
|
}
|
|
751
744
|
}
|
|
@@ -754,29 +747,25 @@ class Serviceability {
|
|
|
754
747
|
}
|
|
755
748
|
|
|
756
749
|
/**
|
|
757
|
-
* @param {ServiceabilityPlatformApplicationValidator.
|
|
750
|
+
* @param {ServiceabilityPlatformApplicationValidator.GetApplicationConfigParam} arg
|
|
758
751
|
* - Arg object
|
|
759
752
|
*
|
|
760
753
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
761
754
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
762
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
755
|
+
* @returns {Promise<ServiceabilityPlatformModel.StoreRuleConfigData>} -
|
|
763
756
|
* Success response
|
|
764
|
-
* @name
|
|
765
|
-
* @summary: Get store
|
|
766
|
-
* @description: Retrieves
|
|
757
|
+
* @name getApplicationConfig
|
|
758
|
+
* @summary: Get store rule configuration
|
|
759
|
+
* @description: Retrieves information about the order routing setup for a single application - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getApplicationConfig/).
|
|
767
760
|
*/
|
|
768
|
-
async
|
|
769
|
-
{
|
|
761
|
+
async getApplicationConfig(
|
|
762
|
+
{ requestHeaders } = { requestHeaders: {} },
|
|
770
763
|
{ responseHeaders } = { responseHeaders: false }
|
|
771
764
|
) {
|
|
772
765
|
const {
|
|
773
766
|
error,
|
|
774
|
-
} = ServiceabilityPlatformApplicationValidator.
|
|
775
|
-
{
|
|
776
|
-
pageNo,
|
|
777
|
-
pageSize,
|
|
778
|
-
status,
|
|
779
|
-
},
|
|
767
|
+
} = ServiceabilityPlatformApplicationValidator.getApplicationConfig().validate(
|
|
768
|
+
{},
|
|
780
769
|
{ abortEarly: false, allowUnknown: true }
|
|
781
770
|
);
|
|
782
771
|
if (error) {
|
|
@@ -786,32 +775,1345 @@ class Serviceability {
|
|
|
786
775
|
// Showing warrnings if extra unknown parameters are found
|
|
787
776
|
const {
|
|
788
777
|
error: warrning,
|
|
789
|
-
} = ServiceabilityPlatformApplicationValidator.
|
|
790
|
-
{
|
|
778
|
+
} = ServiceabilityPlatformApplicationValidator.getApplicationConfig().validate(
|
|
779
|
+
{},
|
|
780
|
+
{ abortEarly: false, allowUnknown: false }
|
|
781
|
+
);
|
|
782
|
+
if (warrning) {
|
|
783
|
+
Logger({
|
|
784
|
+
level: "WARN",
|
|
785
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getApplicationConfig \n ${warrning}`,
|
|
786
|
+
});
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
const query_params = {};
|
|
790
|
+
|
|
791
|
+
const response = await PlatformAPIClient.execute(
|
|
792
|
+
this.config,
|
|
793
|
+
"get",
|
|
794
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/store/configuration`,
|
|
795
|
+
query_params,
|
|
796
|
+
undefined,
|
|
797
|
+
requestHeaders,
|
|
798
|
+
{ responseHeaders }
|
|
799
|
+
);
|
|
800
|
+
|
|
801
|
+
let responseData = response;
|
|
802
|
+
if (responseHeaders) {
|
|
803
|
+
responseData = response[0];
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
const {
|
|
807
|
+
error: res_error,
|
|
808
|
+
} = ServiceabilityPlatformModel.StoreRuleConfigData().validate(
|
|
809
|
+
responseData,
|
|
810
|
+
{ abortEarly: false, allowUnknown: true }
|
|
811
|
+
);
|
|
812
|
+
|
|
813
|
+
if (res_error) {
|
|
814
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
815
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
816
|
+
} else {
|
|
817
|
+
Logger({
|
|
818
|
+
level: "WARN",
|
|
819
|
+
message: `Response Validation Warnings for platform > Serviceability > getApplicationConfig \n ${res_error}`,
|
|
820
|
+
});
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
return response;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
/**
|
|
828
|
+
* @param {ServiceabilityPlatformApplicationValidator.GetApplicationConfigurationParam} arg
|
|
829
|
+
* - Arg object
|
|
830
|
+
*
|
|
831
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
832
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
833
|
+
* @returns {Promise<ServiceabilityPlatformModel.ApplicationConfigGetResult>}
|
|
834
|
+
* - Success response
|
|
835
|
+
*
|
|
836
|
+
* @name getApplicationConfiguration
|
|
837
|
+
* @summary: Get delivery configuration
|
|
838
|
+
* @description: This API returns all the Application config that has been applied to the given company and application. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getApplicationConfiguration/).
|
|
839
|
+
*/
|
|
840
|
+
async getApplicationConfiguration(
|
|
841
|
+
{ requestHeaders } = { requestHeaders: {} },
|
|
842
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
843
|
+
) {
|
|
844
|
+
const {
|
|
845
|
+
error,
|
|
846
|
+
} = ServiceabilityPlatformApplicationValidator.getApplicationConfiguration().validate(
|
|
847
|
+
{},
|
|
848
|
+
{ abortEarly: false, allowUnknown: true }
|
|
849
|
+
);
|
|
850
|
+
if (error) {
|
|
851
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
// Showing warrnings if extra unknown parameters are found
|
|
855
|
+
const {
|
|
856
|
+
error: warrning,
|
|
857
|
+
} = ServiceabilityPlatformApplicationValidator.getApplicationConfiguration().validate(
|
|
858
|
+
{},
|
|
859
|
+
{ abortEarly: false, allowUnknown: false }
|
|
860
|
+
);
|
|
861
|
+
if (warrning) {
|
|
862
|
+
Logger({
|
|
863
|
+
level: "WARN",
|
|
864
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getApplicationConfiguration \n ${warrning}`,
|
|
865
|
+
});
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
const query_params = {};
|
|
869
|
+
|
|
870
|
+
const response = await PlatformAPIClient.execute(
|
|
871
|
+
this.config,
|
|
872
|
+
"get",
|
|
873
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/configuration`,
|
|
874
|
+
query_params,
|
|
875
|
+
undefined,
|
|
876
|
+
requestHeaders,
|
|
877
|
+
{ responseHeaders }
|
|
878
|
+
);
|
|
879
|
+
|
|
880
|
+
let responseData = response;
|
|
881
|
+
if (responseHeaders) {
|
|
882
|
+
responseData = response[0];
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
const {
|
|
886
|
+
error: res_error,
|
|
887
|
+
} = ServiceabilityPlatformModel.ApplicationConfigGetResult().validate(
|
|
888
|
+
responseData,
|
|
889
|
+
{ abortEarly: false, allowUnknown: true }
|
|
890
|
+
);
|
|
891
|
+
|
|
892
|
+
if (res_error) {
|
|
893
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
894
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
895
|
+
} else {
|
|
896
|
+
Logger({
|
|
897
|
+
level: "WARN",
|
|
898
|
+
message: `Response Validation Warnings for platform > Serviceability > getApplicationConfiguration \n ${res_error}`,
|
|
899
|
+
});
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
return response;
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
/**
|
|
907
|
+
* @param {ServiceabilityPlatformApplicationValidator.GetBulkExportParam} arg
|
|
908
|
+
* - Arg object
|
|
909
|
+
*
|
|
910
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
911
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
912
|
+
* @returns {Promise<ServiceabilityPlatformModel.GetZoneBulkExport>} -
|
|
913
|
+
* Success response
|
|
914
|
+
* @name getBulkExport
|
|
915
|
+
* @summary: Get Bulk Export of Zones
|
|
916
|
+
* @description: Get specific zone which is exported at the application level. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getBulkExport/).
|
|
917
|
+
*/
|
|
918
|
+
async getBulkExport(
|
|
919
|
+
{ batchId, requestHeaders } = { requestHeaders: {} },
|
|
920
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
921
|
+
) {
|
|
922
|
+
const {
|
|
923
|
+
error,
|
|
924
|
+
} = ServiceabilityPlatformApplicationValidator.getBulkExport().validate(
|
|
925
|
+
{
|
|
926
|
+
batchId,
|
|
927
|
+
},
|
|
928
|
+
{ abortEarly: false, allowUnknown: true }
|
|
929
|
+
);
|
|
930
|
+
if (error) {
|
|
931
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
// Showing warrnings if extra unknown parameters are found
|
|
935
|
+
const {
|
|
936
|
+
error: warrning,
|
|
937
|
+
} = ServiceabilityPlatformApplicationValidator.getBulkExport().validate(
|
|
938
|
+
{
|
|
939
|
+
batchId,
|
|
940
|
+
},
|
|
941
|
+
{ abortEarly: false, allowUnknown: false }
|
|
942
|
+
);
|
|
943
|
+
if (warrning) {
|
|
944
|
+
Logger({
|
|
945
|
+
level: "WARN",
|
|
946
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getBulkExport \n ${warrning}`,
|
|
947
|
+
});
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
const query_params = {};
|
|
951
|
+
|
|
952
|
+
const response = await PlatformAPIClient.execute(
|
|
953
|
+
this.config,
|
|
954
|
+
"get",
|
|
955
|
+
`/service/platform/logistics/v2.0/company/${this.config.companyId}/application/${this.applicationId}/zones/bulk/export/${batchId}`,
|
|
956
|
+
query_params,
|
|
957
|
+
undefined,
|
|
958
|
+
requestHeaders,
|
|
959
|
+
{ responseHeaders }
|
|
960
|
+
);
|
|
961
|
+
|
|
962
|
+
let responseData = response;
|
|
963
|
+
if (responseHeaders) {
|
|
964
|
+
responseData = response[0];
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
const {
|
|
968
|
+
error: res_error,
|
|
969
|
+
} = ServiceabilityPlatformModel.GetZoneBulkExport().validate(responseData, {
|
|
970
|
+
abortEarly: false,
|
|
971
|
+
allowUnknown: true,
|
|
972
|
+
});
|
|
973
|
+
|
|
974
|
+
if (res_error) {
|
|
975
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
976
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
977
|
+
} else {
|
|
978
|
+
Logger({
|
|
979
|
+
level: "WARN",
|
|
980
|
+
message: `Response Validation Warnings for platform > Serviceability > getBulkExport \n ${res_error}`,
|
|
981
|
+
});
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
return response;
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
/**
|
|
989
|
+
* @param {ServiceabilityPlatformApplicationValidator.GetBulkGeoAreaParam} arg
|
|
990
|
+
* - Arg object
|
|
991
|
+
*
|
|
992
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
993
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
994
|
+
* @returns {Promise<ServiceabilityPlatformModel.BulkGeoAreaGetResult>} -
|
|
995
|
+
* Success response
|
|
996
|
+
* @name getBulkGeoArea
|
|
997
|
+
* @summary: Get status of GeoAreas created in bulk
|
|
998
|
+
* @description: Allows to Get GeoArea status which is created, representing groups of geographic regions in bulk. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getBulkGeoArea/).
|
|
999
|
+
*/
|
|
1000
|
+
async getBulkGeoArea(
|
|
1001
|
+
{ geoareaId, requestHeaders } = { requestHeaders: {} },
|
|
1002
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1003
|
+
) {
|
|
1004
|
+
const {
|
|
1005
|
+
error,
|
|
1006
|
+
} = ServiceabilityPlatformApplicationValidator.getBulkGeoArea().validate(
|
|
1007
|
+
{
|
|
1008
|
+
geoareaId,
|
|
1009
|
+
},
|
|
1010
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1011
|
+
);
|
|
1012
|
+
if (error) {
|
|
1013
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1017
|
+
const {
|
|
1018
|
+
error: warrning,
|
|
1019
|
+
} = ServiceabilityPlatformApplicationValidator.getBulkGeoArea().validate(
|
|
1020
|
+
{
|
|
1021
|
+
geoareaId,
|
|
1022
|
+
},
|
|
1023
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1024
|
+
);
|
|
1025
|
+
if (warrning) {
|
|
1026
|
+
Logger({
|
|
1027
|
+
level: "WARN",
|
|
1028
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getBulkGeoArea \n ${warrning}`,
|
|
1029
|
+
});
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
const query_params = {};
|
|
1033
|
+
|
|
1034
|
+
const response = await PlatformAPIClient.execute(
|
|
1035
|
+
this.config,
|
|
1036
|
+
"get",
|
|
1037
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/geoareas/regions/bulk/${geoareaId}`,
|
|
1038
|
+
query_params,
|
|
1039
|
+
undefined,
|
|
1040
|
+
requestHeaders,
|
|
1041
|
+
{ responseHeaders }
|
|
1042
|
+
);
|
|
1043
|
+
|
|
1044
|
+
let responseData = response;
|
|
1045
|
+
if (responseHeaders) {
|
|
1046
|
+
responseData = response[0];
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
const {
|
|
1050
|
+
error: res_error,
|
|
1051
|
+
} = ServiceabilityPlatformModel.BulkGeoAreaGetResult().validate(
|
|
1052
|
+
responseData,
|
|
1053
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1054
|
+
);
|
|
1055
|
+
|
|
1056
|
+
if (res_error) {
|
|
1057
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
1058
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1059
|
+
} else {
|
|
1060
|
+
Logger({
|
|
1061
|
+
level: "WARN",
|
|
1062
|
+
message: `Response Validation Warnings for platform > Serviceability > getBulkGeoArea \n ${res_error}`,
|
|
1063
|
+
});
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
return response;
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
/**
|
|
1071
|
+
* @param {ServiceabilityPlatformApplicationValidator.GetCourierPartnerRuleParam} arg
|
|
1072
|
+
* - Arg object
|
|
1073
|
+
*
|
|
1074
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1075
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1076
|
+
* @returns {Promise<ServiceabilityPlatformModel.CourierPartnerRuleResult>}
|
|
1077
|
+
* - Success response
|
|
1078
|
+
*
|
|
1079
|
+
* @name getCourierPartnerRule
|
|
1080
|
+
* @summary: Get courier rule
|
|
1081
|
+
* @description: Retrieves a single rule within the delivery configuration. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getCourierPartnerRule/).
|
|
1082
|
+
*/
|
|
1083
|
+
async getCourierPartnerRule(
|
|
1084
|
+
{ ruleUid, requestHeaders } = { requestHeaders: {} },
|
|
1085
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1086
|
+
) {
|
|
1087
|
+
const {
|
|
1088
|
+
error,
|
|
1089
|
+
} = ServiceabilityPlatformApplicationValidator.getCourierPartnerRule().validate(
|
|
1090
|
+
{
|
|
1091
|
+
ruleUid,
|
|
1092
|
+
},
|
|
1093
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1094
|
+
);
|
|
1095
|
+
if (error) {
|
|
1096
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1100
|
+
const {
|
|
1101
|
+
error: warrning,
|
|
1102
|
+
} = ServiceabilityPlatformApplicationValidator.getCourierPartnerRule().validate(
|
|
1103
|
+
{
|
|
1104
|
+
ruleUid,
|
|
1105
|
+
},
|
|
1106
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1107
|
+
);
|
|
1108
|
+
if (warrning) {
|
|
1109
|
+
Logger({
|
|
1110
|
+
level: "WARN",
|
|
1111
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getCourierPartnerRule \n ${warrning}`,
|
|
1112
|
+
});
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
const query_params = {};
|
|
1116
|
+
|
|
1117
|
+
const response = await PlatformAPIClient.execute(
|
|
1118
|
+
this.config,
|
|
1119
|
+
"get",
|
|
1120
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/courier-partner/rules/${ruleUid}`,
|
|
1121
|
+
query_params,
|
|
1122
|
+
undefined,
|
|
1123
|
+
requestHeaders,
|
|
1124
|
+
{ responseHeaders }
|
|
1125
|
+
);
|
|
1126
|
+
|
|
1127
|
+
let responseData = response;
|
|
1128
|
+
if (responseHeaders) {
|
|
1129
|
+
responseData = response[0];
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
const {
|
|
1133
|
+
error: res_error,
|
|
1134
|
+
} = ServiceabilityPlatformModel.CourierPartnerRuleResult().validate(
|
|
1135
|
+
responseData,
|
|
1136
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1137
|
+
);
|
|
1138
|
+
|
|
1139
|
+
if (res_error) {
|
|
1140
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
1141
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1142
|
+
} else {
|
|
1143
|
+
Logger({
|
|
1144
|
+
level: "WARN",
|
|
1145
|
+
message: `Response Validation Warnings for platform > Serviceability > getCourierPartnerRule \n ${res_error}`,
|
|
1146
|
+
});
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
return response;
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
/**
|
|
1154
|
+
* @param {ServiceabilityPlatformApplicationValidator.GetCourierPartnerRulesParam} arg
|
|
1155
|
+
* - Arg object
|
|
1156
|
+
*
|
|
1157
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1158
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1159
|
+
* @returns {Promise<ServiceabilityPlatformModel.CourierPartnerRulesListResult>}
|
|
1160
|
+
* - Success response
|
|
1161
|
+
*
|
|
1162
|
+
* @name getCourierPartnerRules
|
|
1163
|
+
* @summary: Get courier rules
|
|
1164
|
+
* @description: Retrieve a list of rules within the delivery configuration. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getCourierPartnerRules/).
|
|
1165
|
+
*/
|
|
1166
|
+
async getCourierPartnerRules(
|
|
1167
|
+
{ pageNo, pageSize, status, requestHeaders } = { requestHeaders: {} },
|
|
1168
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1169
|
+
) {
|
|
1170
|
+
const {
|
|
1171
|
+
error,
|
|
1172
|
+
} = ServiceabilityPlatformApplicationValidator.getCourierPartnerRules().validate(
|
|
1173
|
+
{
|
|
1174
|
+
pageNo,
|
|
1175
|
+
pageSize,
|
|
1176
|
+
status,
|
|
1177
|
+
},
|
|
1178
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1179
|
+
);
|
|
1180
|
+
if (error) {
|
|
1181
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1185
|
+
const {
|
|
1186
|
+
error: warrning,
|
|
1187
|
+
} = ServiceabilityPlatformApplicationValidator.getCourierPartnerRules().validate(
|
|
1188
|
+
{
|
|
1189
|
+
pageNo,
|
|
1190
|
+
pageSize,
|
|
1191
|
+
status,
|
|
1192
|
+
},
|
|
1193
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1194
|
+
);
|
|
1195
|
+
if (warrning) {
|
|
1196
|
+
Logger({
|
|
1197
|
+
level: "WARN",
|
|
1198
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getCourierPartnerRules \n ${warrning}`,
|
|
1199
|
+
});
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
const query_params = {};
|
|
1203
|
+
query_params["page_no"] = pageNo;
|
|
1204
|
+
query_params["page_size"] = pageSize;
|
|
1205
|
+
query_params["status"] = status;
|
|
1206
|
+
|
|
1207
|
+
const response = await PlatformAPIClient.execute(
|
|
1208
|
+
this.config,
|
|
1209
|
+
"get",
|
|
1210
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/courier-partner/rules`,
|
|
1211
|
+
query_params,
|
|
1212
|
+
undefined,
|
|
1213
|
+
requestHeaders,
|
|
1214
|
+
{ responseHeaders }
|
|
1215
|
+
);
|
|
1216
|
+
|
|
1217
|
+
let responseData = response;
|
|
1218
|
+
if (responseHeaders) {
|
|
1219
|
+
responseData = response[0];
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
const {
|
|
1223
|
+
error: res_error,
|
|
1224
|
+
} = ServiceabilityPlatformModel.CourierPartnerRulesListResult().validate(
|
|
1225
|
+
responseData,
|
|
1226
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1227
|
+
);
|
|
1228
|
+
|
|
1229
|
+
if (res_error) {
|
|
1230
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
1231
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1232
|
+
} else {
|
|
1233
|
+
Logger({
|
|
1234
|
+
level: "WARN",
|
|
1235
|
+
message: `Response Validation Warnings for platform > Serviceability > getCourierPartnerRules \n ${res_error}`,
|
|
1236
|
+
});
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
return response;
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
/**
|
|
1244
|
+
* @param {ServiceabilityPlatformApplicationValidator.GetCourierPartnersParam} arg
|
|
1245
|
+
* - Arg object
|
|
1246
|
+
*
|
|
1247
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1248
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1249
|
+
* @returns {Promise<ServiceabilityPlatformModel.ShipmentCourierPartnerResult>}
|
|
1250
|
+
* - Success response
|
|
1251
|
+
*
|
|
1252
|
+
* @name getCourierPartners
|
|
1253
|
+
* @summary: Serviceable Courier Partners
|
|
1254
|
+
* @description: Get all the serviceable courier partners of a destination and the shipments. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getCourierPartners/).
|
|
1255
|
+
*/
|
|
1256
|
+
async getCourierPartners(
|
|
1257
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
1258
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1259
|
+
) {
|
|
1260
|
+
const {
|
|
1261
|
+
error,
|
|
1262
|
+
} = ServiceabilityPlatformApplicationValidator.getCourierPartners().validate(
|
|
1263
|
+
{
|
|
1264
|
+
body,
|
|
1265
|
+
},
|
|
1266
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1267
|
+
);
|
|
1268
|
+
if (error) {
|
|
1269
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1273
|
+
const {
|
|
1274
|
+
error: warrning,
|
|
1275
|
+
} = ServiceabilityPlatformApplicationValidator.getCourierPartners().validate(
|
|
1276
|
+
{
|
|
1277
|
+
body,
|
|
1278
|
+
},
|
|
1279
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1280
|
+
);
|
|
1281
|
+
if (warrning) {
|
|
1282
|
+
Logger({
|
|
1283
|
+
level: "WARN",
|
|
1284
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getCourierPartners \n ${warrning}`,
|
|
1285
|
+
});
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
const query_params = {};
|
|
1289
|
+
|
|
1290
|
+
const response = await PlatformAPIClient.execute(
|
|
1291
|
+
this.config,
|
|
1292
|
+
"post",
|
|
1293
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/shipment/courier-partners`,
|
|
1294
|
+
query_params,
|
|
1295
|
+
body,
|
|
1296
|
+
requestHeaders,
|
|
1297
|
+
{ responseHeaders }
|
|
1298
|
+
);
|
|
1299
|
+
|
|
1300
|
+
let responseData = response;
|
|
1301
|
+
if (responseHeaders) {
|
|
1302
|
+
responseData = response[0];
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
const {
|
|
1306
|
+
error: res_error,
|
|
1307
|
+
} = ServiceabilityPlatformModel.ShipmentCourierPartnerResult().validate(
|
|
1308
|
+
responseData,
|
|
1309
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1310
|
+
);
|
|
1311
|
+
|
|
1312
|
+
if (res_error) {
|
|
1313
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
1314
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1315
|
+
} else {
|
|
1316
|
+
Logger({
|
|
1317
|
+
level: "WARN",
|
|
1318
|
+
message: `Response Validation Warnings for platform > Serviceability > getCourierPartners \n ${res_error}`,
|
|
1319
|
+
});
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
return response;
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
/**
|
|
1327
|
+
* @param {ServiceabilityPlatformApplicationValidator.GetGeoAreaParam} arg
|
|
1328
|
+
* - Arg object
|
|
1329
|
+
*
|
|
1330
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1331
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1332
|
+
* @returns {Promise<ServiceabilityPlatformModel.GeoAreaDetails>} - Success response
|
|
1333
|
+
* @name getGeoArea
|
|
1334
|
+
* @summary: Get details of the specific geoarea
|
|
1335
|
+
* @description: This API Returns the data of the specific GeoArea which exists on the platform. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getGeoArea/).
|
|
1336
|
+
*/
|
|
1337
|
+
async getGeoArea(
|
|
1338
|
+
{ geoareaId, requestHeaders } = { requestHeaders: {} },
|
|
1339
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1340
|
+
) {
|
|
1341
|
+
const {
|
|
1342
|
+
error,
|
|
1343
|
+
} = ServiceabilityPlatformApplicationValidator.getGeoArea().validate(
|
|
1344
|
+
{
|
|
1345
|
+
geoareaId,
|
|
1346
|
+
},
|
|
1347
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1348
|
+
);
|
|
1349
|
+
if (error) {
|
|
1350
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1354
|
+
const {
|
|
1355
|
+
error: warrning,
|
|
1356
|
+
} = ServiceabilityPlatformApplicationValidator.getGeoArea().validate(
|
|
1357
|
+
{
|
|
1358
|
+
geoareaId,
|
|
1359
|
+
},
|
|
1360
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1361
|
+
);
|
|
1362
|
+
if (warrning) {
|
|
1363
|
+
Logger({
|
|
1364
|
+
level: "WARN",
|
|
1365
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getGeoArea \n ${warrning}`,
|
|
1366
|
+
});
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
const query_params = {};
|
|
1370
|
+
|
|
1371
|
+
const response = await PlatformAPIClient.execute(
|
|
1372
|
+
this.config,
|
|
1373
|
+
"get",
|
|
1374
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/geoareas/${geoareaId}`,
|
|
1375
|
+
query_params,
|
|
1376
|
+
undefined,
|
|
1377
|
+
requestHeaders,
|
|
1378
|
+
{ responseHeaders }
|
|
1379
|
+
);
|
|
1380
|
+
|
|
1381
|
+
let responseData = response;
|
|
1382
|
+
if (responseHeaders) {
|
|
1383
|
+
responseData = response[0];
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1386
|
+
const {
|
|
1387
|
+
error: res_error,
|
|
1388
|
+
} = ServiceabilityPlatformModel.GeoAreaDetails().validate(responseData, {
|
|
1389
|
+
abortEarly: false,
|
|
1390
|
+
allowUnknown: true,
|
|
1391
|
+
});
|
|
1392
|
+
|
|
1393
|
+
if (res_error) {
|
|
1394
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
1395
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1396
|
+
} else {
|
|
1397
|
+
Logger({
|
|
1398
|
+
level: "WARN",
|
|
1399
|
+
message: `Response Validation Warnings for platform > Serviceability > getGeoArea \n ${res_error}`,
|
|
1400
|
+
});
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
return response;
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
/**
|
|
1408
|
+
* @param {ServiceabilityPlatformApplicationValidator.GetGeoAreaExportJobStatusParam} arg
|
|
1409
|
+
* - Arg object
|
|
1410
|
+
*
|
|
1411
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1412
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1413
|
+
* @returns {Promise<ServiceabilityPlatformModel.GeoAreaBulkExportResult>}
|
|
1414
|
+
* - Success response
|
|
1415
|
+
*
|
|
1416
|
+
* @name getGeoAreaExportJobStatus
|
|
1417
|
+
* @summary: Get status of Geoarea export job
|
|
1418
|
+
* @description: Get the status and details of the Geoarea bulk export process. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getGeoAreaExportJobStatus/).
|
|
1419
|
+
*/
|
|
1420
|
+
async getGeoAreaExportJobStatus(
|
|
1421
|
+
{ geoareaId, requestHeaders } = { requestHeaders: {} },
|
|
1422
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1423
|
+
) {
|
|
1424
|
+
const {
|
|
1425
|
+
error,
|
|
1426
|
+
} = ServiceabilityPlatformApplicationValidator.getGeoAreaExportJobStatus().validate(
|
|
1427
|
+
{
|
|
1428
|
+
geoareaId,
|
|
1429
|
+
},
|
|
1430
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1431
|
+
);
|
|
1432
|
+
if (error) {
|
|
1433
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1437
|
+
const {
|
|
1438
|
+
error: warrning,
|
|
1439
|
+
} = ServiceabilityPlatformApplicationValidator.getGeoAreaExportJobStatus().validate(
|
|
1440
|
+
{
|
|
1441
|
+
geoareaId,
|
|
1442
|
+
},
|
|
1443
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1444
|
+
);
|
|
1445
|
+
if (warrning) {
|
|
1446
|
+
Logger({
|
|
1447
|
+
level: "WARN",
|
|
1448
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getGeoAreaExportJobStatus \n ${warrning}`,
|
|
1449
|
+
});
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
const query_params = {};
|
|
1453
|
+
|
|
1454
|
+
const response = await PlatformAPIClient.execute(
|
|
1455
|
+
this.config,
|
|
1456
|
+
"get",
|
|
1457
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/geoareas/bulk/export/${geoareaId}`,
|
|
1458
|
+
query_params,
|
|
1459
|
+
undefined,
|
|
1460
|
+
requestHeaders,
|
|
1461
|
+
{ responseHeaders }
|
|
1462
|
+
);
|
|
1463
|
+
|
|
1464
|
+
let responseData = response;
|
|
1465
|
+
if (responseHeaders) {
|
|
1466
|
+
responseData = response[0];
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
const {
|
|
1470
|
+
error: res_error,
|
|
1471
|
+
} = ServiceabilityPlatformModel.GeoAreaBulkExportResult().validate(
|
|
1472
|
+
responseData,
|
|
1473
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1474
|
+
);
|
|
1475
|
+
|
|
1476
|
+
if (res_error) {
|
|
1477
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
1478
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1479
|
+
} else {
|
|
1480
|
+
Logger({
|
|
1481
|
+
level: "WARN",
|
|
1482
|
+
message: `Response Validation Warnings for platform > Serviceability > getGeoAreaExportJobStatus \n ${res_error}`,
|
|
1483
|
+
});
|
|
1484
|
+
}
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
return response;
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
/**
|
|
1491
|
+
* @param {ServiceabilityPlatformApplicationValidator.GetGeoAreasParam} arg
|
|
1492
|
+
* - Arg object
|
|
1493
|
+
*
|
|
1494
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1495
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1496
|
+
* @returns {Promise<ServiceabilityPlatformModel.GeoAreaGetResponseBody>} -
|
|
1497
|
+
* Success response
|
|
1498
|
+
* @name getGeoAreas
|
|
1499
|
+
* @summary: Get all geoareas in the current application
|
|
1500
|
+
* @description: Retrieves a listing view of created GeoAreas. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getGeoAreas/).
|
|
1501
|
+
*/
|
|
1502
|
+
async getGeoAreas(
|
|
1503
|
+
{
|
|
1504
|
+
pageSize,
|
|
1505
|
+
isActive,
|
|
1506
|
+
pageNo,
|
|
1507
|
+
type,
|
|
1508
|
+
q,
|
|
1509
|
+
countryIsoCode,
|
|
1510
|
+
state,
|
|
1511
|
+
city,
|
|
1512
|
+
pincode,
|
|
1513
|
+
sector,
|
|
1514
|
+
requestHeaders,
|
|
1515
|
+
} = { requestHeaders: {} },
|
|
1516
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1517
|
+
) {
|
|
1518
|
+
const {
|
|
1519
|
+
error,
|
|
1520
|
+
} = ServiceabilityPlatformApplicationValidator.getGeoAreas().validate(
|
|
1521
|
+
{
|
|
1522
|
+
pageSize,
|
|
1523
|
+
isActive,
|
|
1524
|
+
pageNo,
|
|
1525
|
+
type,
|
|
1526
|
+
q,
|
|
1527
|
+
countryIsoCode,
|
|
1528
|
+
state,
|
|
1529
|
+
city,
|
|
1530
|
+
pincode,
|
|
1531
|
+
sector,
|
|
1532
|
+
},
|
|
1533
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1534
|
+
);
|
|
1535
|
+
if (error) {
|
|
1536
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1540
|
+
const {
|
|
1541
|
+
error: warrning,
|
|
1542
|
+
} = ServiceabilityPlatformApplicationValidator.getGeoAreas().validate(
|
|
1543
|
+
{
|
|
1544
|
+
pageSize,
|
|
1545
|
+
isActive,
|
|
1546
|
+
pageNo,
|
|
1547
|
+
type,
|
|
1548
|
+
q,
|
|
1549
|
+
countryIsoCode,
|
|
1550
|
+
state,
|
|
1551
|
+
city,
|
|
1552
|
+
pincode,
|
|
1553
|
+
sector,
|
|
1554
|
+
},
|
|
1555
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1556
|
+
);
|
|
1557
|
+
if (warrning) {
|
|
1558
|
+
Logger({
|
|
1559
|
+
level: "WARN",
|
|
1560
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getGeoAreas \n ${warrning}`,
|
|
1561
|
+
});
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1564
|
+
const query_params = {};
|
|
1565
|
+
query_params["page_size"] = pageSize;
|
|
1566
|
+
query_params["is_active"] = isActive;
|
|
1567
|
+
query_params["page_no"] = pageNo;
|
|
1568
|
+
query_params["type"] = type;
|
|
1569
|
+
query_params["q"] = q;
|
|
1570
|
+
query_params["country_iso_code"] = countryIsoCode;
|
|
1571
|
+
query_params["state"] = state;
|
|
1572
|
+
query_params["city"] = city;
|
|
1573
|
+
query_params["pincode"] = pincode;
|
|
1574
|
+
query_params["sector"] = sector;
|
|
1575
|
+
|
|
1576
|
+
const response = await PlatformAPIClient.execute(
|
|
1577
|
+
this.config,
|
|
1578
|
+
"get",
|
|
1579
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/geoareas`,
|
|
1580
|
+
query_params,
|
|
1581
|
+
undefined,
|
|
1582
|
+
requestHeaders,
|
|
1583
|
+
{ responseHeaders }
|
|
1584
|
+
);
|
|
1585
|
+
|
|
1586
|
+
let responseData = response;
|
|
1587
|
+
if (responseHeaders) {
|
|
1588
|
+
responseData = response[0];
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
const {
|
|
1592
|
+
error: res_error,
|
|
1593
|
+
} = ServiceabilityPlatformModel.GeoAreaGetResponseBody().validate(
|
|
1594
|
+
responseData,
|
|
1595
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1596
|
+
);
|
|
1597
|
+
|
|
1598
|
+
if (res_error) {
|
|
1599
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
1600
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1601
|
+
} else {
|
|
1602
|
+
Logger({
|
|
1603
|
+
level: "WARN",
|
|
1604
|
+
message: `Response Validation Warnings for platform > Serviceability > getGeoAreas \n ${res_error}`,
|
|
1605
|
+
});
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1609
|
+
return response;
|
|
1610
|
+
}
|
|
1611
|
+
|
|
1612
|
+
/**
|
|
1613
|
+
* @param {ServiceabilityPlatformApplicationValidator.GetStoreRuleParam} arg
|
|
1614
|
+
* - Arg object
|
|
1615
|
+
*
|
|
1616
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1617
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1618
|
+
* @returns {Promise<ServiceabilityPlatformModel.StoreRuleDataSchema>} -
|
|
1619
|
+
* Success response
|
|
1620
|
+
* @name getStoreRule
|
|
1621
|
+
* @summary: Get store rule
|
|
1622
|
+
* @description: Retrieves a single rule within the order routing rules - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getStoreRule/).
|
|
1623
|
+
*/
|
|
1624
|
+
async getStoreRule(
|
|
1625
|
+
{ ruleUid, requestHeaders } = { requestHeaders: {} },
|
|
1626
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1627
|
+
) {
|
|
1628
|
+
const {
|
|
1629
|
+
error,
|
|
1630
|
+
} = ServiceabilityPlatformApplicationValidator.getStoreRule().validate(
|
|
1631
|
+
{
|
|
1632
|
+
ruleUid,
|
|
1633
|
+
},
|
|
1634
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1635
|
+
);
|
|
1636
|
+
if (error) {
|
|
1637
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1641
|
+
const {
|
|
1642
|
+
error: warrning,
|
|
1643
|
+
} = ServiceabilityPlatformApplicationValidator.getStoreRule().validate(
|
|
1644
|
+
{
|
|
1645
|
+
ruleUid,
|
|
1646
|
+
},
|
|
1647
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1648
|
+
);
|
|
1649
|
+
if (warrning) {
|
|
1650
|
+
Logger({
|
|
1651
|
+
level: "WARN",
|
|
1652
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getStoreRule \n ${warrning}`,
|
|
1653
|
+
});
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
const query_params = {};
|
|
1657
|
+
|
|
1658
|
+
const response = await PlatformAPIClient.execute(
|
|
1659
|
+
this.config,
|
|
1660
|
+
"get",
|
|
1661
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/store/rules/${ruleUid}`,
|
|
1662
|
+
query_params,
|
|
1663
|
+
undefined,
|
|
1664
|
+
requestHeaders,
|
|
1665
|
+
{ responseHeaders }
|
|
1666
|
+
);
|
|
1667
|
+
|
|
1668
|
+
let responseData = response;
|
|
1669
|
+
if (responseHeaders) {
|
|
1670
|
+
responseData = response[0];
|
|
1671
|
+
}
|
|
1672
|
+
|
|
1673
|
+
const {
|
|
1674
|
+
error: res_error,
|
|
1675
|
+
} = ServiceabilityPlatformModel.StoreRuleDataSchema().validate(
|
|
1676
|
+
responseData,
|
|
1677
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1678
|
+
);
|
|
1679
|
+
|
|
1680
|
+
if (res_error) {
|
|
1681
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
1682
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1683
|
+
} else {
|
|
1684
|
+
Logger({
|
|
1685
|
+
level: "WARN",
|
|
1686
|
+
message: `Response Validation Warnings for platform > Serviceability > getStoreRule \n ${res_error}`,
|
|
1687
|
+
});
|
|
1688
|
+
}
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1691
|
+
return response;
|
|
1692
|
+
}
|
|
1693
|
+
|
|
1694
|
+
/**
|
|
1695
|
+
* @param {ServiceabilityPlatformApplicationValidator.GetStoreRulesParam} arg
|
|
1696
|
+
* - Arg object
|
|
1697
|
+
*
|
|
1698
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1699
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1700
|
+
* @returns {Promise<ServiceabilityPlatformModel.GetStoreRulesApiResult>} -
|
|
1701
|
+
* Success response
|
|
1702
|
+
* @name getStoreRules
|
|
1703
|
+
* @summary: Get store rules
|
|
1704
|
+
* @description: Retrieves an existing order routing setup for a single application - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getStoreRules/).
|
|
1705
|
+
*/
|
|
1706
|
+
async getStoreRules(
|
|
1707
|
+
{ pageNo, pageSize, status, requestHeaders } = { requestHeaders: {} },
|
|
1708
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1709
|
+
) {
|
|
1710
|
+
const {
|
|
1711
|
+
error,
|
|
1712
|
+
} = ServiceabilityPlatformApplicationValidator.getStoreRules().validate(
|
|
1713
|
+
{
|
|
1714
|
+
pageNo,
|
|
1715
|
+
pageSize,
|
|
1716
|
+
status,
|
|
1717
|
+
},
|
|
1718
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1719
|
+
);
|
|
1720
|
+
if (error) {
|
|
1721
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1722
|
+
}
|
|
1723
|
+
|
|
1724
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1725
|
+
const {
|
|
1726
|
+
error: warrning,
|
|
1727
|
+
} = ServiceabilityPlatformApplicationValidator.getStoreRules().validate(
|
|
1728
|
+
{
|
|
1729
|
+
pageNo,
|
|
1730
|
+
pageSize,
|
|
1731
|
+
status,
|
|
1732
|
+
},
|
|
1733
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1734
|
+
);
|
|
1735
|
+
if (warrning) {
|
|
1736
|
+
Logger({
|
|
1737
|
+
level: "WARN",
|
|
1738
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getStoreRules \n ${warrning}`,
|
|
1739
|
+
});
|
|
1740
|
+
}
|
|
1741
|
+
|
|
1742
|
+
const query_params = {};
|
|
1743
|
+
query_params["page_no"] = pageNo;
|
|
1744
|
+
query_params["page_size"] = pageSize;
|
|
1745
|
+
query_params["status"] = status;
|
|
1746
|
+
|
|
1747
|
+
const response = await PlatformAPIClient.execute(
|
|
1748
|
+
this.config,
|
|
1749
|
+
"get",
|
|
1750
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/store/rules`,
|
|
1751
|
+
query_params,
|
|
1752
|
+
undefined,
|
|
1753
|
+
requestHeaders,
|
|
1754
|
+
{ responseHeaders }
|
|
1755
|
+
);
|
|
1756
|
+
|
|
1757
|
+
let responseData = response;
|
|
1758
|
+
if (responseHeaders) {
|
|
1759
|
+
responseData = response[0];
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
const {
|
|
1763
|
+
error: res_error,
|
|
1764
|
+
} = ServiceabilityPlatformModel.GetStoreRulesApiResult().validate(
|
|
1765
|
+
responseData,
|
|
1766
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1767
|
+
);
|
|
1768
|
+
|
|
1769
|
+
if (res_error) {
|
|
1770
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
1771
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1772
|
+
} else {
|
|
1773
|
+
Logger({
|
|
1774
|
+
level: "WARN",
|
|
1775
|
+
message: `Response Validation Warnings for platform > Serviceability > getStoreRules \n ${res_error}`,
|
|
1776
|
+
});
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
|
|
1780
|
+
return response;
|
|
1781
|
+
}
|
|
1782
|
+
|
|
1783
|
+
/**
|
|
1784
|
+
* @param {ServiceabilityPlatformApplicationValidator.GetZoneParam} arg - Arg object
|
|
1785
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1786
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1787
|
+
* @returns {Promise<ServiceabilityPlatformModel.GetZoneByIdSchema>} -
|
|
1788
|
+
* Success response
|
|
1789
|
+
* @name getZone
|
|
1790
|
+
* @summary: Get zone details
|
|
1791
|
+
* @description: Retrieves a single delivery zone - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getZone/).
|
|
1792
|
+
*/
|
|
1793
|
+
async getZone(
|
|
1794
|
+
{ zoneId, requestHeaders } = { requestHeaders: {} },
|
|
1795
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1796
|
+
) {
|
|
1797
|
+
const {
|
|
1798
|
+
error,
|
|
1799
|
+
} = ServiceabilityPlatformApplicationValidator.getZone().validate(
|
|
1800
|
+
{
|
|
1801
|
+
zoneId,
|
|
1802
|
+
},
|
|
1803
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1804
|
+
);
|
|
1805
|
+
if (error) {
|
|
1806
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1807
|
+
}
|
|
1808
|
+
|
|
1809
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1810
|
+
const {
|
|
1811
|
+
error: warrning,
|
|
1812
|
+
} = ServiceabilityPlatformApplicationValidator.getZone().validate(
|
|
1813
|
+
{
|
|
1814
|
+
zoneId,
|
|
1815
|
+
},
|
|
1816
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1817
|
+
);
|
|
1818
|
+
if (warrning) {
|
|
1819
|
+
Logger({
|
|
1820
|
+
level: "WARN",
|
|
1821
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getZone \n ${warrning}`,
|
|
1822
|
+
});
|
|
1823
|
+
}
|
|
1824
|
+
|
|
1825
|
+
const query_params = {};
|
|
1826
|
+
|
|
1827
|
+
const response = await PlatformAPIClient.execute(
|
|
1828
|
+
this.config,
|
|
1829
|
+
"get",
|
|
1830
|
+
`/service/platform/logistics/v2.0/company/${this.config.companyId}/application/${this.applicationId}/zones/${zoneId}`,
|
|
1831
|
+
query_params,
|
|
1832
|
+
undefined,
|
|
1833
|
+
requestHeaders,
|
|
1834
|
+
{ responseHeaders }
|
|
1835
|
+
);
|
|
1836
|
+
|
|
1837
|
+
let responseData = response;
|
|
1838
|
+
if (responseHeaders) {
|
|
1839
|
+
responseData = response[0];
|
|
1840
|
+
}
|
|
1841
|
+
|
|
1842
|
+
const {
|
|
1843
|
+
error: res_error,
|
|
1844
|
+
} = ServiceabilityPlatformModel.GetZoneByIdSchema().validate(responseData, {
|
|
1845
|
+
abortEarly: false,
|
|
1846
|
+
allowUnknown: true,
|
|
1847
|
+
});
|
|
1848
|
+
|
|
1849
|
+
if (res_error) {
|
|
1850
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
1851
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1852
|
+
} else {
|
|
1853
|
+
Logger({
|
|
1854
|
+
level: "WARN",
|
|
1855
|
+
message: `Response Validation Warnings for platform > Serviceability > getZone \n ${res_error}`,
|
|
1856
|
+
});
|
|
1857
|
+
}
|
|
1858
|
+
}
|
|
1859
|
+
|
|
1860
|
+
return response;
|
|
1861
|
+
}
|
|
1862
|
+
|
|
1863
|
+
/**
|
|
1864
|
+
* @param {ServiceabilityPlatformApplicationValidator.GetZonesParam} arg - Arg object
|
|
1865
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1866
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1867
|
+
* @returns {Promise<ServiceabilityPlatformModel.ListViewSchema>} - Success response
|
|
1868
|
+
* @name getZones
|
|
1869
|
+
* @summary: Get zones
|
|
1870
|
+
* @description: Retrieves a list of delivery zones. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getZones/).
|
|
1871
|
+
*/
|
|
1872
|
+
async getZones(
|
|
1873
|
+
{
|
|
1874
|
+
stage,
|
|
1875
|
+
pageSize,
|
|
1876
|
+
pageNo,
|
|
1877
|
+
isActive,
|
|
1878
|
+
q,
|
|
1879
|
+
countryIsoCode,
|
|
1880
|
+
pincode,
|
|
1881
|
+
state,
|
|
1882
|
+
city,
|
|
1883
|
+
sector,
|
|
1884
|
+
requestHeaders,
|
|
1885
|
+
} = { requestHeaders: {} },
|
|
1886
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1887
|
+
) {
|
|
1888
|
+
const {
|
|
1889
|
+
error,
|
|
1890
|
+
} = ServiceabilityPlatformApplicationValidator.getZones().validate(
|
|
1891
|
+
{
|
|
1892
|
+
stage,
|
|
1893
|
+
pageSize,
|
|
791
1894
|
pageNo,
|
|
1895
|
+
isActive,
|
|
1896
|
+
q,
|
|
1897
|
+
countryIsoCode,
|
|
1898
|
+
pincode,
|
|
1899
|
+
state,
|
|
1900
|
+
city,
|
|
1901
|
+
sector,
|
|
1902
|
+
},
|
|
1903
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1904
|
+
);
|
|
1905
|
+
if (error) {
|
|
1906
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1907
|
+
}
|
|
1908
|
+
|
|
1909
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1910
|
+
const {
|
|
1911
|
+
error: warrning,
|
|
1912
|
+
} = ServiceabilityPlatformApplicationValidator.getZones().validate(
|
|
1913
|
+
{
|
|
1914
|
+
stage,
|
|
792
1915
|
pageSize,
|
|
793
|
-
|
|
1916
|
+
pageNo,
|
|
1917
|
+
isActive,
|
|
1918
|
+
q,
|
|
1919
|
+
countryIsoCode,
|
|
1920
|
+
pincode,
|
|
1921
|
+
state,
|
|
1922
|
+
city,
|
|
1923
|
+
sector,
|
|
794
1924
|
},
|
|
795
1925
|
{ abortEarly: false, allowUnknown: false }
|
|
796
1926
|
);
|
|
797
1927
|
if (warrning) {
|
|
798
1928
|
Logger({
|
|
799
1929
|
level: "WARN",
|
|
800
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
1930
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getZones \n ${warrning}`,
|
|
801
1931
|
});
|
|
802
1932
|
}
|
|
803
1933
|
|
|
804
1934
|
const query_params = {};
|
|
805
|
-
query_params["
|
|
1935
|
+
query_params["stage"] = stage;
|
|
806
1936
|
query_params["page_size"] = pageSize;
|
|
807
|
-
query_params["
|
|
1937
|
+
query_params["page_no"] = pageNo;
|
|
1938
|
+
query_params["is_active"] = isActive;
|
|
1939
|
+
query_params["q"] = q;
|
|
1940
|
+
query_params["country_iso_code"] = countryIsoCode;
|
|
1941
|
+
query_params["pincode"] = pincode;
|
|
1942
|
+
query_params["state"] = state;
|
|
1943
|
+
query_params["city"] = city;
|
|
1944
|
+
query_params["sector"] = sector;
|
|
808
1945
|
|
|
809
1946
|
const response = await PlatformAPIClient.execute(
|
|
810
1947
|
this.config,
|
|
811
1948
|
"get",
|
|
812
|
-
`/service/platform/logistics/
|
|
1949
|
+
`/service/platform/logistics/v2.0/company/${this.config.companyId}/application/${this.applicationId}/zones`,
|
|
1950
|
+
query_params,
|
|
1951
|
+
undefined,
|
|
1952
|
+
requestHeaders,
|
|
1953
|
+
{ responseHeaders }
|
|
1954
|
+
);
|
|
1955
|
+
|
|
1956
|
+
let responseData = response;
|
|
1957
|
+
if (responseHeaders) {
|
|
1958
|
+
responseData = response[0];
|
|
1959
|
+
}
|
|
1960
|
+
|
|
1961
|
+
const {
|
|
1962
|
+
error: res_error,
|
|
1963
|
+
} = ServiceabilityPlatformModel.ListViewSchema().validate(responseData, {
|
|
1964
|
+
abortEarly: false,
|
|
1965
|
+
allowUnknown: true,
|
|
1966
|
+
});
|
|
1967
|
+
|
|
1968
|
+
if (res_error) {
|
|
1969
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
1970
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1971
|
+
} else {
|
|
1972
|
+
Logger({
|
|
1973
|
+
level: "WARN",
|
|
1974
|
+
message: `Response Validation Warnings for platform > Serviceability > getZones \n ${res_error}`,
|
|
1975
|
+
});
|
|
1976
|
+
}
|
|
1977
|
+
}
|
|
1978
|
+
|
|
1979
|
+
return response;
|
|
1980
|
+
}
|
|
1981
|
+
|
|
1982
|
+
/**
|
|
1983
|
+
* @param {ServiceabilityPlatformApplicationValidator.InsertApplicationConfigParam} arg
|
|
1984
|
+
* - Arg object
|
|
1985
|
+
*
|
|
1986
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1987
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1988
|
+
* @returns {Promise<ServiceabilityPlatformModel.StoreRuleConfigData>} -
|
|
1989
|
+
* Success response
|
|
1990
|
+
* @name insertApplicationConfig
|
|
1991
|
+
* @summary: Create store rule configuration
|
|
1992
|
+
* @description: Creates a order routing setup for an application, which involves updating sorting settings or rule priorities. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/insertApplicationConfig/).
|
|
1993
|
+
*/
|
|
1994
|
+
async insertApplicationConfig(
|
|
1995
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
1996
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1997
|
+
) {
|
|
1998
|
+
const {
|
|
1999
|
+
error,
|
|
2000
|
+
} = ServiceabilityPlatformApplicationValidator.insertApplicationConfig().validate(
|
|
2001
|
+
{
|
|
2002
|
+
body,
|
|
2003
|
+
},
|
|
2004
|
+
{ abortEarly: false, allowUnknown: true }
|
|
2005
|
+
);
|
|
2006
|
+
if (error) {
|
|
2007
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
2008
|
+
}
|
|
2009
|
+
|
|
2010
|
+
// Showing warrnings if extra unknown parameters are found
|
|
2011
|
+
const {
|
|
2012
|
+
error: warrning,
|
|
2013
|
+
} = ServiceabilityPlatformApplicationValidator.insertApplicationConfig().validate(
|
|
2014
|
+
{
|
|
2015
|
+
body,
|
|
2016
|
+
},
|
|
2017
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2018
|
+
);
|
|
2019
|
+
if (warrning) {
|
|
2020
|
+
Logger({
|
|
2021
|
+
level: "WARN",
|
|
2022
|
+
message: `Parameter Validation warrnings for platform > Serviceability > insertApplicationConfig \n ${warrning}`,
|
|
2023
|
+
});
|
|
2024
|
+
}
|
|
2025
|
+
|
|
2026
|
+
const query_params = {};
|
|
2027
|
+
|
|
2028
|
+
const response = await PlatformAPIClient.execute(
|
|
2029
|
+
this.config,
|
|
2030
|
+
"post",
|
|
2031
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/store/configuration`,
|
|
2032
|
+
query_params,
|
|
2033
|
+
body,
|
|
2034
|
+
requestHeaders,
|
|
2035
|
+
{ responseHeaders }
|
|
2036
|
+
);
|
|
2037
|
+
|
|
2038
|
+
let responseData = response;
|
|
2039
|
+
if (responseHeaders) {
|
|
2040
|
+
responseData = response[0];
|
|
2041
|
+
}
|
|
2042
|
+
|
|
2043
|
+
const {
|
|
2044
|
+
error: res_error,
|
|
2045
|
+
} = ServiceabilityPlatformModel.StoreRuleConfigData().validate(
|
|
2046
|
+
responseData,
|
|
2047
|
+
{ abortEarly: false, allowUnknown: true }
|
|
2048
|
+
);
|
|
2049
|
+
|
|
2050
|
+
if (res_error) {
|
|
2051
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
2052
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2053
|
+
} else {
|
|
2054
|
+
Logger({
|
|
2055
|
+
level: "WARN",
|
|
2056
|
+
message: `Response Validation Warnings for platform > Serviceability > insertApplicationConfig \n ${res_error}`,
|
|
2057
|
+
});
|
|
2058
|
+
}
|
|
2059
|
+
}
|
|
2060
|
+
|
|
2061
|
+
return response;
|
|
2062
|
+
}
|
|
2063
|
+
|
|
2064
|
+
/**
|
|
2065
|
+
* @param {ServiceabilityPlatformApplicationValidator.PatchApplicationConfigurationParam} arg
|
|
2066
|
+
* - Arg object
|
|
2067
|
+
*
|
|
2068
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2069
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2070
|
+
* @returns {Promise<ServiceabilityPlatformModel.ApplicationConfigPatchResult>}
|
|
2071
|
+
* - Success response
|
|
2072
|
+
*
|
|
2073
|
+
* @name patchApplicationConfiguration
|
|
2074
|
+
* @summary: To patch any config which can be applied to application
|
|
2075
|
+
* @description: Apply configs to application. Supports patching for buybox rule config and promise config. For reference, refer to examples - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/patchApplicationConfiguration/).
|
|
2076
|
+
*/
|
|
2077
|
+
async patchApplicationConfiguration(
|
|
2078
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
2079
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
2080
|
+
) {
|
|
2081
|
+
const {
|
|
2082
|
+
error,
|
|
2083
|
+
} = ServiceabilityPlatformApplicationValidator.patchApplicationConfiguration().validate(
|
|
2084
|
+
{
|
|
2085
|
+
body,
|
|
2086
|
+
},
|
|
2087
|
+
{ abortEarly: false, allowUnknown: true }
|
|
2088
|
+
);
|
|
2089
|
+
if (error) {
|
|
2090
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
2091
|
+
}
|
|
2092
|
+
|
|
2093
|
+
// Showing warrnings if extra unknown parameters are found
|
|
2094
|
+
const {
|
|
2095
|
+
error: warrning,
|
|
2096
|
+
} = ServiceabilityPlatformApplicationValidator.patchApplicationConfiguration().validate(
|
|
2097
|
+
{
|
|
2098
|
+
body,
|
|
2099
|
+
},
|
|
2100
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2101
|
+
);
|
|
2102
|
+
if (warrning) {
|
|
2103
|
+
Logger({
|
|
2104
|
+
level: "WARN",
|
|
2105
|
+
message: `Parameter Validation warrnings for platform > Serviceability > patchApplicationConfiguration \n ${warrning}`,
|
|
2106
|
+
});
|
|
2107
|
+
}
|
|
2108
|
+
|
|
2109
|
+
const query_params = {};
|
|
2110
|
+
|
|
2111
|
+
const response = await PlatformAPIClient.execute(
|
|
2112
|
+
this.config,
|
|
2113
|
+
"patch",
|
|
2114
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/configuration`,
|
|
813
2115
|
query_params,
|
|
814
|
-
|
|
2116
|
+
body,
|
|
815
2117
|
requestHeaders,
|
|
816
2118
|
{ responseHeaders }
|
|
817
2119
|
);
|
|
@@ -823,7 +2125,7 @@ class Serviceability {
|
|
|
823
2125
|
|
|
824
2126
|
const {
|
|
825
2127
|
error: res_error,
|
|
826
|
-
} = ServiceabilityPlatformModel.
|
|
2128
|
+
} = ServiceabilityPlatformModel.ApplicationConfigPatchResult().validate(
|
|
827
2129
|
responseData,
|
|
828
2130
|
{ abortEarly: false, allowUnknown: true }
|
|
829
2131
|
);
|
|
@@ -834,7 +2136,7 @@ class Serviceability {
|
|
|
834
2136
|
} else {
|
|
835
2137
|
Logger({
|
|
836
2138
|
level: "WARN",
|
|
837
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
2139
|
+
message: `Response Validation Warnings for platform > Serviceability > patchApplicationConfiguration \n ${res_error}`,
|
|
838
2140
|
});
|
|
839
2141
|
}
|
|
840
2142
|
}
|
|
@@ -843,24 +2145,24 @@ class Serviceability {
|
|
|
843
2145
|
}
|
|
844
2146
|
|
|
845
2147
|
/**
|
|
846
|
-
* @param {ServiceabilityPlatformApplicationValidator.
|
|
2148
|
+
* @param {ServiceabilityPlatformApplicationValidator.UpdateApplicationConfigurationParam} arg
|
|
847
2149
|
* - Arg object
|
|
848
2150
|
*
|
|
849
2151
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
850
2152
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
851
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
2153
|
+
* @returns {Promise<ServiceabilityPlatformModel.ApplicationConfigPut>} -
|
|
852
2154
|
* Success response
|
|
853
|
-
* @name
|
|
854
|
-
* @summary:
|
|
855
|
-
* @description:
|
|
2155
|
+
* @name updateApplicationConfiguration
|
|
2156
|
+
* @summary: Apply configuration to an application
|
|
2157
|
+
* @description: Apply configuration to application to set DP rules and Zone configuration - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/updateApplicationConfiguration/).
|
|
856
2158
|
*/
|
|
857
|
-
async
|
|
2159
|
+
async updateApplicationConfiguration(
|
|
858
2160
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
859
2161
|
{ responseHeaders } = { responseHeaders: false }
|
|
860
2162
|
) {
|
|
861
2163
|
const {
|
|
862
2164
|
error,
|
|
863
|
-
} = ServiceabilityPlatformApplicationValidator.
|
|
2165
|
+
} = ServiceabilityPlatformApplicationValidator.updateApplicationConfiguration().validate(
|
|
864
2166
|
{
|
|
865
2167
|
body,
|
|
866
2168
|
},
|
|
@@ -873,7 +2175,7 @@ class Serviceability {
|
|
|
873
2175
|
// Showing warrnings if extra unknown parameters are found
|
|
874
2176
|
const {
|
|
875
2177
|
error: warrning,
|
|
876
|
-
} = ServiceabilityPlatformApplicationValidator.
|
|
2178
|
+
} = ServiceabilityPlatformApplicationValidator.updateApplicationConfiguration().validate(
|
|
877
2179
|
{
|
|
878
2180
|
body,
|
|
879
2181
|
},
|
|
@@ -882,7 +2184,7 @@ class Serviceability {
|
|
|
882
2184
|
if (warrning) {
|
|
883
2185
|
Logger({
|
|
884
2186
|
level: "WARN",
|
|
885
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
2187
|
+
message: `Parameter Validation warrnings for platform > Serviceability > updateApplicationConfiguration \n ${warrning}`,
|
|
886
2188
|
});
|
|
887
2189
|
}
|
|
888
2190
|
|
|
@@ -890,8 +2192,8 @@ class Serviceability {
|
|
|
890
2192
|
|
|
891
2193
|
const response = await PlatformAPIClient.execute(
|
|
892
2194
|
this.config,
|
|
893
|
-
"
|
|
894
|
-
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
2195
|
+
"put",
|
|
2196
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/configuration`,
|
|
895
2197
|
query_params,
|
|
896
2198
|
body,
|
|
897
2199
|
requestHeaders,
|
|
@@ -905,7 +2207,7 @@ class Serviceability {
|
|
|
905
2207
|
|
|
906
2208
|
const {
|
|
907
2209
|
error: res_error,
|
|
908
|
-
} = ServiceabilityPlatformModel.
|
|
2210
|
+
} = ServiceabilityPlatformModel.ApplicationConfigPut().validate(
|
|
909
2211
|
responseData,
|
|
910
2212
|
{ abortEarly: false, allowUnknown: true }
|
|
911
2213
|
);
|
|
@@ -916,7 +2218,7 @@ class Serviceability {
|
|
|
916
2218
|
} else {
|
|
917
2219
|
Logger({
|
|
918
2220
|
level: "WARN",
|
|
919
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
2221
|
+
message: `Response Validation Warnings for platform > Serviceability > updateApplicationConfiguration \n ${res_error}`,
|
|
920
2222
|
});
|
|
921
2223
|
}
|
|
922
2224
|
}
|
|
@@ -925,26 +2227,26 @@ class Serviceability {
|
|
|
925
2227
|
}
|
|
926
2228
|
|
|
927
2229
|
/**
|
|
928
|
-
* @param {ServiceabilityPlatformApplicationValidator.
|
|
2230
|
+
* @param {ServiceabilityPlatformApplicationValidator.UpdateBulkGeoAreaParam} arg
|
|
929
2231
|
* - Arg object
|
|
930
2232
|
*
|
|
931
2233
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
932
2234
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
933
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
934
|
-
*
|
|
935
|
-
*
|
|
936
|
-
* @
|
|
937
|
-
* @
|
|
938
|
-
* @description: Updates self ship setup for an existing application - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/patchApplicationServiceabilitySelfShipment/).
|
|
2235
|
+
* @returns {Promise<ServiceabilityPlatformModel.BulkGeoAreaResult>} -
|
|
2236
|
+
* Success response
|
|
2237
|
+
* @name updateBulkGeoArea
|
|
2238
|
+
* @summary: Update geoareas and their associated regions in bulk
|
|
2239
|
+
* @description: Update geoarea details and their associated regions through a CSV file in bulk. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/updateBulkGeoArea/).
|
|
939
2240
|
*/
|
|
940
|
-
async
|
|
941
|
-
{ body, requestHeaders } = { requestHeaders: {} },
|
|
2241
|
+
async updateBulkGeoArea(
|
|
2242
|
+
{ geoareaId, body, requestHeaders } = { requestHeaders: {} },
|
|
942
2243
|
{ responseHeaders } = { responseHeaders: false }
|
|
943
2244
|
) {
|
|
944
2245
|
const {
|
|
945
2246
|
error,
|
|
946
|
-
} = ServiceabilityPlatformApplicationValidator.
|
|
2247
|
+
} = ServiceabilityPlatformApplicationValidator.updateBulkGeoArea().validate(
|
|
947
2248
|
{
|
|
2249
|
+
geoareaId,
|
|
948
2250
|
body,
|
|
949
2251
|
},
|
|
950
2252
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -956,8 +2258,9 @@ class Serviceability {
|
|
|
956
2258
|
// Showing warrnings if extra unknown parameters are found
|
|
957
2259
|
const {
|
|
958
2260
|
error: warrning,
|
|
959
|
-
} = ServiceabilityPlatformApplicationValidator.
|
|
2261
|
+
} = ServiceabilityPlatformApplicationValidator.updateBulkGeoArea().validate(
|
|
960
2262
|
{
|
|
2263
|
+
geoareaId,
|
|
961
2264
|
body,
|
|
962
2265
|
},
|
|
963
2266
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -965,7 +2268,7 @@ class Serviceability {
|
|
|
965
2268
|
if (warrning) {
|
|
966
2269
|
Logger({
|
|
967
2270
|
level: "WARN",
|
|
968
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
2271
|
+
message: `Parameter Validation warrnings for platform > Serviceability > updateBulkGeoArea \n ${warrning}`,
|
|
969
2272
|
});
|
|
970
2273
|
}
|
|
971
2274
|
|
|
@@ -973,8 +2276,8 @@ class Serviceability {
|
|
|
973
2276
|
|
|
974
2277
|
const response = await PlatformAPIClient.execute(
|
|
975
2278
|
this.config,
|
|
976
|
-
"
|
|
977
|
-
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
2279
|
+
"put",
|
|
2280
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/geoareas/regions/bulk/${geoareaId}`,
|
|
978
2281
|
query_params,
|
|
979
2282
|
body,
|
|
980
2283
|
requestHeaders,
|
|
@@ -988,10 +2291,10 @@ class Serviceability {
|
|
|
988
2291
|
|
|
989
2292
|
const {
|
|
990
2293
|
error: res_error,
|
|
991
|
-
} = ServiceabilityPlatformModel.
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
);
|
|
2294
|
+
} = ServiceabilityPlatformModel.BulkGeoAreaResult().validate(responseData, {
|
|
2295
|
+
abortEarly: false,
|
|
2296
|
+
allowUnknown: true,
|
|
2297
|
+
});
|
|
995
2298
|
|
|
996
2299
|
if (res_error) {
|
|
997
2300
|
if (this.config.options.strictResponseCheck === true) {
|
|
@@ -999,7 +2302,7 @@ class Serviceability {
|
|
|
999
2302
|
} else {
|
|
1000
2303
|
Logger({
|
|
1001
2304
|
level: "WARN",
|
|
1002
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
2305
|
+
message: `Response Validation Warnings for platform > Serviceability > updateBulkGeoArea \n ${res_error}`,
|
|
1003
2306
|
});
|
|
1004
2307
|
}
|
|
1005
2308
|
}
|
|
@@ -1008,24 +2311,24 @@ class Serviceability {
|
|
|
1008
2311
|
}
|
|
1009
2312
|
|
|
1010
2313
|
/**
|
|
1011
|
-
* @param {ServiceabilityPlatformApplicationValidator.
|
|
2314
|
+
* @param {ServiceabilityPlatformApplicationValidator.UpdateCourierPartnerRulePriorityParam} arg
|
|
1012
2315
|
* - Arg object
|
|
1013
2316
|
*
|
|
1014
2317
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1015
2318
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1016
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
2319
|
+
* @returns {Promise<ServiceabilityPlatformModel.RulePriorityResult>} -
|
|
1017
2320
|
* Success response
|
|
1018
|
-
* @name
|
|
1019
|
-
* @summary: Update
|
|
1020
|
-
* @description: Updates
|
|
2321
|
+
* @name updateCourierPartnerRulePriority
|
|
2322
|
+
* @summary: Update courier partner rule priority
|
|
2323
|
+
* @description: Updates a courier partner rule priority for a single application - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/updateCourierPartnerRulePriority/).
|
|
1021
2324
|
*/
|
|
1022
|
-
async
|
|
2325
|
+
async updateCourierPartnerRulePriority(
|
|
1023
2326
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
1024
2327
|
{ responseHeaders } = { responseHeaders: false }
|
|
1025
2328
|
) {
|
|
1026
2329
|
const {
|
|
1027
2330
|
error,
|
|
1028
|
-
} = ServiceabilityPlatformApplicationValidator.
|
|
2331
|
+
} = ServiceabilityPlatformApplicationValidator.updateCourierPartnerRulePriority().validate(
|
|
1029
2332
|
{
|
|
1030
2333
|
body,
|
|
1031
2334
|
},
|
|
@@ -1038,7 +2341,7 @@ class Serviceability {
|
|
|
1038
2341
|
// Showing warrnings if extra unknown parameters are found
|
|
1039
2342
|
const {
|
|
1040
2343
|
error: warrning,
|
|
1041
|
-
} = ServiceabilityPlatformApplicationValidator.
|
|
2344
|
+
} = ServiceabilityPlatformApplicationValidator.updateCourierPartnerRulePriority().validate(
|
|
1042
2345
|
{
|
|
1043
2346
|
body,
|
|
1044
2347
|
},
|
|
@@ -1047,7 +2350,7 @@ class Serviceability {
|
|
|
1047
2350
|
if (warrning) {
|
|
1048
2351
|
Logger({
|
|
1049
2352
|
level: "WARN",
|
|
1050
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
2353
|
+
message: `Parameter Validation warrnings for platform > Serviceability > updateCourierPartnerRulePriority \n ${warrning}`,
|
|
1051
2354
|
});
|
|
1052
2355
|
}
|
|
1053
2356
|
|
|
@@ -1056,7 +2359,7 @@ class Serviceability {
|
|
|
1056
2359
|
const response = await PlatformAPIClient.execute(
|
|
1057
2360
|
this.config,
|
|
1058
2361
|
"put",
|
|
1059
|
-
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
2362
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/courier-partner/rules/priority`,
|
|
1060
2363
|
query_params,
|
|
1061
2364
|
body,
|
|
1062
2365
|
requestHeaders,
|
|
@@ -1070,10 +2373,10 @@ class Serviceability {
|
|
|
1070
2373
|
|
|
1071
2374
|
const {
|
|
1072
2375
|
error: res_error,
|
|
1073
|
-
} = ServiceabilityPlatformModel.
|
|
1074
|
-
|
|
1075
|
-
allowUnknown: true
|
|
1076
|
-
|
|
2376
|
+
} = ServiceabilityPlatformModel.RulePriorityResult().validate(
|
|
2377
|
+
responseData,
|
|
2378
|
+
{ abortEarly: false, allowUnknown: true }
|
|
2379
|
+
);
|
|
1077
2380
|
|
|
1078
2381
|
if (res_error) {
|
|
1079
2382
|
if (this.config.options.strictResponseCheck === true) {
|
|
@@ -1081,7 +2384,7 @@ class Serviceability {
|
|
|
1081
2384
|
} else {
|
|
1082
2385
|
Logger({
|
|
1083
2386
|
level: "WARN",
|
|
1084
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
2387
|
+
message: `Response Validation Warnings for platform > Serviceability > updateCourierPartnerRulePriority \n ${res_error}`,
|
|
1085
2388
|
});
|
|
1086
2389
|
}
|
|
1087
2390
|
}
|
|
@@ -1090,25 +2393,27 @@ class Serviceability {
|
|
|
1090
2393
|
}
|
|
1091
2394
|
|
|
1092
2395
|
/**
|
|
1093
|
-
* @param {ServiceabilityPlatformApplicationValidator.
|
|
2396
|
+
* @param {ServiceabilityPlatformApplicationValidator.UpdateCourierRuleParam} arg
|
|
1094
2397
|
* - Arg object
|
|
1095
2398
|
*
|
|
1096
2399
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1097
2400
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1098
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
1099
|
-
* Success response
|
|
1100
|
-
*
|
|
1101
|
-
* @
|
|
1102
|
-
* @
|
|
2401
|
+
* @returns {Promise<ServiceabilityPlatformModel.CourierPartnerRuleResult>}
|
|
2402
|
+
* - Success response
|
|
2403
|
+
*
|
|
2404
|
+
* @name updateCourierRule
|
|
2405
|
+
* @summary: Update courier rule
|
|
2406
|
+
* @description: Updates an existing rule within the delivery configuration. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/updateCourierRule/).
|
|
1103
2407
|
*/
|
|
1104
|
-
async
|
|
1105
|
-
{ body, requestHeaders } = { requestHeaders: {} },
|
|
2408
|
+
async updateCourierRule(
|
|
2409
|
+
{ ruleUid, body, requestHeaders } = { requestHeaders: {} },
|
|
1106
2410
|
{ responseHeaders } = { responseHeaders: false }
|
|
1107
2411
|
) {
|
|
1108
2412
|
const {
|
|
1109
2413
|
error,
|
|
1110
|
-
} = ServiceabilityPlatformApplicationValidator.
|
|
2414
|
+
} = ServiceabilityPlatformApplicationValidator.updateCourierRule().validate(
|
|
1111
2415
|
{
|
|
2416
|
+
ruleUid,
|
|
1112
2417
|
body,
|
|
1113
2418
|
},
|
|
1114
2419
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -1120,8 +2425,9 @@ class Serviceability {
|
|
|
1120
2425
|
// Showing warrnings if extra unknown parameters are found
|
|
1121
2426
|
const {
|
|
1122
2427
|
error: warrning,
|
|
1123
|
-
} = ServiceabilityPlatformApplicationValidator.
|
|
2428
|
+
} = ServiceabilityPlatformApplicationValidator.updateCourierRule().validate(
|
|
1124
2429
|
{
|
|
2430
|
+
ruleUid,
|
|
1125
2431
|
body,
|
|
1126
2432
|
},
|
|
1127
2433
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -1129,7 +2435,7 @@ class Serviceability {
|
|
|
1129
2435
|
if (warrning) {
|
|
1130
2436
|
Logger({
|
|
1131
2437
|
level: "WARN",
|
|
1132
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
2438
|
+
message: `Parameter Validation warrnings for platform > Serviceability > updateCourierRule \n ${warrning}`,
|
|
1133
2439
|
});
|
|
1134
2440
|
}
|
|
1135
2441
|
|
|
@@ -1138,7 +2444,7 @@ class Serviceability {
|
|
|
1138
2444
|
const response = await PlatformAPIClient.execute(
|
|
1139
2445
|
this.config,
|
|
1140
2446
|
"put",
|
|
1141
|
-
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/courier-partner/rules
|
|
2447
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/courier-partner/rules/${ruleUid}`,
|
|
1142
2448
|
query_params,
|
|
1143
2449
|
body,
|
|
1144
2450
|
requestHeaders,
|
|
@@ -1152,7 +2458,7 @@ class Serviceability {
|
|
|
1152
2458
|
|
|
1153
2459
|
const {
|
|
1154
2460
|
error: res_error,
|
|
1155
|
-
} = ServiceabilityPlatformModel.
|
|
2461
|
+
} = ServiceabilityPlatformModel.CourierPartnerRuleResult().validate(
|
|
1156
2462
|
responseData,
|
|
1157
2463
|
{ abortEarly: false, allowUnknown: true }
|
|
1158
2464
|
);
|
|
@@ -1163,7 +2469,7 @@ class Serviceability {
|
|
|
1163
2469
|
} else {
|
|
1164
2470
|
Logger({
|
|
1165
2471
|
level: "WARN",
|
|
1166
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
2472
|
+
message: `Response Validation Warnings for platform > Serviceability > updateCourierRule \n ${res_error}`,
|
|
1167
2473
|
});
|
|
1168
2474
|
}
|
|
1169
2475
|
}
|
|
@@ -1172,27 +2478,27 @@ class Serviceability {
|
|
|
1172
2478
|
}
|
|
1173
2479
|
|
|
1174
2480
|
/**
|
|
1175
|
-
* @param {ServiceabilityPlatformApplicationValidator.
|
|
2481
|
+
* @param {ServiceabilityPlatformApplicationValidator.UpdateGeoAreaParam} arg
|
|
1176
2482
|
* - Arg object
|
|
1177
2483
|
*
|
|
1178
2484
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1179
2485
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1180
|
-
* @returns {Promise<ServiceabilityPlatformModel.
|
|
1181
|
-
*
|
|
1182
|
-
*
|
|
1183
|
-
* @
|
|
1184
|
-
* @
|
|
1185
|
-
* @description: Updates an existing rule within the delivery configuration. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/updateCourierRule/).
|
|
2486
|
+
* @returns {Promise<ServiceabilityPlatformModel.GeoAreaPutResponseBody>} -
|
|
2487
|
+
* Success response
|
|
2488
|
+
* @name updateGeoArea
|
|
2489
|
+
* @summary: Update the details of existing GeoArea
|
|
2490
|
+
* @description: Updates the GeoArea with a new name, regions, etc. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/updateGeoArea/).
|
|
1186
2491
|
*/
|
|
1187
|
-
async
|
|
1188
|
-
{
|
|
2492
|
+
async updateGeoArea(
|
|
2493
|
+
{ geoareaId, body, requestHeaders } = { requestHeaders: {} },
|
|
1189
2494
|
{ responseHeaders } = { responseHeaders: false }
|
|
1190
2495
|
) {
|
|
1191
2496
|
const {
|
|
1192
2497
|
error,
|
|
1193
|
-
} = ServiceabilityPlatformApplicationValidator.
|
|
2498
|
+
} = ServiceabilityPlatformApplicationValidator.updateGeoArea().validate(
|
|
1194
2499
|
{
|
|
1195
|
-
|
|
2500
|
+
geoareaId,
|
|
2501
|
+
|
|
1196
2502
|
body,
|
|
1197
2503
|
},
|
|
1198
2504
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -1204,9 +2510,10 @@ class Serviceability {
|
|
|
1204
2510
|
// Showing warrnings if extra unknown parameters are found
|
|
1205
2511
|
const {
|
|
1206
2512
|
error: warrning,
|
|
1207
|
-
} = ServiceabilityPlatformApplicationValidator.
|
|
2513
|
+
} = ServiceabilityPlatformApplicationValidator.updateGeoArea().validate(
|
|
1208
2514
|
{
|
|
1209
|
-
|
|
2515
|
+
geoareaId,
|
|
2516
|
+
|
|
1210
2517
|
body,
|
|
1211
2518
|
},
|
|
1212
2519
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -1214,7 +2521,7 @@ class Serviceability {
|
|
|
1214
2521
|
if (warrning) {
|
|
1215
2522
|
Logger({
|
|
1216
2523
|
level: "WARN",
|
|
1217
|
-
message: `Parameter Validation warrnings for platform > Serviceability >
|
|
2524
|
+
message: `Parameter Validation warrnings for platform > Serviceability > updateGeoArea \n ${warrning}`,
|
|
1218
2525
|
});
|
|
1219
2526
|
}
|
|
1220
2527
|
|
|
@@ -1223,7 +2530,7 @@ class Serviceability {
|
|
|
1223
2530
|
const response = await PlatformAPIClient.execute(
|
|
1224
2531
|
this.config,
|
|
1225
2532
|
"put",
|
|
1226
|
-
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
2533
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/geoareas/${geoareaId}`,
|
|
1227
2534
|
query_params,
|
|
1228
2535
|
body,
|
|
1229
2536
|
requestHeaders,
|
|
@@ -1237,7 +2544,7 @@ class Serviceability {
|
|
|
1237
2544
|
|
|
1238
2545
|
const {
|
|
1239
2546
|
error: res_error,
|
|
1240
|
-
} = ServiceabilityPlatformModel.
|
|
2547
|
+
} = ServiceabilityPlatformModel.GeoAreaPutResponseBody().validate(
|
|
1241
2548
|
responseData,
|
|
1242
2549
|
{ abortEarly: false, allowUnknown: true }
|
|
1243
2550
|
);
|
|
@@ -1248,7 +2555,7 @@ class Serviceability {
|
|
|
1248
2555
|
} else {
|
|
1249
2556
|
Logger({
|
|
1250
2557
|
level: "WARN",
|
|
1251
|
-
message: `Response Validation Warnings for platform > Serviceability >
|
|
2558
|
+
message: `Response Validation Warnings for platform > Serviceability > updateGeoArea \n ${res_error}`,
|
|
1252
2559
|
});
|
|
1253
2560
|
}
|
|
1254
2561
|
}
|
|
@@ -1597,6 +2904,88 @@ class Serviceability {
|
|
|
1597
2904
|
return response;
|
|
1598
2905
|
}
|
|
1599
2906
|
|
|
2907
|
+
/**
|
|
2908
|
+
* @param {ServiceabilityPlatformApplicationValidator.UpdateStoreRulePriorityParam} arg
|
|
2909
|
+
* - Arg object
|
|
2910
|
+
*
|
|
2911
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2912
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2913
|
+
* @returns {Promise<ServiceabilityPlatformModel.RulePriorityResult>} -
|
|
2914
|
+
* Success response
|
|
2915
|
+
* @name updateStoreRulePriority
|
|
2916
|
+
* @summary: Update Store Rule priority
|
|
2917
|
+
* @description: Update Store Rule priority - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/updateStoreRulePriority/).
|
|
2918
|
+
*/
|
|
2919
|
+
async updateStoreRulePriority(
|
|
2920
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
2921
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
2922
|
+
) {
|
|
2923
|
+
const {
|
|
2924
|
+
error,
|
|
2925
|
+
} = ServiceabilityPlatformApplicationValidator.updateStoreRulePriority().validate(
|
|
2926
|
+
{
|
|
2927
|
+
body,
|
|
2928
|
+
},
|
|
2929
|
+
{ abortEarly: false, allowUnknown: true }
|
|
2930
|
+
);
|
|
2931
|
+
if (error) {
|
|
2932
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
2933
|
+
}
|
|
2934
|
+
|
|
2935
|
+
// Showing warrnings if extra unknown parameters are found
|
|
2936
|
+
const {
|
|
2937
|
+
error: warrning,
|
|
2938
|
+
} = ServiceabilityPlatformApplicationValidator.updateStoreRulePriority().validate(
|
|
2939
|
+
{
|
|
2940
|
+
body,
|
|
2941
|
+
},
|
|
2942
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2943
|
+
);
|
|
2944
|
+
if (warrning) {
|
|
2945
|
+
Logger({
|
|
2946
|
+
level: "WARN",
|
|
2947
|
+
message: `Parameter Validation warrnings for platform > Serviceability > updateStoreRulePriority \n ${warrning}`,
|
|
2948
|
+
});
|
|
2949
|
+
}
|
|
2950
|
+
|
|
2951
|
+
const query_params = {};
|
|
2952
|
+
|
|
2953
|
+
const response = await PlatformAPIClient.execute(
|
|
2954
|
+
this.config,
|
|
2955
|
+
"put",
|
|
2956
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/store/rules/priority`,
|
|
2957
|
+
query_params,
|
|
2958
|
+
body,
|
|
2959
|
+
requestHeaders,
|
|
2960
|
+
{ responseHeaders }
|
|
2961
|
+
);
|
|
2962
|
+
|
|
2963
|
+
let responseData = response;
|
|
2964
|
+
if (responseHeaders) {
|
|
2965
|
+
responseData = response[0];
|
|
2966
|
+
}
|
|
2967
|
+
|
|
2968
|
+
const {
|
|
2969
|
+
error: res_error,
|
|
2970
|
+
} = ServiceabilityPlatformModel.RulePriorityResult().validate(
|
|
2971
|
+
responseData,
|
|
2972
|
+
{ abortEarly: false, allowUnknown: true }
|
|
2973
|
+
);
|
|
2974
|
+
|
|
2975
|
+
if (res_error) {
|
|
2976
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
2977
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2978
|
+
} else {
|
|
2979
|
+
Logger({
|
|
2980
|
+
level: "WARN",
|
|
2981
|
+
message: `Response Validation Warnings for platform > Serviceability > updateStoreRulePriority \n ${res_error}`,
|
|
2982
|
+
});
|
|
2983
|
+
}
|
|
2984
|
+
}
|
|
2985
|
+
|
|
2986
|
+
return response;
|
|
2987
|
+
}
|
|
2988
|
+
|
|
1600
2989
|
/**
|
|
1601
2990
|
* @param {ServiceabilityPlatformApplicationValidator.UpdateStoreRulesParam} arg
|
|
1602
2991
|
* - Arg object
|
|
@@ -1763,6 +3152,93 @@ class Serviceability {
|
|
|
1763
3152
|
|
|
1764
3153
|
return response;
|
|
1765
3154
|
}
|
|
3155
|
+
|
|
3156
|
+
/**
|
|
3157
|
+
* @param {ServiceabilityPlatformApplicationValidator.UpdateZoneParam} arg
|
|
3158
|
+
* - Arg object
|
|
3159
|
+
*
|
|
3160
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
3161
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
3162
|
+
* @returns {Promise<ServiceabilityPlatformModel.ZoneUpdateSuccessResult>}
|
|
3163
|
+
* - Success response
|
|
3164
|
+
*
|
|
3165
|
+
* @name updateZone
|
|
3166
|
+
* @summary: Update details of a Zone to enable or disable
|
|
3167
|
+
* @description: Enable or Disable a Zone under that application. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/updateZone/).
|
|
3168
|
+
*/
|
|
3169
|
+
async updateZone(
|
|
3170
|
+
{ zoneId, body, requestHeaders } = { requestHeaders: {} },
|
|
3171
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
3172
|
+
) {
|
|
3173
|
+
const {
|
|
3174
|
+
error,
|
|
3175
|
+
} = ServiceabilityPlatformApplicationValidator.updateZone().validate(
|
|
3176
|
+
{
|
|
3177
|
+
zoneId,
|
|
3178
|
+
|
|
3179
|
+
body,
|
|
3180
|
+
},
|
|
3181
|
+
{ abortEarly: false, allowUnknown: true }
|
|
3182
|
+
);
|
|
3183
|
+
if (error) {
|
|
3184
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
3185
|
+
}
|
|
3186
|
+
|
|
3187
|
+
// Showing warrnings if extra unknown parameters are found
|
|
3188
|
+
const {
|
|
3189
|
+
error: warrning,
|
|
3190
|
+
} = ServiceabilityPlatformApplicationValidator.updateZone().validate(
|
|
3191
|
+
{
|
|
3192
|
+
zoneId,
|
|
3193
|
+
|
|
3194
|
+
body,
|
|
3195
|
+
},
|
|
3196
|
+
{ abortEarly: false, allowUnknown: false }
|
|
3197
|
+
);
|
|
3198
|
+
if (warrning) {
|
|
3199
|
+
Logger({
|
|
3200
|
+
level: "WARN",
|
|
3201
|
+
message: `Parameter Validation warrnings for platform > Serviceability > updateZone \n ${warrning}`,
|
|
3202
|
+
});
|
|
3203
|
+
}
|
|
3204
|
+
|
|
3205
|
+
const query_params = {};
|
|
3206
|
+
|
|
3207
|
+
const response = await PlatformAPIClient.execute(
|
|
3208
|
+
this.config,
|
|
3209
|
+
"patch",
|
|
3210
|
+
`/service/platform/logistics/v2.0/company/${this.config.companyId}/application/${this.applicationId}/zones/${zoneId}`,
|
|
3211
|
+
query_params,
|
|
3212
|
+
body,
|
|
3213
|
+
requestHeaders,
|
|
3214
|
+
{ responseHeaders }
|
|
3215
|
+
);
|
|
3216
|
+
|
|
3217
|
+
let responseData = response;
|
|
3218
|
+
if (responseHeaders) {
|
|
3219
|
+
responseData = response[0];
|
|
3220
|
+
}
|
|
3221
|
+
|
|
3222
|
+
const {
|
|
3223
|
+
error: res_error,
|
|
3224
|
+
} = ServiceabilityPlatformModel.ZoneUpdateSuccessResult().validate(
|
|
3225
|
+
responseData,
|
|
3226
|
+
{ abortEarly: false, allowUnknown: true }
|
|
3227
|
+
);
|
|
3228
|
+
|
|
3229
|
+
if (res_error) {
|
|
3230
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
3231
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
3232
|
+
} else {
|
|
3233
|
+
Logger({
|
|
3234
|
+
level: "WARN",
|
|
3235
|
+
message: `Response Validation Warnings for platform > Serviceability > updateZone \n ${res_error}`,
|
|
3236
|
+
});
|
|
3237
|
+
}
|
|
3238
|
+
}
|
|
3239
|
+
|
|
3240
|
+
return response;
|
|
3241
|
+
}
|
|
1766
3242
|
}
|
|
1767
3243
|
|
|
1768
3244
|
module.exports = Serviceability;
|