@gofynd/fdk-client-javascript 0.1.36 → 0.1.37
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/documentation/application/CART.md +291 -285
- package/documentation/application/CATALOG.md +411 -411
- package/documentation/application/LOGISTIC.md +423 -101
- package/documentation/application/ORDER.md +287 -287
- package/documentation/application/POSCART.md +319 -313
- package/documentation/application/README.md +1 -1
- package/documentation/platform/AUDITTRAIL.md +2 -2
- package/documentation/platform/CART.md +488 -488
- package/documentation/platform/CATALOG.md +1656 -1439
- package/documentation/platform/COMPANYPROFILE.md +250 -229
- package/documentation/platform/ORDER.md +1183 -1183
- package/package.json +2 -2
- package/sdk/application/ApplicationAPIClient.js +3 -0
- package/sdk/application/ApplicationClient.d.ts +1 -0
- package/sdk/application/ApplicationClient.js +11 -1
- package/sdk/application/ApplicationConfig.d.ts +1 -0
- package/sdk/application/ApplicationConfig.js +1 -0
- package/sdk/application/ApplicationModels.d.ts +83 -78
- package/sdk/application/ApplicationModels.js +1445 -1354
- package/sdk/application/client/LogisticApplicationClient.d.ts +32 -21
- package/sdk/application/client/LogisticApplicationClient.js +62 -27
- package/sdk/application/models/LogisticValidator.d.ts +2 -1
- package/sdk/application/models/LogisticValidator.js +11 -6
- package/sdk/common/AxiosHelper.js +1 -1
- package/sdk/platform/PlatformApplicationClient.d.ts +5328 -5185
- package/sdk/platform/PlatformApplicationClient.js +2877 -2795
- package/sdk/platform/PlatformApplicationModels.d.ts +5 -5
- package/sdk/platform/PlatformApplicationModels.js +3707 -3571
- package/sdk/platform/PlatformClient.d.ts +2577 -2509
- package/sdk/platform/PlatformClient.js +2770 -2688
- package/sdk/platform/PlatformModels.d.ts +146 -139
- package/sdk/platform/PlatformModels.js +3718 -3582
- package/sdk/platform/client/CatalogPlatformClient.d.ts +21 -12
- package/sdk/platform/client/CatalogPlatformClient.js +48 -17
- package/sdk/platform/models/CatalogValidator.d.ts +2 -1
- package/sdk/platform/models/CatalogValidator.js +11 -5
|
@@ -3,40 +3,51 @@ declare class Logistic {
|
|
|
3
3
|
constructor(_conf: any);
|
|
4
4
|
_conf: any;
|
|
5
5
|
_relativeUrls: {
|
|
6
|
+
getPincodeCity: string;
|
|
6
7
|
getTatProduct: string;
|
|
8
|
+
getAllCountries: string;
|
|
7
9
|
getPincodeZones: string;
|
|
8
|
-
getPincodeCity: string;
|
|
9
10
|
};
|
|
10
11
|
_urls: {};
|
|
11
12
|
updateUrls(urls: any): void;
|
|
12
13
|
/**
|
|
13
14
|
* @param {Object} arg - Arg object.
|
|
14
|
-
* @param {
|
|
15
|
-
*
|
|
16
|
-
* @
|
|
17
|
-
* @
|
|
15
|
+
* @param {string} arg.pincode - A `pincode` contains a specific address of
|
|
16
|
+
* a location.
|
|
17
|
+
* @param {string} [arg.countryCode] - A 3 alphabetic country code
|
|
18
|
+
* @returns {Promise<PincodeApiResponse>} - Success response
|
|
19
|
+
* @summary: Get Pincode API
|
|
20
|
+
* @description: Get pincode data
|
|
21
|
+
*/
|
|
22
|
+
getPincodeCity({ pincode, countryCode }?: {
|
|
23
|
+
pincode: string;
|
|
24
|
+
countryCode?: string;
|
|
25
|
+
}): Promise<PincodeApiResponse>;
|
|
26
|
+
/**
|
|
27
|
+
* @param {Object} arg - Arg object.
|
|
28
|
+
* @param {TATViewRequest} arg.body
|
|
29
|
+
* @returns {Promise<TATViewResponse>} - Success response
|
|
30
|
+
* @summary: Get TAT API
|
|
31
|
+
* @description: Get TAT data
|
|
18
32
|
*/
|
|
19
33
|
getTatProduct({ body }?: {
|
|
20
|
-
body:
|
|
21
|
-
}): Promise<
|
|
34
|
+
body: TATViewRequest;
|
|
35
|
+
}): Promise<TATViewResponse>;
|
|
22
36
|
/**
|
|
23
37
|
* @param {Object} arg - Arg object.
|
|
24
|
-
* @
|
|
25
|
-
* @
|
|
26
|
-
* @
|
|
27
|
-
* @description: Get to know the zones of a specefic pincode
|
|
38
|
+
* @returns {Promise<CountryListResponse>} - Success response
|
|
39
|
+
* @summary: Get Country List
|
|
40
|
+
* @description: Get all countries
|
|
28
41
|
*/
|
|
29
|
-
|
|
30
|
-
body: GetPincodeZonesReqBody;
|
|
31
|
-
}): Promise<GetPincodeZonesResponse>;
|
|
42
|
+
getAllCountries({}?: any): Promise<CountryListResponse>;
|
|
32
43
|
/**
|
|
33
44
|
* @param {Object} arg - Arg object.
|
|
34
|
-
* @param {
|
|
35
|
-
* @returns {Promise<
|
|
36
|
-
* @summary:
|
|
37
|
-
* @description:
|
|
45
|
+
* @param {GetZoneFromPincodeViewRequest} arg.body
|
|
46
|
+
* @returns {Promise<GetZoneFromPincodeViewResponse>} - Success response
|
|
47
|
+
* @summary: GET zone from the Pincode.
|
|
48
|
+
* @description: This API returns zone from the Pincode View.
|
|
38
49
|
*/
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}): Promise<
|
|
50
|
+
getPincodeZones({ body }?: {
|
|
51
|
+
body: GetZoneFromPincodeViewRequest;
|
|
52
|
+
}): Promise<GetZoneFromPincodeViewResponse>;
|
|
42
53
|
}
|
|
@@ -8,9 +8,10 @@ class Logistic {
|
|
|
8
8
|
constructor(_conf) {
|
|
9
9
|
this._conf = _conf;
|
|
10
10
|
this._relativeUrls = {
|
|
11
|
-
getTatProduct: "/service/application/logistics/v1.0",
|
|
12
|
-
getPincodeZones: "/service/application/logistics/v1.0/pincode/zones",
|
|
13
11
|
getPincodeCity: "/service/application/logistics/v1.0/pincode/{pincode}",
|
|
12
|
+
getTatProduct: "/service/application/logistics/v1.0/",
|
|
13
|
+
getAllCountries: "/service/application/logistics/v1.0/country-list",
|
|
14
|
+
getPincodeZones: "/service/application/logistics/v1.0/pincode/zones",
|
|
14
15
|
};
|
|
15
16
|
this._urls = Object.entries(this._relativeUrls).reduce(
|
|
16
17
|
(urls, [method, relativeUrl]) => {
|
|
@@ -30,10 +31,45 @@ class Logistic {
|
|
|
30
31
|
|
|
31
32
|
/**
|
|
32
33
|
* @param {Object} arg - Arg object.
|
|
33
|
-
* @param {
|
|
34
|
-
*
|
|
35
|
-
* @
|
|
36
|
-
* @
|
|
34
|
+
* @param {string} arg.pincode - A `pincode` contains a specific address of
|
|
35
|
+
* a location.
|
|
36
|
+
* @param {string} [arg.countryCode] - A 3 alphabetic country code
|
|
37
|
+
* @returns {Promise<PincodeApiResponse>} - Success response
|
|
38
|
+
* @summary: Get Pincode API
|
|
39
|
+
* @description: Get pincode data
|
|
40
|
+
*/
|
|
41
|
+
getPincodeCity({ pincode, countryCode } = {}) {
|
|
42
|
+
const { error } = LogisticValidator.getPincodeCity().validate(
|
|
43
|
+
{ pincode, countryCode },
|
|
44
|
+
{ abortEarly: false, allowUnknown: true }
|
|
45
|
+
);
|
|
46
|
+
if (error) {
|
|
47
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
48
|
+
}
|
|
49
|
+
const query_params = {};
|
|
50
|
+
query_params["country_code"] = countryCode;
|
|
51
|
+
|
|
52
|
+
const xHeaders = {};
|
|
53
|
+
|
|
54
|
+
return APIClient.execute(
|
|
55
|
+
this._conf,
|
|
56
|
+
"get",
|
|
57
|
+
constructUrl({
|
|
58
|
+
url: this._urls["getPincodeCity"],
|
|
59
|
+
params: { pincode },
|
|
60
|
+
}),
|
|
61
|
+
query_params,
|
|
62
|
+
undefined,
|
|
63
|
+
xHeaders
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* @param {Object} arg - Arg object.
|
|
69
|
+
* @param {TATViewRequest} arg.body
|
|
70
|
+
* @returns {Promise<TATViewResponse>} - Success response
|
|
71
|
+
* @summary: Get TAT API
|
|
72
|
+
* @description: Get TAT data
|
|
37
73
|
*/
|
|
38
74
|
getTatProduct({ body } = {}) {
|
|
39
75
|
const { error } = LogisticValidator.getTatProduct().validate(
|
|
@@ -62,14 +98,13 @@ class Logistic {
|
|
|
62
98
|
|
|
63
99
|
/**
|
|
64
100
|
* @param {Object} arg - Arg object.
|
|
65
|
-
* @
|
|
66
|
-
* @
|
|
67
|
-
* @
|
|
68
|
-
* @description: Get to know the zones of a specefic pincode
|
|
101
|
+
* @returns {Promise<CountryListResponse>} - Success response
|
|
102
|
+
* @summary: Get Country List
|
|
103
|
+
* @description: Get all countries
|
|
69
104
|
*/
|
|
70
|
-
|
|
71
|
-
const { error } = LogisticValidator.
|
|
72
|
-
{
|
|
105
|
+
getAllCountries({} = {}) {
|
|
106
|
+
const { error } = LogisticValidator.getAllCountries().validate(
|
|
107
|
+
{},
|
|
73
108
|
{ abortEarly: false, allowUnknown: true }
|
|
74
109
|
);
|
|
75
110
|
if (error) {
|
|
@@ -81,27 +116,27 @@ class Logistic {
|
|
|
81
116
|
|
|
82
117
|
return APIClient.execute(
|
|
83
118
|
this._conf,
|
|
84
|
-
"
|
|
119
|
+
"get",
|
|
85
120
|
constructUrl({
|
|
86
|
-
url: this._urls["
|
|
121
|
+
url: this._urls["getAllCountries"],
|
|
87
122
|
params: {},
|
|
88
123
|
}),
|
|
89
124
|
query_params,
|
|
90
|
-
|
|
125
|
+
undefined,
|
|
91
126
|
xHeaders
|
|
92
127
|
);
|
|
93
128
|
}
|
|
94
129
|
|
|
95
130
|
/**
|
|
96
131
|
* @param {Object} arg - Arg object.
|
|
97
|
-
* @param {
|
|
98
|
-
* @returns {Promise<
|
|
99
|
-
* @summary:
|
|
100
|
-
* @description:
|
|
132
|
+
* @param {GetZoneFromPincodeViewRequest} arg.body
|
|
133
|
+
* @returns {Promise<GetZoneFromPincodeViewResponse>} - Success response
|
|
134
|
+
* @summary: GET zone from the Pincode.
|
|
135
|
+
* @description: This API returns zone from the Pincode View.
|
|
101
136
|
*/
|
|
102
|
-
|
|
103
|
-
const { error } = LogisticValidator.
|
|
104
|
-
{
|
|
137
|
+
getPincodeZones({ body } = {}) {
|
|
138
|
+
const { error } = LogisticValidator.getPincodeZones().validate(
|
|
139
|
+
{ body },
|
|
105
140
|
{ abortEarly: false, allowUnknown: true }
|
|
106
141
|
);
|
|
107
142
|
if (error) {
|
|
@@ -113,13 +148,13 @@ class Logistic {
|
|
|
113
148
|
|
|
114
149
|
return APIClient.execute(
|
|
115
150
|
this._conf,
|
|
116
|
-
"
|
|
151
|
+
"post",
|
|
117
152
|
constructUrl({
|
|
118
|
-
url: this._urls["
|
|
119
|
-
params: {
|
|
153
|
+
url: this._urls["getPincodeZones"],
|
|
154
|
+
params: {},
|
|
120
155
|
}),
|
|
121
156
|
query_params,
|
|
122
|
-
|
|
157
|
+
body,
|
|
123
158
|
xHeaders
|
|
124
159
|
);
|
|
125
160
|
}
|
|
@@ -1,21 +1,26 @@
|
|
|
1
1
|
const Joi = require("joi");
|
|
2
2
|
const { Validator } = require("../ApplicationModels");
|
|
3
3
|
class LogisticValidator {
|
|
4
|
-
static
|
|
4
|
+
static getPincodeCity() {
|
|
5
5
|
return Joi.object({
|
|
6
|
-
|
|
6
|
+
pincode: Joi.string().allow("").required(),
|
|
7
|
+
countryCode: Joi.string().allow(""),
|
|
7
8
|
}).required();
|
|
8
9
|
}
|
|
9
10
|
|
|
10
|
-
static
|
|
11
|
+
static getTatProduct() {
|
|
11
12
|
return Joi.object({
|
|
12
|
-
body: Validator.
|
|
13
|
+
body: Validator.TATViewRequest().required(),
|
|
13
14
|
}).required();
|
|
14
15
|
}
|
|
15
16
|
|
|
16
|
-
static
|
|
17
|
+
static getAllCountries() {
|
|
18
|
+
return Joi.object({});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
static getPincodeZones() {
|
|
17
22
|
return Joi.object({
|
|
18
|
-
|
|
23
|
+
body: Validator.GetZoneFromPincodeViewRequest().required(),
|
|
19
24
|
}).required();
|
|
20
25
|
}
|
|
21
26
|
}
|
|
@@ -37,7 +37,7 @@ function requestInterceptorFn() {
|
|
|
37
37
|
}
|
|
38
38
|
const { host, pathname, search } = new URL(url);
|
|
39
39
|
const { data, headers, method, params } = config;
|
|
40
|
-
headers["x-fp-sdk-version"] = "0.1.
|
|
40
|
+
headers["x-fp-sdk-version"] = "0.1.37";
|
|
41
41
|
let querySearchObj = querystring.parse(search);
|
|
42
42
|
querySearchObj = { ...querySearchObj, ...params };
|
|
43
43
|
let queryParam = "";
|