@gofynd/fdk-client-javascript 1.4.15-beta.5 → 1.4.15-beta.6
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/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +10 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +118 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +53 -1
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +29 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +0 -10
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +0 -119
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +1 -58
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +0 -30
package/README.md
CHANGED
|
@@ -237,7 +237,7 @@ console.log("Active Theme: ", response.information.name);
|
|
|
237
237
|
The above code will log the curl command in the console
|
|
238
238
|
|
|
239
239
|
```bash
|
|
240
|
-
curl --request GET "https://api.fynd.com/service/application/theme/v1.0/applied-theme" --header 'authorization: Bearer <authorization-token>' --header 'x-fp-sdk-version: 1.4.15-beta.
|
|
240
|
+
curl --request GET "https://api.fynd.com/service/application/theme/v1.0/applied-theme" --header 'authorization: Bearer <authorization-token>' --header 'x-fp-sdk-version: 1.4.15-beta.6' --header 'x-fp-date: 20230222T115108Z' --header 'x-fp-signature: v1.1:1e3ab3b02b5bc626e3c32a37ee844266ade02bbcbaafc28fc7a0e46a76a7a1a8'
|
|
241
241
|
Active Theme: Emerge
|
|
242
242
|
```
|
|
243
243
|
|
package/package.json
CHANGED
|
@@ -126,6 +126,16 @@ declare class Serviceability {
|
|
|
126
126
|
* @description: Retrieves an existing order routing setup for a single application - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getStoreRules/).
|
|
127
127
|
*/
|
|
128
128
|
getStoreRules({ pageNo, pageSize, status, requestHeaders }?: ServiceabilityPlatformApplicationValidator.GetStoreRulesParam, { responseHeaders }?: object): Promise<ServiceabilityPlatformModel.GetStoreRulesApiResponse>;
|
|
129
|
+
/**
|
|
130
|
+
* @param {ServiceabilityPlatformApplicationValidator.GetZonesParam} arg - Arg object
|
|
131
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
132
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
133
|
+
* @returns {Promise<ServiceabilityPlatformModel.ListViewResponse>} - Success response
|
|
134
|
+
* @name getZones
|
|
135
|
+
* @summary: Get zones
|
|
136
|
+
* @description: Retrieves a list of delivery zones. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getZones/).
|
|
137
|
+
*/
|
|
138
|
+
getZones({ pageNo, pageSize, isActive, q, countryIsoCode, state, city, pincode, sector, requestHeaders, }?: ServiceabilityPlatformApplicationValidator.GetZonesParam, { responseHeaders }?: object): Promise<ServiceabilityPlatformModel.ListViewResponse>;
|
|
129
139
|
/**
|
|
130
140
|
* @param {ServiceabilityPlatformApplicationValidator.InsertApplicationConfigParam} arg
|
|
131
141
|
* - Arg object
|
|
@@ -761,6 +761,124 @@ class Serviceability {
|
|
|
761
761
|
return response;
|
|
762
762
|
}
|
|
763
763
|
|
|
764
|
+
/**
|
|
765
|
+
* @param {ServiceabilityPlatformApplicationValidator.GetZonesParam} arg - Arg object
|
|
766
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
767
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
768
|
+
* @returns {Promise<ServiceabilityPlatformModel.ListViewResponse>} - Success response
|
|
769
|
+
* @name getZones
|
|
770
|
+
* @summary: Get zones
|
|
771
|
+
* @description: Retrieves a list of delivery zones. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getZones/).
|
|
772
|
+
*/
|
|
773
|
+
async getZones(
|
|
774
|
+
{
|
|
775
|
+
pageNo,
|
|
776
|
+
pageSize,
|
|
777
|
+
isActive,
|
|
778
|
+
q,
|
|
779
|
+
countryIsoCode,
|
|
780
|
+
state,
|
|
781
|
+
city,
|
|
782
|
+
pincode,
|
|
783
|
+
sector,
|
|
784
|
+
requestHeaders,
|
|
785
|
+
} = { requestHeaders: {} },
|
|
786
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
787
|
+
) {
|
|
788
|
+
const {
|
|
789
|
+
error,
|
|
790
|
+
} = ServiceabilityPlatformApplicationValidator.getZones().validate(
|
|
791
|
+
{
|
|
792
|
+
pageNo,
|
|
793
|
+
pageSize,
|
|
794
|
+
isActive,
|
|
795
|
+
|
|
796
|
+
q,
|
|
797
|
+
countryIsoCode,
|
|
798
|
+
state,
|
|
799
|
+
city,
|
|
800
|
+
pincode,
|
|
801
|
+
sector,
|
|
802
|
+
},
|
|
803
|
+
{ abortEarly: false, allowUnknown: true }
|
|
804
|
+
);
|
|
805
|
+
if (error) {
|
|
806
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
// Showing warrnings if extra unknown parameters are found
|
|
810
|
+
const {
|
|
811
|
+
error: warrning,
|
|
812
|
+
} = ServiceabilityPlatformApplicationValidator.getZones().validate(
|
|
813
|
+
{
|
|
814
|
+
pageNo,
|
|
815
|
+
pageSize,
|
|
816
|
+
isActive,
|
|
817
|
+
|
|
818
|
+
q,
|
|
819
|
+
countryIsoCode,
|
|
820
|
+
state,
|
|
821
|
+
city,
|
|
822
|
+
pincode,
|
|
823
|
+
sector,
|
|
824
|
+
},
|
|
825
|
+
{ abortEarly: false, allowUnknown: false }
|
|
826
|
+
);
|
|
827
|
+
if (warrning) {
|
|
828
|
+
Logger({
|
|
829
|
+
level: "WARN",
|
|
830
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getZones \n ${warrning}`,
|
|
831
|
+
});
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
const query_params = {};
|
|
835
|
+
query_params["page_no"] = pageNo;
|
|
836
|
+
query_params["page_size"] = pageSize;
|
|
837
|
+
query_params["is_active"] = isActive;
|
|
838
|
+
query_params["application_id"] = applicationId;
|
|
839
|
+
query_params["q"] = q;
|
|
840
|
+
query_params["country_iso_code"] = countryIsoCode;
|
|
841
|
+
query_params["state"] = state;
|
|
842
|
+
query_params["city"] = city;
|
|
843
|
+
query_params["pincode"] = pincode;
|
|
844
|
+
query_params["sector"] = sector;
|
|
845
|
+
|
|
846
|
+
const response = await PlatformAPIClient.execute(
|
|
847
|
+
this.config,
|
|
848
|
+
"get",
|
|
849
|
+
`/service/platform/logistics/v2.0/company/${this.config.companyId}/zones`,
|
|
850
|
+
query_params,
|
|
851
|
+
undefined,
|
|
852
|
+
requestHeaders,
|
|
853
|
+
{ responseHeaders }
|
|
854
|
+
);
|
|
855
|
+
|
|
856
|
+
let responseData = response;
|
|
857
|
+
if (responseHeaders) {
|
|
858
|
+
responseData = response[0];
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
const {
|
|
862
|
+
error: res_error,
|
|
863
|
+
} = ServiceabilityPlatformModel.ListViewResponse().validate(responseData, {
|
|
864
|
+
abortEarly: false,
|
|
865
|
+
allowUnknown: true,
|
|
866
|
+
});
|
|
867
|
+
|
|
868
|
+
if (res_error) {
|
|
869
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
870
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
871
|
+
} else {
|
|
872
|
+
Logger({
|
|
873
|
+
level: "WARN",
|
|
874
|
+
message: `Response Validation Warnings for platform > Serviceability > getZones \n ${res_error}`,
|
|
875
|
+
});
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
return response;
|
|
880
|
+
}
|
|
881
|
+
|
|
764
882
|
/**
|
|
765
883
|
* @param {ServiceabilityPlatformApplicationValidator.InsertApplicationConfigParam} arg
|
|
766
884
|
* - Arg object
|
|
@@ -31,6 +31,18 @@ export = ServiceabilityPlatformApplicationValidator;
|
|
|
31
31
|
* @property {number} [pageSize]
|
|
32
32
|
* @property {string} [status]
|
|
33
33
|
*/
|
|
34
|
+
/**
|
|
35
|
+
* @typedef GetZonesParam
|
|
36
|
+
* @property {number} [pageNo] - Index of the item to start returning with
|
|
37
|
+
* @property {number} [pageSize] - Determines the items to be displayed in a page
|
|
38
|
+
* @property {boolean} [isActive] - Status of Zone (either active or inactive)
|
|
39
|
+
* @property {string} [q] - Search with name as a free text
|
|
40
|
+
* @property {string} [countryIsoCode] - ISO2 code of the country
|
|
41
|
+
* @property {string} [state] - State name
|
|
42
|
+
* @property {string} [city] - City name
|
|
43
|
+
* @property {string} [pincode] - Pincode value to search zones
|
|
44
|
+
* @property {string} [sector] - Sector value to search zones
|
|
45
|
+
*/
|
|
34
46
|
/**
|
|
35
47
|
* @typedef InsertApplicationConfigParam
|
|
36
48
|
* @property {ServiceabilityPlatformModel.StoreRuleConfigData} body
|
|
@@ -97,6 +109,8 @@ declare class ServiceabilityPlatformApplicationValidator {
|
|
|
97
109
|
static getStoreRule(): GetStoreRuleParam;
|
|
98
110
|
/** @returns {GetStoreRulesParam} */
|
|
99
111
|
static getStoreRules(): GetStoreRulesParam;
|
|
112
|
+
/** @returns {GetZonesParam} */
|
|
113
|
+
static getZones(): GetZonesParam;
|
|
100
114
|
/** @returns {InsertApplicationConfigParam} */
|
|
101
115
|
static insertApplicationConfig(): InsertApplicationConfigParam;
|
|
102
116
|
/** @returns {PatchApplicationServiceabilitySelfShipmentParam} */
|
|
@@ -121,7 +135,7 @@ declare class ServiceabilityPlatformApplicationValidator {
|
|
|
121
135
|
static updateStoreRulesConfig(): UpdateStoreRulesConfigParam;
|
|
122
136
|
}
|
|
123
137
|
declare namespace ServiceabilityPlatformApplicationValidator {
|
|
124
|
-
export { CreateCourierPartnerRuleParam, CreateStoreRulesParam, GetApplicationConfigParam, GetApplicationConfigurationParam, GetApplicationServiceabilitySelfShipmentParam, GetCourierPartnerRuleParam, GetCourierPartnerRulesParam, GetStoreRuleParam, GetStoreRulesParam, InsertApplicationConfigParam, PatchApplicationServiceabilitySelfShipmentParam, UpdateApplicationConfigurationParam, UpdateCourierPartnerRulePriorityParam, UpdateCourierRuleParam, UpdatePincodeAuditHistoryParam, UpdatePincodeBulkViewParam, UpdatePincodeCoDListingParam, UpdatePincodeMopViewParam, UpdateStoreRulesParam, UpdateStoreRulesConfigParam };
|
|
138
|
+
export { CreateCourierPartnerRuleParam, CreateStoreRulesParam, GetApplicationConfigParam, GetApplicationConfigurationParam, GetApplicationServiceabilitySelfShipmentParam, GetCourierPartnerRuleParam, GetCourierPartnerRulesParam, GetStoreRuleParam, GetStoreRulesParam, GetZonesParam, InsertApplicationConfigParam, PatchApplicationServiceabilitySelfShipmentParam, UpdateApplicationConfigurationParam, UpdateCourierPartnerRulePriorityParam, UpdateCourierRuleParam, UpdatePincodeAuditHistoryParam, UpdatePincodeBulkViewParam, UpdatePincodeCoDListingParam, UpdatePincodeMopViewParam, UpdateStoreRulesParam, UpdateStoreRulesConfigParam };
|
|
125
139
|
}
|
|
126
140
|
type CreateCourierPartnerRuleParam = {
|
|
127
141
|
body: ServiceabilityPlatformModel.CourierPartnerRule;
|
|
@@ -161,6 +175,44 @@ type GetStoreRulesParam = {
|
|
|
161
175
|
pageSize?: number;
|
|
162
176
|
status?: string;
|
|
163
177
|
};
|
|
178
|
+
type GetZonesParam = {
|
|
179
|
+
/**
|
|
180
|
+
* - Index of the item to start returning with
|
|
181
|
+
*/
|
|
182
|
+
pageNo?: number;
|
|
183
|
+
/**
|
|
184
|
+
* - Determines the items to be displayed in a page
|
|
185
|
+
*/
|
|
186
|
+
pageSize?: number;
|
|
187
|
+
/**
|
|
188
|
+
* - Status of Zone (either active or inactive)
|
|
189
|
+
*/
|
|
190
|
+
isActive?: boolean;
|
|
191
|
+
/**
|
|
192
|
+
* - Search with name as a free text
|
|
193
|
+
*/
|
|
194
|
+
q?: string;
|
|
195
|
+
/**
|
|
196
|
+
* - ISO2 code of the country
|
|
197
|
+
*/
|
|
198
|
+
countryIsoCode?: string;
|
|
199
|
+
/**
|
|
200
|
+
* - State name
|
|
201
|
+
*/
|
|
202
|
+
state?: string;
|
|
203
|
+
/**
|
|
204
|
+
* - City name
|
|
205
|
+
*/
|
|
206
|
+
city?: string;
|
|
207
|
+
/**
|
|
208
|
+
* - Pincode value to search zones
|
|
209
|
+
*/
|
|
210
|
+
pincode?: string;
|
|
211
|
+
/**
|
|
212
|
+
* - Sector value to search zones
|
|
213
|
+
*/
|
|
214
|
+
sector?: string;
|
|
215
|
+
};
|
|
164
216
|
type InsertApplicationConfigParam = {
|
|
165
217
|
body: ServiceabilityPlatformModel.StoreRuleConfigData;
|
|
166
218
|
};
|
|
@@ -43,6 +43,19 @@ const ServiceabilityPlatformModel = require("./ServiceabilityPlatformModel");
|
|
|
43
43
|
* @property {string} [status]
|
|
44
44
|
*/
|
|
45
45
|
|
|
46
|
+
/**
|
|
47
|
+
* @typedef GetZonesParam
|
|
48
|
+
* @property {number} [pageNo] - Index of the item to start returning with
|
|
49
|
+
* @property {number} [pageSize] - Determines the items to be displayed in a page
|
|
50
|
+
* @property {boolean} [isActive] - Status of Zone (either active or inactive)
|
|
51
|
+
* @property {string} [q] - Search with name as a free text
|
|
52
|
+
* @property {string} [countryIsoCode] - ISO2 code of the country
|
|
53
|
+
* @property {string} [state] - State name
|
|
54
|
+
* @property {string} [city] - City name
|
|
55
|
+
* @property {string} [pincode] - Pincode value to search zones
|
|
56
|
+
* @property {string} [sector] - Sector value to search zones
|
|
57
|
+
*/
|
|
58
|
+
|
|
46
59
|
/**
|
|
47
60
|
* @typedef InsertApplicationConfigParam
|
|
48
61
|
* @property {ServiceabilityPlatformModel.StoreRuleConfigData} body
|
|
@@ -163,6 +176,22 @@ class ServiceabilityPlatformApplicationValidator {
|
|
|
163
176
|
}).required();
|
|
164
177
|
}
|
|
165
178
|
|
|
179
|
+
/** @returns {GetZonesParam} */
|
|
180
|
+
static getZones() {
|
|
181
|
+
return Joi.object({
|
|
182
|
+
pageNo: Joi.number(),
|
|
183
|
+
pageSize: Joi.number(),
|
|
184
|
+
isActive: Joi.boolean(),
|
|
185
|
+
|
|
186
|
+
q: Joi.string().allow(""),
|
|
187
|
+
countryIsoCode: Joi.string().allow(""),
|
|
188
|
+
state: Joi.string().allow(""),
|
|
189
|
+
city: Joi.string().allow(""),
|
|
190
|
+
pincode: Joi.string().allow(""),
|
|
191
|
+
sector: Joi.string().allow(""),
|
|
192
|
+
}).required();
|
|
193
|
+
}
|
|
194
|
+
|
|
166
195
|
/** @returns {InsertApplicationConfigParam} */
|
|
167
196
|
static insertApplicationConfig() {
|
|
168
197
|
return Joi.object({
|
|
@@ -236,16 +236,6 @@ declare class Serviceability {
|
|
|
236
236
|
* @description: Retrieves a single delivery zone. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getZoneById/).
|
|
237
237
|
*/
|
|
238
238
|
getZoneById({ zoneId, requestHeaders }?: ServiceabilityPlatformValidator.GetZoneByIdParam, { responseHeaders }?: object): Promise<ServiceabilityPlatformModel.GetZoneByIdSchema>;
|
|
239
|
-
/**
|
|
240
|
-
* @param {ServiceabilityPlatformValidator.GetZonesParam} arg - Arg object
|
|
241
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
242
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
243
|
-
* @returns {Promise<ServiceabilityPlatformModel.ListViewResponse>} - Success response
|
|
244
|
-
* @name getZones
|
|
245
|
-
* @summary: Get zones
|
|
246
|
-
* @description: Retrieves a list of delivery zones. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getZones/).
|
|
247
|
-
*/
|
|
248
|
-
getZones({ pageNo, pageSize, isActive, channelId, q, countryIsoCode, state, city, pincode, sector, requestHeaders, }?: ServiceabilityPlatformValidator.GetZonesParam, { responseHeaders }?: object): Promise<ServiceabilityPlatformModel.ListViewResponse>;
|
|
249
239
|
/**
|
|
250
240
|
* @param {ServiceabilityPlatformValidator.UpdateCompanyConfigurationParam} arg
|
|
251
241
|
* - Arg object
|
|
@@ -1714,125 +1714,6 @@ class Serviceability {
|
|
|
1714
1714
|
return response;
|
|
1715
1715
|
}
|
|
1716
1716
|
|
|
1717
|
-
/**
|
|
1718
|
-
* @param {ServiceabilityPlatformValidator.GetZonesParam} arg - Arg object
|
|
1719
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1720
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1721
|
-
* @returns {Promise<ServiceabilityPlatformModel.ListViewResponse>} - Success response
|
|
1722
|
-
* @name getZones
|
|
1723
|
-
* @summary: Get zones
|
|
1724
|
-
* @description: Retrieves a list of delivery zones. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getZones/).
|
|
1725
|
-
*/
|
|
1726
|
-
async getZones(
|
|
1727
|
-
{
|
|
1728
|
-
pageNo,
|
|
1729
|
-
pageSize,
|
|
1730
|
-
isActive,
|
|
1731
|
-
channelId,
|
|
1732
|
-
q,
|
|
1733
|
-
countryIsoCode,
|
|
1734
|
-
state,
|
|
1735
|
-
city,
|
|
1736
|
-
pincode,
|
|
1737
|
-
sector,
|
|
1738
|
-
requestHeaders,
|
|
1739
|
-
} = { requestHeaders: {} },
|
|
1740
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
1741
|
-
) {
|
|
1742
|
-
const { error } = ServiceabilityPlatformValidator.getZones().validate(
|
|
1743
|
-
{
|
|
1744
|
-
pageNo,
|
|
1745
|
-
pageSize,
|
|
1746
|
-
isActive,
|
|
1747
|
-
channelId,
|
|
1748
|
-
q,
|
|
1749
|
-
countryIsoCode,
|
|
1750
|
-
state,
|
|
1751
|
-
city,
|
|
1752
|
-
pincode,
|
|
1753
|
-
sector,
|
|
1754
|
-
},
|
|
1755
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1756
|
-
);
|
|
1757
|
-
if (error) {
|
|
1758
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1759
|
-
}
|
|
1760
|
-
|
|
1761
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1762
|
-
const {
|
|
1763
|
-
error: warrning,
|
|
1764
|
-
} = ServiceabilityPlatformValidator.getZones().validate(
|
|
1765
|
-
{
|
|
1766
|
-
pageNo,
|
|
1767
|
-
pageSize,
|
|
1768
|
-
isActive,
|
|
1769
|
-
channelId,
|
|
1770
|
-
q,
|
|
1771
|
-
countryIsoCode,
|
|
1772
|
-
state,
|
|
1773
|
-
city,
|
|
1774
|
-
pincode,
|
|
1775
|
-
sector,
|
|
1776
|
-
},
|
|
1777
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1778
|
-
);
|
|
1779
|
-
if (warrning) {
|
|
1780
|
-
Logger({
|
|
1781
|
-
level: "WARN",
|
|
1782
|
-
message: `Parameter Validation warrnings for platform > Serviceability > getZones \n ${warrning}`,
|
|
1783
|
-
});
|
|
1784
|
-
}
|
|
1785
|
-
|
|
1786
|
-
const query_params = {};
|
|
1787
|
-
query_params["page_no"] = pageNo;
|
|
1788
|
-
query_params["page_size"] = pageSize;
|
|
1789
|
-
query_params["is_active"] = isActive;
|
|
1790
|
-
query_params["channel_id"] = channelId;
|
|
1791
|
-
query_params["q"] = q;
|
|
1792
|
-
query_params["country_iso_code"] = countryIsoCode;
|
|
1793
|
-
query_params["state"] = state;
|
|
1794
|
-
query_params["city"] = city;
|
|
1795
|
-
query_params["pincode"] = pincode;
|
|
1796
|
-
query_params["sector"] = sector;
|
|
1797
|
-
|
|
1798
|
-
const xHeaders = {};
|
|
1799
|
-
|
|
1800
|
-
const response = await PlatformAPIClient.execute(
|
|
1801
|
-
this.config,
|
|
1802
|
-
"get",
|
|
1803
|
-
`/service/platform/logistics/v2.0/company/${this.config.companyId}/zones`,
|
|
1804
|
-
query_params,
|
|
1805
|
-
undefined,
|
|
1806
|
-
{ ...xHeaders, ...requestHeaders },
|
|
1807
|
-
{ responseHeaders }
|
|
1808
|
-
);
|
|
1809
|
-
|
|
1810
|
-
let responseData = response;
|
|
1811
|
-
if (responseHeaders) {
|
|
1812
|
-
responseData = response[0];
|
|
1813
|
-
}
|
|
1814
|
-
|
|
1815
|
-
const {
|
|
1816
|
-
error: res_error,
|
|
1817
|
-
} = ServiceabilityPlatformModel.ListViewResponse().validate(responseData, {
|
|
1818
|
-
abortEarly: false,
|
|
1819
|
-
allowUnknown: true,
|
|
1820
|
-
});
|
|
1821
|
-
|
|
1822
|
-
if (res_error) {
|
|
1823
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
1824
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1825
|
-
} else {
|
|
1826
|
-
Logger({
|
|
1827
|
-
level: "WARN",
|
|
1828
|
-
message: `Response Validation Warnings for platform > Serviceability > getZones \n ${res_error}`,
|
|
1829
|
-
});
|
|
1830
|
-
}
|
|
1831
|
-
}
|
|
1832
|
-
|
|
1833
|
-
return response;
|
|
1834
|
-
}
|
|
1835
|
-
|
|
1836
1717
|
/**
|
|
1837
1718
|
* @param {ServiceabilityPlatformValidator.UpdateCompanyConfigurationParam} arg
|
|
1838
1719
|
* - Arg object
|
|
@@ -107,19 +107,6 @@ export = ServiceabilityPlatformValidator;
|
|
|
107
107
|
* @typedef GetZoneByIdParam
|
|
108
108
|
* @property {string} zoneId - A `zone_id` is a unique identifier for a particular zone.
|
|
109
109
|
*/
|
|
110
|
-
/**
|
|
111
|
-
* @typedef GetZonesParam
|
|
112
|
-
* @property {number} [pageNo] - Index of the item to start returning with
|
|
113
|
-
* @property {number} [pageSize] - Determines the items to be displayed in a page
|
|
114
|
-
* @property {boolean} [isActive] - Status of Zone (either active or inactive)
|
|
115
|
-
* @property {string} [channelId] - Zones filtered by an application
|
|
116
|
-
* @property {string} [q] - Search with name as a free text
|
|
117
|
-
* @property {string} [countryIsoCode] - ISO2 code of the country
|
|
118
|
-
* @property {string} [state] - State name
|
|
119
|
-
* @property {string} [city] - City name
|
|
120
|
-
* @property {string} [pincode] - Pincode value to search zones
|
|
121
|
-
* @property {string} [sector] - Sector value to search zones
|
|
122
|
-
*/
|
|
123
110
|
/**
|
|
124
111
|
* @typedef UpdateCompanyConfigurationParam
|
|
125
112
|
* @property {ServiceabilityPlatformModel.CompanyConfig} body
|
|
@@ -192,8 +179,6 @@ declare class ServiceabilityPlatformValidator {
|
|
|
192
179
|
static getServiceability(): GetServiceabilityParam;
|
|
193
180
|
/** @returns {GetZoneByIdParam} */
|
|
194
181
|
static getZoneById(): GetZoneByIdParam;
|
|
195
|
-
/** @returns {GetZonesParam} */
|
|
196
|
-
static getZones(): GetZonesParam;
|
|
197
182
|
/** @returns {UpdateCompanyConfigurationParam} */
|
|
198
183
|
static updateCompanyConfiguration(): UpdateCompanyConfigurationParam;
|
|
199
184
|
/** @returns {UpdateCourierPartnerAccountParam} */
|
|
@@ -208,7 +193,7 @@ declare class ServiceabilityPlatformValidator {
|
|
|
208
193
|
static updateZoneById(): UpdateZoneByIdParam;
|
|
209
194
|
}
|
|
210
195
|
declare namespace ServiceabilityPlatformValidator {
|
|
211
|
-
export { BulkServiceabilityParam, BulkTatParam, CreateCourierPartnerAccountParam, CreatePackageMaterialParam, CreatePackageMaterialRuleParam, CreateZoneParam, GetAllStoresParam, GetBulkServiceabilityParam, GetBulkTatParam, GetCompanyConfigurationParam, GetCourierPartnerAccountParam, GetCourierPartnerAccountsParam, GetOptimalLocationsParam, GetPackageMaterialListParam, GetPackageMaterialRuleParam, GetPackageMaterialRulesParam, GetPackageMaterialsParam, GetServiceabilityParam, GetZoneByIdParam,
|
|
196
|
+
export { BulkServiceabilityParam, BulkTatParam, CreateCourierPartnerAccountParam, CreatePackageMaterialParam, CreatePackageMaterialRuleParam, CreateZoneParam, GetAllStoresParam, GetBulkServiceabilityParam, GetBulkTatParam, GetCompanyConfigurationParam, GetCourierPartnerAccountParam, GetCourierPartnerAccountsParam, GetOptimalLocationsParam, GetPackageMaterialListParam, GetPackageMaterialRuleParam, GetPackageMaterialRulesParam, GetPackageMaterialsParam, GetServiceabilityParam, GetZoneByIdParam, UpdateCompanyConfigurationParam, UpdateCourierPartnerAccountParam, UpdatePackageMaterialRuleParam, UpdatePackageMaterialsParam, UpdateServiceabilityParam, UpdateZoneByIdParam };
|
|
212
197
|
}
|
|
213
198
|
type BulkServiceabilityParam = {
|
|
214
199
|
/**
|
|
@@ -437,48 +422,6 @@ type GetZoneByIdParam = {
|
|
|
437
422
|
*/
|
|
438
423
|
zoneId: string;
|
|
439
424
|
};
|
|
440
|
-
type GetZonesParam = {
|
|
441
|
-
/**
|
|
442
|
-
* - Index of the item to start returning with
|
|
443
|
-
*/
|
|
444
|
-
pageNo?: number;
|
|
445
|
-
/**
|
|
446
|
-
* - Determines the items to be displayed in a page
|
|
447
|
-
*/
|
|
448
|
-
pageSize?: number;
|
|
449
|
-
/**
|
|
450
|
-
* - Status of Zone (either active or inactive)
|
|
451
|
-
*/
|
|
452
|
-
isActive?: boolean;
|
|
453
|
-
/**
|
|
454
|
-
* - Zones filtered by an application
|
|
455
|
-
*/
|
|
456
|
-
channelId?: string;
|
|
457
|
-
/**
|
|
458
|
-
* - Search with name as a free text
|
|
459
|
-
*/
|
|
460
|
-
q?: string;
|
|
461
|
-
/**
|
|
462
|
-
* - ISO2 code of the country
|
|
463
|
-
*/
|
|
464
|
-
countryIsoCode?: string;
|
|
465
|
-
/**
|
|
466
|
-
* - State name
|
|
467
|
-
*/
|
|
468
|
-
state?: string;
|
|
469
|
-
/**
|
|
470
|
-
* - City name
|
|
471
|
-
*/
|
|
472
|
-
city?: string;
|
|
473
|
-
/**
|
|
474
|
-
* - Pincode value to search zones
|
|
475
|
-
*/
|
|
476
|
-
pincode?: string;
|
|
477
|
-
/**
|
|
478
|
-
* - Sector value to search zones
|
|
479
|
-
*/
|
|
480
|
-
sector?: string;
|
|
481
|
-
};
|
|
482
425
|
type UpdateCompanyConfigurationParam = {
|
|
483
426
|
body: ServiceabilityPlatformModel.CompanyConfig;
|
|
484
427
|
};
|
|
@@ -129,20 +129,6 @@ const ServiceabilityPlatformModel = require("./ServiceabilityPlatformModel");
|
|
|
129
129
|
* @property {string} zoneId - A `zone_id` is a unique identifier for a particular zone.
|
|
130
130
|
*/
|
|
131
131
|
|
|
132
|
-
/**
|
|
133
|
-
* @typedef GetZonesParam
|
|
134
|
-
* @property {number} [pageNo] - Index of the item to start returning with
|
|
135
|
-
* @property {number} [pageSize] - Determines the items to be displayed in a page
|
|
136
|
-
* @property {boolean} [isActive] - Status of Zone (either active or inactive)
|
|
137
|
-
* @property {string} [channelId] - Zones filtered by an application
|
|
138
|
-
* @property {string} [q] - Search with name as a free text
|
|
139
|
-
* @property {string} [countryIsoCode] - ISO2 code of the country
|
|
140
|
-
* @property {string} [state] - State name
|
|
141
|
-
* @property {string} [city] - City name
|
|
142
|
-
* @property {string} [pincode] - Pincode value to search zones
|
|
143
|
-
* @property {string} [sector] - Sector value to search zones
|
|
144
|
-
*/
|
|
145
|
-
|
|
146
132
|
/**
|
|
147
133
|
* @typedef UpdateCompanyConfigurationParam
|
|
148
134
|
* @property {ServiceabilityPlatformModel.CompanyConfig} body
|
|
@@ -348,22 +334,6 @@ class ServiceabilityPlatformValidator {
|
|
|
348
334
|
}).required();
|
|
349
335
|
}
|
|
350
336
|
|
|
351
|
-
/** @returns {GetZonesParam} */
|
|
352
|
-
static getZones() {
|
|
353
|
-
return Joi.object({
|
|
354
|
-
pageNo: Joi.number(),
|
|
355
|
-
pageSize: Joi.number(),
|
|
356
|
-
isActive: Joi.boolean(),
|
|
357
|
-
channelId: Joi.string().allow(""),
|
|
358
|
-
q: Joi.string().allow(""),
|
|
359
|
-
countryIsoCode: Joi.string().allow(""),
|
|
360
|
-
state: Joi.string().allow(""),
|
|
361
|
-
city: Joi.string().allow(""),
|
|
362
|
-
pincode: Joi.string().allow(""),
|
|
363
|
-
sector: Joi.string().allow(""),
|
|
364
|
-
}).required();
|
|
365
|
-
}
|
|
366
|
-
|
|
367
337
|
/** @returns {UpdateCompanyConfigurationParam} */
|
|
368
338
|
static updateCompanyConfiguration() {
|
|
369
339
|
return Joi.object({
|