@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.
Files changed (36) hide show
  1. package/documentation/application/CART.md +291 -285
  2. package/documentation/application/CATALOG.md +411 -411
  3. package/documentation/application/LOGISTIC.md +423 -101
  4. package/documentation/application/ORDER.md +287 -287
  5. package/documentation/application/POSCART.md +319 -313
  6. package/documentation/application/README.md +1 -1
  7. package/documentation/platform/AUDITTRAIL.md +2 -2
  8. package/documentation/platform/CART.md +488 -488
  9. package/documentation/platform/CATALOG.md +1656 -1439
  10. package/documentation/platform/COMPANYPROFILE.md +250 -229
  11. package/documentation/platform/ORDER.md +1183 -1183
  12. package/package.json +2 -2
  13. package/sdk/application/ApplicationAPIClient.js +3 -0
  14. package/sdk/application/ApplicationClient.d.ts +1 -0
  15. package/sdk/application/ApplicationClient.js +11 -1
  16. package/sdk/application/ApplicationConfig.d.ts +1 -0
  17. package/sdk/application/ApplicationConfig.js +1 -0
  18. package/sdk/application/ApplicationModels.d.ts +83 -78
  19. package/sdk/application/ApplicationModels.js +1445 -1354
  20. package/sdk/application/client/LogisticApplicationClient.d.ts +32 -21
  21. package/sdk/application/client/LogisticApplicationClient.js +62 -27
  22. package/sdk/application/models/LogisticValidator.d.ts +2 -1
  23. package/sdk/application/models/LogisticValidator.js +11 -6
  24. package/sdk/common/AxiosHelper.js +1 -1
  25. package/sdk/platform/PlatformApplicationClient.d.ts +5328 -5185
  26. package/sdk/platform/PlatformApplicationClient.js +2877 -2795
  27. package/sdk/platform/PlatformApplicationModels.d.ts +5 -5
  28. package/sdk/platform/PlatformApplicationModels.js +3707 -3571
  29. package/sdk/platform/PlatformClient.d.ts +2577 -2509
  30. package/sdk/platform/PlatformClient.js +2770 -2688
  31. package/sdk/platform/PlatformModels.d.ts +146 -139
  32. package/sdk/platform/PlatformModels.js +3718 -3582
  33. package/sdk/platform/client/CatalogPlatformClient.d.ts +21 -12
  34. package/sdk/platform/client/CatalogPlatformClient.js +48 -17
  35. package/sdk/platform/models/CatalogValidator.d.ts +2 -1
  36. 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 {GetTatProductReqBody} arg.body
15
- * @returns {Promise<GetTatProductResponse>} - Success response
16
- * @summary: Get TAT of a product
17
- * @description: Use this API to know the delivery turnaround time (TAT) by entering the product details along with the PIN Code of the location.
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: GetTatProductReqBody;
21
- }): Promise<GetTatProductResponse>;
34
+ body: TATViewRequest;
35
+ }): Promise<TATViewResponse>;
22
36
  /**
23
37
  * @param {Object} arg - Arg object.
24
- * @param {GetPincodeZonesReqBody} arg.body
25
- * @returns {Promise<GetPincodeZonesResponse>} - Success response
26
- * @summary: Get Pincode Zones
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
- getPincodeZones({ body }?: {
30
- body: GetPincodeZonesReqBody;
31
- }): Promise<GetPincodeZonesResponse>;
42
+ getAllCountries({}?: any): Promise<CountryListResponse>;
32
43
  /**
33
44
  * @param {Object} arg - Arg object.
34
- * @param {string} arg.pincode - The PIN Code of the area, e.g. 400059
35
- * @returns {Promise<GetPincodeCityResponse>} - Success response
36
- * @summary: Get city from PIN Code
37
- * @description: Use this API to retrieve a city by its PIN Code.
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
- getPincodeCity({ pincode }?: {
40
- pincode: string;
41
- }): Promise<GetPincodeCityResponse>;
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 {GetTatProductReqBody} arg.body
34
- * @returns {Promise<GetTatProductResponse>} - Success response
35
- * @summary: Get TAT of a product
36
- * @description: Use this API to know the delivery turnaround time (TAT) by entering the product details along with the PIN Code of the location.
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
- * @param {GetPincodeZonesReqBody} arg.body
66
- * @returns {Promise<GetPincodeZonesResponse>} - Success response
67
- * @summary: Get Pincode Zones
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
- getPincodeZones({ body } = {}) {
71
- const { error } = LogisticValidator.getPincodeZones().validate(
72
- { body },
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
- "post",
119
+ "get",
85
120
  constructUrl({
86
- url: this._urls["getPincodeZones"],
121
+ url: this._urls["getAllCountries"],
87
122
  params: {},
88
123
  }),
89
124
  query_params,
90
- body,
125
+ undefined,
91
126
  xHeaders
92
127
  );
93
128
  }
94
129
 
95
130
  /**
96
131
  * @param {Object} arg - Arg object.
97
- * @param {string} arg.pincode - The PIN Code of the area, e.g. 400059
98
- * @returns {Promise<GetPincodeCityResponse>} - Success response
99
- * @summary: Get city from PIN Code
100
- * @description: Use this API to retrieve a city by its PIN Code.
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
- getPincodeCity({ pincode } = {}) {
103
- const { error } = LogisticValidator.getPincodeCity().validate(
104
- { pincode },
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
- "get",
151
+ "post",
117
152
  constructUrl({
118
- url: this._urls["getPincodeCity"],
119
- params: { pincode },
153
+ url: this._urls["getPincodeZones"],
154
+ params: {},
120
155
  }),
121
156
  query_params,
122
- undefined,
157
+ body,
123
158
  xHeaders
124
159
  );
125
160
  }
@@ -1,6 +1,7 @@
1
1
  export = LogisticValidator;
2
2
  declare class LogisticValidator {
3
+ static getPincodeCity(): any;
3
4
  static getTatProduct(): any;
5
+ static getAllCountries(): any;
4
6
  static getPincodeZones(): any;
5
- static getPincodeCity(): any;
6
7
  }
@@ -1,21 +1,26 @@
1
1
  const Joi = require("joi");
2
2
  const { Validator } = require("../ApplicationModels");
3
3
  class LogisticValidator {
4
- static getTatProduct() {
4
+ static getPincodeCity() {
5
5
  return Joi.object({
6
- body: Validator.GetTatProductReqBody().required(),
6
+ pincode: Joi.string().allow("").required(),
7
+ countryCode: Joi.string().allow(""),
7
8
  }).required();
8
9
  }
9
10
 
10
- static getPincodeZones() {
11
+ static getTatProduct() {
11
12
  return Joi.object({
12
- body: Validator.GetPincodeZonesReqBody().required(),
13
+ body: Validator.TATViewRequest().required(),
13
14
  }).required();
14
15
  }
15
16
 
16
- static getPincodeCity() {
17
+ static getAllCountries() {
18
+ return Joi.object({});
19
+ }
20
+
21
+ static getPincodeZones() {
17
22
  return Joi.object({
18
- pincode: Joi.string().allow("").required(),
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.36";
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 = "";