@gofynd/fdk-client-javascript 1.4.15-beta.3 → 1.4.15
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 +11 -11
- package/sdk/application/Cart/CartApplicationClient.js +48 -50
- package/sdk/application/Content/ContentApplicationClient.d.ts +0 -20
- package/sdk/application/Content/ContentApplicationClient.js +0 -78
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +1 -1
- package/sdk/application/Logistic/LogisticApplicationClient.js +2 -0
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +10 -0
- package/sdk/application/Payment/PaymentApplicationClient.js +39 -0
- package/sdk/partner/Logistics/LogisticsPartnerClient.d.ts +33 -12
- package/sdk/partner/Logistics/LogisticsPartnerClient.js +209 -38
- package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +399 -19
- package/sdk/partner/Logistics/LogisticsPartnerModel.js +212 -11
- package/sdk/partner/Logistics/LogisticsPartnerValidator.d.ts +3 -1
- package/sdk/partner/Logistics/LogisticsPartnerValidator.js +22 -7
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +1 -1
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +1 -1
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +3 -12
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +0 -7
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +0 -3
- package/sdk/platform/Cart/CartPlatformModel.d.ts +28 -14
- package/sdk/platform/Cart/CartPlatformModel.js +12 -6
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +24 -0
- package/sdk/platform/Catalog/CatalogPlatformClient.js +176 -0
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +80 -29
- package/sdk/platform/Catalog/CatalogPlatformModel.js +72 -32
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +45 -1
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +35 -0
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +0 -52
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +0 -411
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +1 -85
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +0 -73
- package/sdk/platform/Content/ContentPlatformModel.d.ts +1 -90
- package/sdk/platform/Content/ContentPlatformModel.js +0 -104
- package/sdk/platform/Order/OrderPlatformClient.d.ts +2 -2
- package/sdk/platform/Order/OrderPlatformClient.js +8 -0
- package/sdk/platform/Order/OrderPlatformModel.d.ts +75 -3
- package/sdk/platform/Order/OrderPlatformModel.js +43 -2
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +22 -0
- package/sdk/platform/Order/OrderPlatformValidator.js +10 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +94 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +699 -76
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +598 -23
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +382 -20
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +134 -1
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +108 -0
|
@@ -1888,12 +1888,101 @@ class Logistics {
|
|
|
1888
1888
|
return response;
|
|
1889
1889
|
}
|
|
1890
1890
|
|
|
1891
|
+
/**
|
|
1892
|
+
* @param {LogisticsPartnerValidator.GetCountriesParam} arg - Arg object.
|
|
1893
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1894
|
+
* @param {import("../PartnerAPIClient").Options} - Options
|
|
1895
|
+
* @returns {Promise<LogisticsPartnerModel.GetCountries>} - Success response
|
|
1896
|
+
* @name getCountries
|
|
1897
|
+
* @summary: Get all countries and associated data
|
|
1898
|
+
* @description: Retrieve of all countries. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/partner/logistics/getCountries/).
|
|
1899
|
+
*/
|
|
1900
|
+
async getCountries(
|
|
1901
|
+
{ onboarding, pageNo, pageSize, q, requestHeaders } = {
|
|
1902
|
+
requestHeaders: {},
|
|
1903
|
+
},
|
|
1904
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1905
|
+
) {
|
|
1906
|
+
const { error } = LogisticsPartnerValidator.getCountries().validate(
|
|
1907
|
+
{
|
|
1908
|
+
onboarding,
|
|
1909
|
+
pageNo,
|
|
1910
|
+
pageSize,
|
|
1911
|
+
q,
|
|
1912
|
+
},
|
|
1913
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1914
|
+
);
|
|
1915
|
+
if (error) {
|
|
1916
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1917
|
+
}
|
|
1918
|
+
|
|
1919
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1920
|
+
const {
|
|
1921
|
+
error: warrning,
|
|
1922
|
+
} = LogisticsPartnerValidator.getCountries().validate(
|
|
1923
|
+
{
|
|
1924
|
+
onboarding,
|
|
1925
|
+
pageNo,
|
|
1926
|
+
pageSize,
|
|
1927
|
+
q,
|
|
1928
|
+
},
|
|
1929
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1930
|
+
);
|
|
1931
|
+
if (warrning) {
|
|
1932
|
+
Logger({
|
|
1933
|
+
level: "WARN",
|
|
1934
|
+
message: `Parameter Validation warrnings for partner > Logistics > getCountries \n ${warrning}`,
|
|
1935
|
+
});
|
|
1936
|
+
}
|
|
1937
|
+
|
|
1938
|
+
const query_params = {};
|
|
1939
|
+
query_params["onboarding"] = onboarding;
|
|
1940
|
+
query_params["page_no"] = pageNo;
|
|
1941
|
+
query_params["page_size"] = pageSize;
|
|
1942
|
+
query_params["q"] = q;
|
|
1943
|
+
|
|
1944
|
+
const response = await PartnerAPIClient.execute(
|
|
1945
|
+
this.config,
|
|
1946
|
+
"get",
|
|
1947
|
+
`/service/partner/logistics/v2.0/organization/${this.config.organizationId}/countries`,
|
|
1948
|
+
query_params,
|
|
1949
|
+
undefined,
|
|
1950
|
+
requestHeaders,
|
|
1951
|
+
{ responseHeaders }
|
|
1952
|
+
);
|
|
1953
|
+
|
|
1954
|
+
let responseData = response;
|
|
1955
|
+
if (responseHeaders) {
|
|
1956
|
+
responseData = response[0];
|
|
1957
|
+
}
|
|
1958
|
+
|
|
1959
|
+
const {
|
|
1960
|
+
error: res_error,
|
|
1961
|
+
} = LogisticsPartnerModel.GetCountries().validate(responseData, {
|
|
1962
|
+
abortEarly: false,
|
|
1963
|
+
allowUnknown: true,
|
|
1964
|
+
});
|
|
1965
|
+
|
|
1966
|
+
if (res_error) {
|
|
1967
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
1968
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1969
|
+
} else {
|
|
1970
|
+
Logger({
|
|
1971
|
+
level: "WARN",
|
|
1972
|
+
message: `Response Validation Warnings for partner > Logistics > getCountries \n ${res_error}`,
|
|
1973
|
+
});
|
|
1974
|
+
}
|
|
1975
|
+
}
|
|
1976
|
+
|
|
1977
|
+
return response;
|
|
1978
|
+
}
|
|
1979
|
+
|
|
1891
1980
|
/**
|
|
1892
1981
|
* @param {LogisticsPartnerValidator.CreateCourierPartnerSchemeParam} arg -
|
|
1893
1982
|
* Arg object.
|
|
1894
1983
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1895
1984
|
* @param {import("../PartnerAPIClient").Options} - Options
|
|
1896
|
-
* @returns {Promise<LogisticsPartnerModel.
|
|
1985
|
+
* @returns {Promise<LogisticsPartnerModel.CourierPartnerV2SchemeModel>} -
|
|
1897
1986
|
* Success response
|
|
1898
1987
|
* @name createCourierPartnerScheme
|
|
1899
1988
|
* @summary: Create Scheme for courier partner extension
|
|
@@ -1936,7 +2025,7 @@ class Logistics {
|
|
|
1936
2025
|
const response = await PartnerAPIClient.execute(
|
|
1937
2026
|
this.config,
|
|
1938
2027
|
"post",
|
|
1939
|
-
`/service/partner/logistics/
|
|
2028
|
+
`/service/partner/logistics/v2.0/organization/${this.config.organizationId}/courier-partner/scheme`,
|
|
1940
2029
|
query_params,
|
|
1941
2030
|
body,
|
|
1942
2031
|
requestHeaders,
|
|
@@ -1950,7 +2039,7 @@ class Logistics {
|
|
|
1950
2039
|
|
|
1951
2040
|
const {
|
|
1952
2041
|
error: res_error,
|
|
1953
|
-
} = LogisticsPartnerModel.
|
|
2042
|
+
} = LogisticsPartnerModel.CourierPartnerV2SchemeModel().validate(
|
|
1954
2043
|
responseData,
|
|
1955
2044
|
{ abortEarly: false, allowUnknown: true }
|
|
1956
2045
|
);
|
|
@@ -1969,14 +2058,105 @@ class Logistics {
|
|
|
1969
2058
|
return response;
|
|
1970
2059
|
}
|
|
1971
2060
|
|
|
2061
|
+
/**
|
|
2062
|
+
* @param {LogisticsPartnerValidator.GetCourierPartnerSchemesParam} arg - Arg object.
|
|
2063
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2064
|
+
* @param {import("../PartnerAPIClient").Options} - Options
|
|
2065
|
+
* @returns {Promise<LogisticsPartnerModel.courierPartnerSchemeV2List>} -
|
|
2066
|
+
* Success response
|
|
2067
|
+
* @name getCourierPartnerSchemes
|
|
2068
|
+
* @summary: Get created Schemes for courier partner
|
|
2069
|
+
* @description: Get created Schemes for courier partner - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/partner/logistics/getCourierPartnerSchemes/).
|
|
2070
|
+
*/
|
|
2071
|
+
async getCourierPartnerSchemes(
|
|
2072
|
+
{ schemeType, paymentMode, capabilities, schemeIds, requestHeaders } = {
|
|
2073
|
+
requestHeaders: {},
|
|
2074
|
+
},
|
|
2075
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
2076
|
+
) {
|
|
2077
|
+
const {
|
|
2078
|
+
error,
|
|
2079
|
+
} = LogisticsPartnerValidator.getCourierPartnerSchemes().validate(
|
|
2080
|
+
{
|
|
2081
|
+
schemeType,
|
|
2082
|
+
paymentMode,
|
|
2083
|
+
capabilities,
|
|
2084
|
+
schemeIds,
|
|
2085
|
+
},
|
|
2086
|
+
{ abortEarly: false, allowUnknown: true }
|
|
2087
|
+
);
|
|
2088
|
+
if (error) {
|
|
2089
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
2090
|
+
}
|
|
2091
|
+
|
|
2092
|
+
// Showing warrnings if extra unknown parameters are found
|
|
2093
|
+
const {
|
|
2094
|
+
error: warrning,
|
|
2095
|
+
} = LogisticsPartnerValidator.getCourierPartnerSchemes().validate(
|
|
2096
|
+
{
|
|
2097
|
+
schemeType,
|
|
2098
|
+
paymentMode,
|
|
2099
|
+
capabilities,
|
|
2100
|
+
schemeIds,
|
|
2101
|
+
},
|
|
2102
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2103
|
+
);
|
|
2104
|
+
if (warrning) {
|
|
2105
|
+
Logger({
|
|
2106
|
+
level: "WARN",
|
|
2107
|
+
message: `Parameter Validation warrnings for partner > Logistics > getCourierPartnerSchemes \n ${warrning}`,
|
|
2108
|
+
});
|
|
2109
|
+
}
|
|
2110
|
+
|
|
2111
|
+
const query_params = {};
|
|
2112
|
+
query_params["scheme_type"] = schemeType;
|
|
2113
|
+
query_params["payment_mode"] = paymentMode;
|
|
2114
|
+
query_params["capabilities"] = capabilities;
|
|
2115
|
+
query_params["scheme_ids"] = schemeIds;
|
|
2116
|
+
|
|
2117
|
+
const response = await PartnerAPIClient.execute(
|
|
2118
|
+
this.config,
|
|
2119
|
+
"get",
|
|
2120
|
+
`/service/partner/logistics/v2.0/organization/${this.config.organizationId}/courier-partner/scheme`,
|
|
2121
|
+
query_params,
|
|
2122
|
+
undefined,
|
|
2123
|
+
requestHeaders,
|
|
2124
|
+
{ responseHeaders }
|
|
2125
|
+
);
|
|
2126
|
+
|
|
2127
|
+
let responseData = response;
|
|
2128
|
+
if (responseHeaders) {
|
|
2129
|
+
responseData = response[0];
|
|
2130
|
+
}
|
|
2131
|
+
|
|
2132
|
+
const {
|
|
2133
|
+
error: res_error,
|
|
2134
|
+
} = LogisticsPartnerModel.courierPartnerSchemeV2List().validate(
|
|
2135
|
+
responseData,
|
|
2136
|
+
{ abortEarly: false, allowUnknown: true }
|
|
2137
|
+
);
|
|
2138
|
+
|
|
2139
|
+
if (res_error) {
|
|
2140
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
2141
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
2142
|
+
} else {
|
|
2143
|
+
Logger({
|
|
2144
|
+
level: "WARN",
|
|
2145
|
+
message: `Response Validation Warnings for partner > Logistics > getCourierPartnerSchemes \n ${res_error}`,
|
|
2146
|
+
});
|
|
2147
|
+
}
|
|
2148
|
+
}
|
|
2149
|
+
|
|
2150
|
+
return response;
|
|
2151
|
+
}
|
|
2152
|
+
|
|
1972
2153
|
/**
|
|
1973
2154
|
* @param {LogisticsPartnerValidator.UpdateCourierPartnerSchemeParam} arg -
|
|
1974
2155
|
* Arg object.
|
|
1975
2156
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1976
2157
|
* @param {import("../PartnerAPIClient").Options} - Options
|
|
1977
|
-
* @returns {Promise<LogisticsPartnerModel.
|
|
1978
|
-
*
|
|
1979
|
-
*
|
|
2158
|
+
* @returns {Promise<LogisticsPartnerModel.CourierPartnerV2SchemeModel>} -
|
|
2159
|
+
* Success response
|
|
1980
2160
|
* @name updateCourierPartnerScheme
|
|
1981
2161
|
* @summary: Update Scheme for courier partner extension
|
|
1982
2162
|
* @description: Update Scheme for courier partner extension - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/partner/logistics/updateCourierPartnerScheme/).
|
|
@@ -2020,7 +2200,7 @@ class Logistics {
|
|
|
2020
2200
|
const response = await PartnerAPIClient.execute(
|
|
2021
2201
|
this.config,
|
|
2022
2202
|
"put",
|
|
2023
|
-
`/service/partner/logistics/
|
|
2203
|
+
`/service/partner/logistics/v2.0/organization/${this.config.organizationId}/courier-partner/scheme/${schemeId}`,
|
|
2024
2204
|
query_params,
|
|
2025
2205
|
body,
|
|
2026
2206
|
requestHeaders,
|
|
@@ -2034,7 +2214,7 @@ class Logistics {
|
|
|
2034
2214
|
|
|
2035
2215
|
const {
|
|
2036
2216
|
error: res_error,
|
|
2037
|
-
} = LogisticsPartnerModel.
|
|
2217
|
+
} = LogisticsPartnerModel.CourierPartnerV2SchemeModel().validate(
|
|
2038
2218
|
responseData,
|
|
2039
2219
|
{ abortEarly: false, allowUnknown: true }
|
|
2040
2220
|
);
|
|
@@ -2054,26 +2234,24 @@ class Logistics {
|
|
|
2054
2234
|
}
|
|
2055
2235
|
|
|
2056
2236
|
/**
|
|
2057
|
-
* @param {LogisticsPartnerValidator.
|
|
2237
|
+
* @param {LogisticsPartnerValidator.GetCourierPartnerSchemeParam} arg - Arg object.
|
|
2058
2238
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2059
2239
|
* @param {import("../PartnerAPIClient").Options} - Options
|
|
2060
|
-
* @returns {Promise<LogisticsPartnerModel.
|
|
2061
|
-
*
|
|
2062
|
-
* @
|
|
2063
|
-
* @
|
|
2240
|
+
* @returns {Promise<LogisticsPartnerModel.CourierPartnerV2SchemeModel>} -
|
|
2241
|
+
* Success response
|
|
2242
|
+
* @name getCourierPartnerScheme
|
|
2243
|
+
* @summary: Get Scheme for courier partner extension by Id
|
|
2244
|
+
* @description: Update Scheme for courier partner extension by Id - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/partner/logistics/getCourierPartnerScheme/).
|
|
2064
2245
|
*/
|
|
2065
|
-
async
|
|
2066
|
-
{
|
|
2067
|
-
requestHeaders: {},
|
|
2068
|
-
},
|
|
2246
|
+
async getCourierPartnerScheme(
|
|
2247
|
+
{ schemeId, requestHeaders } = { requestHeaders: {} },
|
|
2069
2248
|
{ responseHeaders } = { responseHeaders: false }
|
|
2070
2249
|
) {
|
|
2071
|
-
const {
|
|
2250
|
+
const {
|
|
2251
|
+
error,
|
|
2252
|
+
} = LogisticsPartnerValidator.getCourierPartnerScheme().validate(
|
|
2072
2253
|
{
|
|
2073
|
-
|
|
2074
|
-
pageNo,
|
|
2075
|
-
pageSize,
|
|
2076
|
-
q,
|
|
2254
|
+
schemeId,
|
|
2077
2255
|
},
|
|
2078
2256
|
{ abortEarly: false, allowUnknown: true }
|
|
2079
2257
|
);
|
|
@@ -2084,32 +2262,25 @@ class Logistics {
|
|
|
2084
2262
|
// Showing warrnings if extra unknown parameters are found
|
|
2085
2263
|
const {
|
|
2086
2264
|
error: warrning,
|
|
2087
|
-
} = LogisticsPartnerValidator.
|
|
2265
|
+
} = LogisticsPartnerValidator.getCourierPartnerScheme().validate(
|
|
2088
2266
|
{
|
|
2089
|
-
|
|
2090
|
-
pageNo,
|
|
2091
|
-
pageSize,
|
|
2092
|
-
q,
|
|
2267
|
+
schemeId,
|
|
2093
2268
|
},
|
|
2094
2269
|
{ abortEarly: false, allowUnknown: false }
|
|
2095
2270
|
);
|
|
2096
2271
|
if (warrning) {
|
|
2097
2272
|
Logger({
|
|
2098
2273
|
level: "WARN",
|
|
2099
|
-
message: `Parameter Validation warrnings for partner > Logistics >
|
|
2274
|
+
message: `Parameter Validation warrnings for partner > Logistics > getCourierPartnerScheme \n ${warrning}`,
|
|
2100
2275
|
});
|
|
2101
2276
|
}
|
|
2102
2277
|
|
|
2103
2278
|
const query_params = {};
|
|
2104
|
-
query_params["onboarding"] = onboarding;
|
|
2105
|
-
query_params["page_no"] = pageNo;
|
|
2106
|
-
query_params["page_size"] = pageSize;
|
|
2107
|
-
query_params["q"] = q;
|
|
2108
2279
|
|
|
2109
2280
|
const response = await PartnerAPIClient.execute(
|
|
2110
2281
|
this.config,
|
|
2111
2282
|
"get",
|
|
2112
|
-
`/service/partner/logistics/v2.0/organization/${this.config.organizationId}/
|
|
2283
|
+
`/service/partner/logistics/v2.0/organization/${this.config.organizationId}/courier-partner/scheme/${schemeId}`,
|
|
2113
2284
|
query_params,
|
|
2114
2285
|
undefined,
|
|
2115
2286
|
requestHeaders,
|
|
@@ -2123,10 +2294,10 @@ class Logistics {
|
|
|
2123
2294
|
|
|
2124
2295
|
const {
|
|
2125
2296
|
error: res_error,
|
|
2126
|
-
} = LogisticsPartnerModel.
|
|
2127
|
-
|
|
2128
|
-
allowUnknown: true
|
|
2129
|
-
|
|
2297
|
+
} = LogisticsPartnerModel.CourierPartnerV2SchemeModel().validate(
|
|
2298
|
+
responseData,
|
|
2299
|
+
{ abortEarly: false, allowUnknown: true }
|
|
2300
|
+
);
|
|
2130
2301
|
|
|
2131
2302
|
if (res_error) {
|
|
2132
2303
|
if (this.config.options.strictResponseCheck === true) {
|
|
@@ -2134,7 +2305,7 @@ class Logistics {
|
|
|
2134
2305
|
} else {
|
|
2135
2306
|
Logger({
|
|
2136
2307
|
level: "WARN",
|
|
2137
|
-
message: `Response Validation Warnings for partner > Logistics >
|
|
2308
|
+
message: `Response Validation Warnings for partner > Logistics > getCourierPartnerScheme \n ${res_error}`,
|
|
2138
2309
|
});
|
|
2139
2310
|
}
|
|
2140
2311
|
}
|