@gofynd/fdk-client-javascript 1.4.16-beta.3 → 1.4.16-beta.5

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 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.16-beta.3' --header 'x-fp-date: 20230222T115108Z' --header 'x-fp-signature: v1.1:1e3ab3b02b5bc626e3c32a37ee844266ade02bbcbaafc28fc7a0e46a76a7a1a8'
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.16-beta.5' --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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gofynd/fdk-client-javascript",
3
- "version": "1.4.16-beta.3",
3
+ "version": "1.4.16-beta.5",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -215,7 +215,7 @@ declare class Cart {
215
215
  * @summary: List all available promotions of the sales channel
216
216
  * @description: List all promotional offers available for the sales channel, including details such as offer text, unique promotion ID, and validity period. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getPromotions/).
217
217
  */
218
- getPromotions({ pageSize, pageNo, promotionType, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<Promotions>;
218
+ getPromotions({ pageSize, pageNo, promotionType, isBankOffer, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<Promotions>;
219
219
  /**
220
220
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
221
221
  * @param {import("../ApplicationAPIClient").Options} - Options
@@ -897,7 +897,7 @@ class Cart {
897
897
  * @description: List all promotional offers available for the sales channel, including details such as offer text, unique promotion ID, and validity period. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/cart/getPromotions/).
898
898
  */
899
899
  async getPromotions(
900
- { pageSize, pageNo, promotionType, requestHeaders } = {
900
+ { pageSize, pageNo, promotionType, isBankOffer, requestHeaders } = {
901
901
  requestHeaders: {},
902
902
  },
903
903
  { responseHeaders } = { responseHeaders: false }
@@ -906,6 +906,7 @@ class Cart {
906
906
  query_params["page_size"] = pageSize;
907
907
  query_params["page_no"] = pageNo;
908
908
  query_params["promotion_type"] = promotionType;
909
+ query_params["is_bank_offer"] = isBankOffer;
909
910
 
910
911
  const xHeaders = {};
911
912
 
@@ -31,7 +31,7 @@ class Content {
31
31
  "/service/application/content/v1.0/faq/category/{slug}/faqs",
32
32
  getLandingPage: "/service/application/content/v1.0/landing-page",
33
33
  getLegalInformation: "/service/application/content/v1.0/legal",
34
- getNavigations: "/service/application/content/v1.0/navigations",
34
+ getNavigations: "/service/application/content/v2.0/navigations",
35
35
  getPage: "/service/application/content/v2.0/pages/{slug}",
36
36
  getPages: "/service/application/content/v2.0/pages",
37
37
  getSEOConfiguration: "/service/application/content/v1.0/seo",
@@ -5,9 +5,12 @@ function convertUrlToAction(url) {
5
5
  if (url) {
6
6
  const path = utils.trimChar(url);
7
7
  const query = utils.getQuery(path);
8
- const pathname = utils.validURL(path)
9
- ? new URL(path).pathname
10
- : path.split("?")[0];
8
+ let pathname;
9
+ try {
10
+ pathname = new URL(path).pathname;
11
+ } catch (e) {
12
+ pathname = path.split("?")[0];
13
+ }
11
14
  const allNavigations = Object.assign({}, Constant.NAVIGATORS);
12
15
  const typeLink = {};
13
16
  for (nav in allNavigations) {
@@ -7,7 +7,6 @@ export function findBestMatchingLink(allLinks?: any[], pathname?: string): {
7
7
  value: string;
8
8
  params: {};
9
9
  };
10
- export function validURL(str: any): boolean;
11
10
  export function convertStringToBase64(string: any): string;
12
11
  export function isBrowser(): boolean;
13
12
  export function isNode(): boolean;
@@ -94,19 +94,6 @@ const trimChar = (string = "", charToRemove = "/") => {
94
94
  return string;
95
95
  };
96
96
 
97
- function validURL(str) {
98
- var pattern = new RegExp(
99
- "^(https?:\\/\\/)?" + // protocol
100
- "((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|" + // domain name
101
- "((\\d{1,3}\\.){3}\\d{1,3}))" + // OR ip (v4) address
102
- "(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*" + // port and path
103
- "(\\?[;&a-z\\d%_.~+=-]*)?" + // query string
104
- "(\\#[-a-z\\d_]*)?$",
105
- "i"
106
- ); // fragment locator
107
- return !!pattern.test(str);
108
- }
109
-
110
97
  const findBestMatchingLink = (allLinks = [], pathname = "/") => {
111
98
  let bestMatch = { value: "", params: {} };
112
99
  pathname = trimChar(pathname); // -> product/test-product-tag/reviews
@@ -221,7 +208,6 @@ module.exports = {
221
208
  trimChar,
222
209
  generateUrlWithParams,
223
210
  findBestMatchingLink,
224
- validURL,
225
211
  convertStringToBase64,
226
212
  isBrowser,
227
213
  isNode,
@@ -91,6 +91,8 @@ export = ConfigurationPlatformModel;
91
91
  * @property {number} [company_id]
92
92
  * @property {boolean} [enable_zone_overlapping] - Power product listing with
93
93
  * overlapping zones
94
+ * @property {boolean} [sort_popular_first] - Give preference to popularity over
95
+ * score in product listing sort
94
96
  */
95
97
  /**
96
98
  * @typedef InventoryBrand
@@ -1581,6 +1583,11 @@ type AppInventoryConfig = {
1581
1583
  * overlapping zones
1582
1584
  */
1583
1585
  enable_zone_overlapping?: boolean;
1586
+ /**
1587
+ * - Give preference to popularity over
1588
+ * score in product listing sort
1589
+ */
1590
+ sort_popular_first?: boolean;
1584
1591
  };
1585
1592
  /** @returns {InventoryBrand} */
1586
1593
  declare function InventoryBrand(): InventoryBrand;
@@ -99,6 +99,8 @@ const Joi = require("joi");
99
99
  * @property {number} [company_id]
100
100
  * @property {boolean} [enable_zone_overlapping] - Power product listing with
101
101
  * overlapping zones
102
+ * @property {boolean} [sort_popular_first] - Give preference to popularity over
103
+ * score in product listing sort
102
104
  */
103
105
 
104
106
  /**
@@ -1667,6 +1669,7 @@ class ConfigurationPlatformModel {
1667
1669
  company_store: Joi.array().items(Joi.any()),
1668
1670
  company_id: Joi.number(),
1669
1671
  enable_zone_overlapping: Joi.boolean(),
1672
+ sort_popular_first: Joi.boolean(),
1670
1673
  });
1671
1674
  }
1672
1675
 
@@ -1251,6 +1251,8 @@ export = OrderPlatformModel;
1251
1251
  * or system that is making the order request.
1252
1252
  * @property {string} [external_shipment_id] - External shipment identifier or
1253
1253
  * marketplace's unique shipment identifier.
1254
+ * @property {Object} [custom_json] - An object containing additional metadata,
1255
+ * ensuring only the required fields are included as needed.
1254
1256
  */
1255
1257
  /**
1256
1258
  * @typedef CreateOrderErrorReponse
@@ -7380,6 +7382,11 @@ type CreateOrderAPI = {
7380
7382
  * marketplace's unique shipment identifier.
7381
7383
  */
7382
7384
  external_shipment_id?: string;
7385
+ /**
7386
+ * - An object containing additional metadata,
7387
+ * ensuring only the required fields are included as needed.
7388
+ */
7389
+ custom_json?: any;
7383
7390
  };
7384
7391
  /** @returns {CreateOrderErrorReponse} */
7385
7392
  declare function CreateOrderErrorReponse(): CreateOrderErrorReponse;
@@ -1358,6 +1358,8 @@ const Joi = require("joi");
1358
1358
  * or system that is making the order request.
1359
1359
  * @property {string} [external_shipment_id] - External shipment identifier or
1360
1360
  * marketplace's unique shipment identifier.
1361
+ * @property {Object} [custom_json] - An object containing additional metadata,
1362
+ * ensuring only the required fields are included as needed.
1361
1363
  */
1362
1364
 
1363
1365
  /**
@@ -6505,6 +6507,7 @@ class OrderPlatformModel {
6505
6507
  fynd_order_id: Joi.string().allow(""),
6506
6508
  application_id: Joi.string().allow(""),
6507
6509
  external_shipment_id: Joi.string().allow(""),
6510
+ custom_json: Joi.object().pattern(/\S/, Joi.any()).allow(null, ""),
6508
6511
  });
6509
6512
  }
6510
6513
 
@@ -240,7 +240,7 @@ declare class Serviceability {
240
240
  * @summary: Get zones
241
241
  * @description: Retrieves a list of delivery zones. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getZones/).
242
242
  */
243
- getZones({ pageNo, pageSize, isActive, applicationId, q, countryIsoCode, state, city, pincode, sector, requestHeaders, }?: ServiceabilityPlatformValidator.GetZonesParam, { responseHeaders }?: object): Promise<ServiceabilityPlatformModel.ListViewResult>;
243
+ getZones({ pageNo, pageSize, isActive, applicationIds, q, countryIsoCode, state, city, pincode, sector, requestHeaders, }?: ServiceabilityPlatformValidator.GetZonesParam, { responseHeaders }?: object): Promise<ServiceabilityPlatformModel.ListViewResult>;
244
244
  /**
245
245
  * @param {ServiceabilityPlatformValidator.UpdateCompanyConfigurationParam} arg
246
246
  * - Arg object
@@ -1723,7 +1723,7 @@ class Serviceability {
1723
1723
  pageNo,
1724
1724
  pageSize,
1725
1725
  isActive,
1726
- applicationId,
1726
+ applicationIds,
1727
1727
  q,
1728
1728
  countryIsoCode,
1729
1729
  state,
@@ -1739,7 +1739,7 @@ class Serviceability {
1739
1739
  pageNo,
1740
1740
  pageSize,
1741
1741
  isActive,
1742
- applicationId,
1742
+ applicationIds,
1743
1743
  q,
1744
1744
  countryIsoCode,
1745
1745
  state,
@@ -1761,7 +1761,7 @@ class Serviceability {
1761
1761
  pageNo,
1762
1762
  pageSize,
1763
1763
  isActive,
1764
- applicationId,
1764
+ applicationIds,
1765
1765
  q,
1766
1766
  countryIsoCode,
1767
1767
  state,
@@ -1782,7 +1782,7 @@ class Serviceability {
1782
1782
  query_params["page_no"] = pageNo;
1783
1783
  query_params["page_size"] = pageSize;
1784
1784
  query_params["is_active"] = isActive;
1785
- query_params["application_id"] = applicationId;
1785
+ query_params["application_ids"] = applicationIds;
1786
1786
  query_params["q"] = q;
1787
1787
  query_params["country_iso_code"] = countryIsoCode;
1788
1788
  query_params["state"] = state;
@@ -111,7 +111,7 @@ export = ServiceabilityPlatformValidator;
111
111
  * @property {number} [pageNo] - Index of the item to start returning with
112
112
  * @property {number} [pageSize] - Determines the items to be displayed in a page
113
113
  * @property {boolean} [isActive] - Status of Zone (either active or inactive)
114
- * @property {string} [applicationId] - Zones filtered by an application
114
+ * @property {string} [applicationIds] - Zones filtered by applications
115
115
  * @property {string} [q] - Search with name as a free text
116
116
  * @property {string} [countryIsoCode] - ISO2 code of the country
117
117
  * @property {string} [state] - State name
@@ -448,9 +448,9 @@ type GetZonesParam = {
448
448
  */
449
449
  isActive?: boolean;
450
450
  /**
451
- * - Zones filtered by an application
451
+ * - Zones filtered by applications
452
452
  */
453
- applicationId?: string;
453
+ applicationIds?: string;
454
454
  /**
455
455
  * - Search with name as a free text
456
456
  */
@@ -133,7 +133,7 @@ const ServiceabilityPlatformModel = require("./ServiceabilityPlatformModel");
133
133
  * @property {number} [pageNo] - Index of the item to start returning with
134
134
  * @property {number} [pageSize] - Determines the items to be displayed in a page
135
135
  * @property {boolean} [isActive] - Status of Zone (either active or inactive)
136
- * @property {string} [applicationId] - Zones filtered by an application
136
+ * @property {string} [applicationIds] - Zones filtered by applications
137
137
  * @property {string} [q] - Search with name as a free text
138
138
  * @property {string} [countryIsoCode] - ISO2 code of the country
139
139
  * @property {string} [state] - State name
@@ -352,7 +352,7 @@ class ServiceabilityPlatformValidator {
352
352
  pageNo: Joi.number(),
353
353
  pageSize: Joi.number(),
354
354
  isActive: Joi.boolean(),
355
- applicationId: Joi.string().allow(""),
355
+ applicationIds: Joi.string().allow(""),
356
356
  q: Joi.string().allow(""),
357
357
  countryIsoCode: Joi.string().allow(""),
358
358
  state: Joi.string().allow(""),