@gofynd/fdk-client-javascript 1.4.15-beta.1 → 1.4.15-beta.10

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 (154) hide show
  1. package/README.md +2 -2
  2. package/application.d.ts +1 -2
  3. package/application.js +2 -3
  4. package/index.d.ts +1 -2
  5. package/index.js +7 -1
  6. package/package.json +2 -3
  7. package/sdk/application/ApplicationClient.js +0 -18
  8. package/sdk/application/Cart/CartApplicationClient.d.ts +55 -90
  9. package/sdk/application/Cart/CartApplicationClient.js +60 -1185
  10. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +80 -142
  11. package/sdk/application/Catalog/CatalogApplicationClient.js +148 -1293
  12. package/sdk/application/Common/CommonApplicationClient.d.ts +4 -8
  13. package/sdk/application/Common/CommonApplicationClient.js +5 -89
  14. package/sdk/application/Communication/CommunicationApplicationClient.d.ts +6 -19
  15. package/sdk/application/Communication/CommunicationApplicationClient.js +6 -145
  16. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +32 -73
  17. package/sdk/application/Configuration/ConfigurationApplicationClient.js +31 -718
  18. package/sdk/application/Content/ContentApplicationClient.d.ts +46 -78
  19. package/sdk/application/Content/ContentApplicationClient.js +77 -914
  20. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +9 -12
  21. package/sdk/application/FileStorage/FileStorageApplicationClient.js +22 -125
  22. package/sdk/application/Lead/LeadApplicationClient.d.ts +10 -18
  23. package/sdk/application/Lead/LeadApplicationClient.js +32 -202
  24. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +22 -39
  25. package/sdk/application/Logistic/LogisticApplicationClient.js +50 -478
  26. package/sdk/application/Order/OrderApplicationClient.d.ts +22 -42
  27. package/sdk/application/Order/OrderApplicationClient.js +86 -472
  28. package/sdk/application/Payment/PaymentApplicationClient.d.ts +92 -212
  29. package/sdk/application/Payment/PaymentApplicationClient.js +57 -2102
  30. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +14 -28
  31. package/sdk/application/Rewards/RewardsApplicationClient.js +16 -305
  32. package/sdk/application/Share/ShareApplicationClient.d.ts +14 -24
  33. package/sdk/application/Share/ShareApplicationClient.js +34 -294
  34. package/sdk/application/Theme/ThemeApplicationClient.d.ts +8 -14
  35. package/sdk/application/Theme/ThemeApplicationClient.js +28 -162
  36. package/sdk/application/User/UserApplicationClient.d.ts +85 -136
  37. package/sdk/application/User/UserApplicationClient.js +45 -1815
  38. package/sdk/application/Webhook/WebhookApplicationClient.d.ts +2 -5
  39. package/sdk/application/Webhook/WebhookApplicationClient.js +4 -47
  40. package/sdk/application/index.d.ts +0 -18
  41. package/sdk/application/index.js +0 -33
  42. package/sdk/common/Utility.d.ts +1 -1
  43. package/sdk/common/Utility.js +10 -7
  44. package/sdk/common/Validator.d.ts +1 -0
  45. package/sdk/common/Validator.js +20 -0
  46. package/sdk/common/utils.d.ts +0 -1
  47. package/sdk/common/utils.js +0 -14
  48. package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +2 -0
  49. package/sdk/partner/FileStorage/FileStoragePartnerModel.js +2 -0
  50. package/sdk/partner/OAuthClient.js +1 -0
  51. package/sdk/partner/Theme/ThemePartnerModel.d.ts +3 -40
  52. package/sdk/partner/Theme/ThemePartnerModel.js +2 -24
  53. package/sdk/platform/Cart/CartPlatformModel.d.ts +28 -0
  54. package/sdk/platform/Cart/CartPlatformModel.js +12 -0
  55. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +0 -7
  56. package/sdk/platform/Catalog/CatalogPlatformModel.js +1 -4
  57. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +14 -0
  58. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +6 -0
  59. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +3 -1
  60. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +3 -0
  61. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +3 -1
  62. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +3 -0
  63. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +16 -1
  64. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +20 -0
  65. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +0 -10
  66. package/sdk/platform/Order/OrderPlatformApplicationClient.js +0 -92
  67. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -28
  68. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +0 -18
  69. package/sdk/platform/Order/OrderPlatformClient.d.ts +10 -0
  70. package/sdk/platform/Order/OrderPlatformClient.js +99 -0
  71. package/sdk/platform/Order/OrderPlatformModel.d.ts +7 -0
  72. package/sdk/platform/Order/OrderPlatformModel.js +3 -0
  73. package/sdk/platform/Order/OrderPlatformValidator.d.ts +33 -1
  74. package/sdk/platform/Order/OrderPlatformValidator.js +20 -0
  75. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +1 -1
  76. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +4 -4
  77. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +56 -19
  78. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +42 -18
  79. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +3 -3
  80. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +2 -2
  81. package/sdk/platform/Theme/ThemePlatformModel.d.ts +3 -40
  82. package/sdk/platform/Theme/ThemePlatformModel.js +2 -24
  83. package/sdk/public/Configuration/ConfigurationPublicClient.js +5 -2
  84. package/sdk/public/Content/ContentPublicClient.d.ts +1 -1
  85. package/sdk/public/Content/ContentPublicClient.js +14 -2
  86. package/sdk/public/Partner/PartnerPublicClient.d.ts +1 -1
  87. package/sdk/public/Partner/PartnerPublicClient.js +14 -2
  88. package/sdk/public/Webhook/WebhookPublicClient.js +5 -2
  89. package/sdk/application/Cart/CartApplicationModel.d.ts +0 -3994
  90. package/sdk/application/Cart/CartApplicationModel.js +0 -2497
  91. package/sdk/application/Cart/CartApplicationValidator.d.ts +0 -769
  92. package/sdk/application/Cart/CartApplicationValidator.js +0 -530
  93. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +0 -3857
  94. package/sdk/application/Catalog/CatalogApplicationModel.js +0 -2629
  95. package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +0 -791
  96. package/sdk/application/Catalog/CatalogApplicationValidator.js +0 -551
  97. package/sdk/application/Common/CommonApplicationModel.d.ts +0 -449
  98. package/sdk/application/Common/CommonApplicationModel.js +0 -308
  99. package/sdk/application/Common/CommonApplicationValidator.d.ts +0 -46
  100. package/sdk/application/Common/CommonApplicationValidator.js +0 -38
  101. package/sdk/application/Communication/CommunicationApplicationModel.d.ts +0 -293
  102. package/sdk/application/Communication/CommunicationApplicationModel.js +0 -201
  103. package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +0 -29
  104. package/sdk/application/Communication/CommunicationApplicationValidator.js +0 -38
  105. package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +0 -2556
  106. package/sdk/application/Configuration/ConfigurationApplicationModel.js +0 -1887
  107. package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +0 -179
  108. package/sdk/application/Configuration/ConfigurationApplicationValidator.js +0 -176
  109. package/sdk/application/Content/ContentApplicationModel.d.ts +0 -2133
  110. package/sdk/application/Content/ContentApplicationModel.js +0 -1589
  111. package/sdk/application/Content/ContentApplicationValidator.d.ts +0 -284
  112. package/sdk/application/Content/ContentApplicationValidator.js +0 -264
  113. package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +0 -272
  114. package/sdk/application/FileStorage/FileStorageApplicationModel.js +0 -190
  115. package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +0 -56
  116. package/sdk/application/FileStorage/FileStorageApplicationValidator.js +0 -53
  117. package/sdk/application/Lead/LeadApplicationModel.d.ts +0 -590
  118. package/sdk/application/Lead/LeadApplicationModel.js +0 -480
  119. package/sdk/application/Lead/LeadApplicationValidator.d.ts +0 -68
  120. package/sdk/application/Lead/LeadApplicationValidator.js +0 -71
  121. package/sdk/application/Logistic/LogisticApplicationModel.d.ts +0 -1675
  122. package/sdk/application/Logistic/LogisticApplicationModel.js +0 -1121
  123. package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +0 -254
  124. package/sdk/application/Logistic/LogisticApplicationValidator.js +0 -190
  125. package/sdk/application/Order/OrderApplicationModel.d.ts +0 -2296
  126. package/sdk/application/Order/OrderApplicationModel.js +0 -1471
  127. package/sdk/application/Order/OrderApplicationValidator.d.ts +0 -265
  128. package/sdk/application/Order/OrderApplicationValidator.js +0 -197
  129. package/sdk/application/Payment/PaymentApplicationModel.d.ts +0 -4058
  130. package/sdk/application/Payment/PaymentApplicationModel.js +0 -2630
  131. package/sdk/application/Payment/PaymentApplicationValidator.d.ts +0 -576
  132. package/sdk/application/Payment/PaymentApplicationValidator.js +0 -594
  133. package/sdk/application/Rewards/RewardsApplicationModel.d.ts +0 -365
  134. package/sdk/application/Rewards/RewardsApplicationModel.js +0 -396
  135. package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +0 -73
  136. package/sdk/application/Rewards/RewardsApplicationValidator.js +0 -84
  137. package/sdk/application/Share/ShareApplicationModel.d.ts +0 -339
  138. package/sdk/application/Share/ShareApplicationModel.js +0 -234
  139. package/sdk/application/Share/ShareApplicationValidator.d.ts +0 -90
  140. package/sdk/application/Share/ShareApplicationValidator.js +0 -91
  141. package/sdk/application/Theme/ThemeApplicationModel.d.ts +0 -1713
  142. package/sdk/application/Theme/ThemeApplicationModel.js +0 -1426
  143. package/sdk/application/Theme/ThemeApplicationValidator.d.ts +0 -66
  144. package/sdk/application/Theme/ThemeApplicationValidator.js +0 -58
  145. package/sdk/application/User/UserApplicationModel.d.ts +0 -1943
  146. package/sdk/application/User/UserApplicationModel.js +0 -1382
  147. package/sdk/application/User/UserApplicationValidator.d.ts +0 -560
  148. package/sdk/application/User/UserApplicationValidator.js +0 -573
  149. package/sdk/application/Webhook/WebhookApplicationModel.d.ts +0 -52
  150. package/sdk/application/Webhook/WebhookApplicationModel.js +0 -46
  151. package/sdk/application/Webhook/WebhookApplicationValidator.d.ts +0 -16
  152. package/sdk/application/Webhook/WebhookApplicationValidator.js +0 -19
  153. package/sdk/common/Clickstream.d.ts +0 -1
  154. package/sdk/common/Clickstream.js +0 -464
@@ -8,15 +8,12 @@ declare class Webhook {
8
8
  _urls: {};
9
9
  updateUrls(urls: any): void;
10
10
  /**
11
- * @param {WebhookApplicationValidator.SaveClickEventParam} arg - Arg object.
12
11
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
13
12
  * @param {import("../ApplicationAPIClient").Options} - Options
14
- * @returns {Promise<WebhookApplicationModel.ClickEventResponse>} - Success response
13
+ * @returns {Promise<ClickEventResponse>} - Success response
15
14
  * @name saveClickEvent
16
15
  * @summary: Endpoint to capture click events from sales channels and persist them in database.
17
16
  * @description: Send click events from sales channels. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/webhook/saveClickEvent/).
18
17
  */
19
- saveClickEvent({ body, requestHeaders }?: WebhookApplicationValidator.SaveClickEventParam, { responseHeaders }?: object): Promise<WebhookApplicationModel.ClickEventResponse>;
18
+ saveClickEvent({ body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<ClickEventResponse>;
20
19
  }
21
- import WebhookApplicationValidator = require("./WebhookApplicationValidator");
22
- import WebhookApplicationModel = require("./WebhookApplicationModel");
@@ -1,14 +1,12 @@
1
- const ApplicationAPIClient = require("../ApplicationAPIClient");
2
1
  const {
3
2
  FDKClientValidationError,
4
3
  FDKResponseValidationError,
5
4
  } = require("../../common/FDKError");
5
+
6
+ const ApplicationAPIClient = require("../ApplicationAPIClient");
6
7
  const constructUrl = require("../constructUrl");
7
8
  const Paginator = require("../../common/Paginator");
8
- const WebhookApplicationValidator = require("./WebhookApplicationValidator");
9
- const WebhookApplicationModel = require("./WebhookApplicationModel");
10
- const { Logger } = require("./../../common/Logger");
11
- const Joi = require("joi");
9
+ const { validateRequiredParams } = require("../../common/Validator");
12
10
 
13
11
  class Webhook {
14
12
  constructor(_conf) {
@@ -34,10 +32,9 @@ class Webhook {
34
32
  }
35
33
 
36
34
  /**
37
- * @param {WebhookApplicationValidator.SaveClickEventParam} arg - Arg object.
38
35
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
39
36
  * @param {import("../ApplicationAPIClient").Options} - Options
40
- * @returns {Promise<WebhookApplicationModel.ClickEventResponse>} - Success response
37
+ * @returns {Promise<ClickEventResponse>} - Success response
41
38
  * @name saveClickEvent
42
39
  * @summary: Endpoint to capture click events from sales channels and persist them in database.
43
40
  * @description: Send click events from sales channels. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/webhook/saveClickEvent/).
@@ -46,28 +43,6 @@ class Webhook {
46
43
  { body, requestHeaders } = { requestHeaders: {} },
47
44
  { responseHeaders } = { responseHeaders: false }
48
45
  ) {
49
- const { error } = WebhookApplicationValidator.saveClickEvent().validate(
50
- { body },
51
- { abortEarly: false, allowUnknown: true }
52
- );
53
- if (error) {
54
- return Promise.reject(new FDKClientValidationError(error));
55
- }
56
-
57
- // Showing warrnings if extra unknown parameters are found
58
- const {
59
- error: warrning,
60
- } = WebhookApplicationValidator.saveClickEvent().validate(
61
- { body },
62
- { abortEarly: false, allowUnknown: false }
63
- );
64
- if (warrning) {
65
- Logger({
66
- level: "WARN",
67
- message: `Parameter Validation warrnings for application > Webhook > saveClickEvent \n ${warrning}`,
68
- });
69
- }
70
-
71
46
  const query_params = {};
72
47
 
73
48
  const xHeaders = {};
@@ -90,24 +65,6 @@ class Webhook {
90
65
  responseData = response[0];
91
66
  }
92
67
 
93
- const {
94
- error: res_error,
95
- } = WebhookApplicationModel.ClickEventResponse().validate(responseData, {
96
- abortEarly: false,
97
- allowUnknown: true,
98
- });
99
-
100
- if (res_error) {
101
- if (this._conf.options.strictResponseCheck === true) {
102
- return Promise.reject(new FDKResponseValidationError(res_error));
103
- } else {
104
- Logger({
105
- level: "WARN",
106
- message: `Response Validation Warnings for application > Webhook > saveClickEvent \n ${res_error}`,
107
- });
108
- }
109
- }
110
-
111
68
  return response;
112
69
  }
113
70
  }
@@ -1,20 +1,2 @@
1
1
  export const ApplicationConfig: typeof import("./ApplicationConfig");
2
2
  export const ApplicationClient: typeof import("./ApplicationClient");
3
- export namespace ApplicationModel {
4
- const CartApplicationModel: typeof import("./Cart/CartApplicationModel");
5
- const CatalogApplicationModel: typeof import("./Catalog/CatalogApplicationModel");
6
- const CommonApplicationModel: typeof import("./Common/CommonApplicationModel");
7
- const CommunicationApplicationModel: typeof import("./Communication/CommunicationApplicationModel");
8
- const ConfigurationApplicationModel: typeof import("./Configuration/ConfigurationApplicationModel");
9
- const ContentApplicationModel: typeof import("./Content/ContentApplicationModel");
10
- const FileStorageApplicationModel: typeof import("./FileStorage/FileStorageApplicationModel");
11
- const LeadApplicationModel: typeof import("./Lead/LeadApplicationModel");
12
- const LogisticApplicationModel: typeof import("./Logistic/LogisticApplicationModel");
13
- const OrderApplicationModel: typeof import("./Order/OrderApplicationModel");
14
- const PaymentApplicationModel: typeof import("./Payment/PaymentApplicationModel");
15
- const RewardsApplicationModel: typeof import("./Rewards/RewardsApplicationModel");
16
- const ShareApplicationModel: typeof import("./Share/ShareApplicationModel");
17
- const ThemeApplicationModel: typeof import("./Theme/ThemeApplicationModel");
18
- const UserApplicationModel: typeof import("./User/UserApplicationModel");
19
- const WebhookApplicationModel: typeof import("./Webhook/WebhookApplicationModel");
20
- }
@@ -1,37 +1,4 @@
1
1
  module.exports = {
2
2
  ApplicationConfig: require("./ApplicationConfig"),
3
3
  ApplicationClient: require("./ApplicationClient"),
4
- ApplicationModel: {
5
- CartApplicationModel: require("./Cart/CartApplicationModel"),
6
-
7
- CatalogApplicationModel: require("./Catalog/CatalogApplicationModel"),
8
-
9
- CommonApplicationModel: require("./Common/CommonApplicationModel"),
10
-
11
- CommunicationApplicationModel: require("./Communication/CommunicationApplicationModel"),
12
-
13
- ConfigurationApplicationModel: require("./Configuration/ConfigurationApplicationModel"),
14
-
15
- ContentApplicationModel: require("./Content/ContentApplicationModel"),
16
-
17
- FileStorageApplicationModel: require("./FileStorage/FileStorageApplicationModel"),
18
-
19
- LeadApplicationModel: require("./Lead/LeadApplicationModel"),
20
-
21
- LogisticApplicationModel: require("./Logistic/LogisticApplicationModel"),
22
-
23
- OrderApplicationModel: require("./Order/OrderApplicationModel"),
24
-
25
- PaymentApplicationModel: require("./Payment/PaymentApplicationModel"),
26
-
27
- RewardsApplicationModel: require("./Rewards/RewardsApplicationModel"),
28
-
29
- ShareApplicationModel: require("./Share/ShareApplicationModel"),
30
-
31
- ThemeApplicationModel: require("./Theme/ThemeApplicationModel"),
32
-
33
- UserApplicationModel: require("./User/UserApplicationModel"),
34
-
35
- WebhookApplicationModel: require("./Webhook/WebhookApplicationModel"),
36
- },
37
4
  };
@@ -1,4 +1,4 @@
1
- export function convertActionToUrl(action: any): any;
1
+ export function convertActionToUrl(action: any, locale: any): any;
2
2
  export function convertUrlToAction(url: any): {
3
3
  type: string;
4
4
  page: {
@@ -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) {
@@ -65,7 +68,7 @@ function convertUrlToAction(url) {
65
68
  }
66
69
  }
67
70
 
68
- function convertActionToUrl(action) {
71
+ function convertActionToUrl(action, locale) {
69
72
  if (action && action.page && action.page.type) {
70
73
  switch (action.type) {
71
74
  case utils.NAV_TYPE.PAGE: {
@@ -83,16 +86,16 @@ function convertActionToUrl(action) {
83
86
  item.link +=
84
87
  "/?" + utils.transformRequestOptions(action.page.query);
85
88
  }
86
- return item.link;
89
+ return locale ? `/${locale}${item.link}` : item.link;
87
90
  }
88
- return "";
91
+ return locale ? `/${locale}` : "";
89
92
  }
90
93
  case utils.NAV_TYPE.POPUP: {
91
94
  break;
92
95
  }
93
96
  }
94
97
  } else {
95
- return "";
98
+ return locale ? `/${locale}` : "";
96
99
  }
97
100
  }
98
101
 
@@ -0,0 +1 @@
1
+ export function validateRequiredParams(params: any, requiredParams: any): any[];
@@ -0,0 +1,20 @@
1
+ function validateRequiredParams(params, requiredParams) {
2
+ const errors = [];
3
+ requiredParams.forEach((key) => {
4
+ const value = params[key];
5
+
6
+ // Reject missing or empty values (except for boolean false)
7
+ if (
8
+ value === undefined ||
9
+ value === null ||
10
+ (typeof value !== "boolean" && value === "")
11
+ ) {
12
+ errors.push(`Missing or empty required parameter: ${key}`);
13
+ }
14
+ });
15
+ return errors;
16
+ }
17
+
18
+ module.exports = {
19
+ validateRequiredParams,
20
+ };
@@ -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,
@@ -30,6 +30,7 @@ export = FileStoragePartnerModel;
30
30
  * @property {number} size
31
31
  * @property {string[]} [tags]
32
32
  * @property {Object} [params]
33
+ * @property {string} [enc_key]
33
34
  */
34
35
  /**
35
36
  * @typedef CreatedBy
@@ -96,6 +97,7 @@ type StartRequest = {
96
97
  size: number;
97
98
  tags?: string[];
98
99
  params?: any;
100
+ enc_key?: string;
99
101
  };
100
102
  /** @returns {CreatedBy} */
101
103
  declare function CreatedBy(): CreatedBy;
@@ -34,6 +34,7 @@ const Joi = require("joi");
34
34
  * @property {number} size
35
35
  * @property {string[]} [tags]
36
36
  * @property {Object} [params]
37
+ * @property {string} [enc_key]
37
38
  */
38
39
 
39
40
  /**
@@ -106,6 +107,7 @@ class FileStoragePartnerModel {
106
107
  size: Joi.number().required(),
107
108
  tags: Joi.array().items(Joi.string().allow("")),
108
109
  params: Joi.object().pattern(/\S/, Joi.any()),
110
+ enc_key: Joi.string().allow(""),
109
111
  });
110
112
  }
111
113
 
@@ -6,6 +6,7 @@ const querystring = require("query-string");
6
6
  const { sign } = require("@gofynd/fp-signature");
7
7
  const { convertStringToBase64 } = require("../common/utils");
8
8
 
9
+ const refreshTokenRequestCache = {};
9
10
  class OAuthClient extends BaseOAuthClient {
10
11
  constructor(config) {
11
12
  super(config);
@@ -482,16 +482,7 @@ export = ThemePartnerModel;
482
482
  */
483
483
  /**
484
484
  * @typedef GlobalSchema
485
- * @property {Prop[]} [props]
486
- */
487
- /**
488
- * @typedef Prop
489
- * @property {string} [type] - The type of the property
490
- * @property {string} [category] - The category of the property
491
- * @property {string} [value] - The value of the property
492
- * @property {string} [id] - The ID of the property
493
- * @property {string} [label] - The label of the property
494
- * @property {string} [info] - Additional information about the property
485
+ * @property {Object[]} [props]
495
486
  */
496
487
  /**
497
488
  * @typedef Preset
@@ -656,7 +647,7 @@ export = ThemePartnerModel;
656
647
  declare class ThemePartnerModel {
657
648
  }
658
649
  declare namespace ThemePartnerModel {
659
- export { AvailablePageSchema, DraftExtensionSectionRequest, DraftExtensionSectionResponse, SectionsResponse, ExtensionSection, PropExtension, AssetsExtension, PublishExtensionSectionRequest, ExtensionPreviewRequest, ExtensionPreviewResponse, PublishExtensionSectionResponse, AvailablePageSectionMetaAttributes, AvailablePageSeo, SEOMetaItem, SEOMetaItems, SEOSitemap, SEObreadcrumb, Action, AvailablePageSchemaSections, AvailablePageScreenPredicate, AvailablePageUserPredicate, AvailablePageRoutePredicate, AvailablePagePlatformPredicate, AvailablePageSchedulePredicate, AvailablePagePredicate, MarketplaceThemeSchema, MarketplaceTheme, PaymentInfo, ContactInfo, CatalogSize, MarketplaceThemeImages, CarouselItem, ExploreInfo, Feature, FeatureItem, Highlight, Variation, Documentation, Comments, ThemeRejectionReasons, AllAvailablePageSchema, PaginationSchema, BlitzkriegApiErrorSchema, BlitzkriegInternalServerErrorSchema, ThemesSchema, Font, FontVariants, FontVariant, Config, ThemeConfiguration, OverlayPopup, DividerStrokeHighlight, UserAlerts, OrderTracking, ThemeConfigListPage, ThemeConfigListPageSettingsProps, CustomConfig, CustomProps, ThemeMeta, ThemePayment, Release, Images, Assets, UMDJs, CommonJS, CSS, SectionItem, GlobalSchema, Prop, Preset, Page, SectionProps, SectionPreset, ImagePickerProp, UrlProp, BlockProps, TextProp, CheckboxProp, RangeProp, Section, Block, Predicate, Screen, ThemeUserSchema, Route, UpdateThemeRequestBody, CreateNewTheme, ActionPage, PageType };
650
+ export { AvailablePageSchema, DraftExtensionSectionRequest, DraftExtensionSectionResponse, SectionsResponse, ExtensionSection, PropExtension, AssetsExtension, PublishExtensionSectionRequest, ExtensionPreviewRequest, ExtensionPreviewResponse, PublishExtensionSectionResponse, AvailablePageSectionMetaAttributes, AvailablePageSeo, SEOMetaItem, SEOMetaItems, SEOSitemap, SEObreadcrumb, Action, AvailablePageSchemaSections, AvailablePageScreenPredicate, AvailablePageUserPredicate, AvailablePageRoutePredicate, AvailablePagePlatformPredicate, AvailablePageSchedulePredicate, AvailablePagePredicate, MarketplaceThemeSchema, MarketplaceTheme, PaymentInfo, ContactInfo, CatalogSize, MarketplaceThemeImages, CarouselItem, ExploreInfo, Feature, FeatureItem, Highlight, Variation, Documentation, Comments, ThemeRejectionReasons, AllAvailablePageSchema, PaginationSchema, BlitzkriegApiErrorSchema, BlitzkriegInternalServerErrorSchema, ThemesSchema, Font, FontVariants, FontVariant, Config, ThemeConfiguration, OverlayPopup, DividerStrokeHighlight, UserAlerts, OrderTracking, ThemeConfigListPage, ThemeConfigListPageSettingsProps, CustomConfig, CustomProps, ThemeMeta, ThemePayment, Release, Images, Assets, UMDJs, CommonJS, CSS, SectionItem, GlobalSchema, Preset, Page, SectionProps, SectionPreset, ImagePickerProp, UrlProp, BlockProps, TextProp, CheckboxProp, RangeProp, Section, Block, Predicate, Screen, ThemeUserSchema, Route, UpdateThemeRequestBody, CreateNewTheme, ActionPage, PageType };
660
651
  }
661
652
  /** @returns {AvailablePageSchema} */
662
653
  declare function AvailablePageSchema(): AvailablePageSchema;
@@ -1581,35 +1572,7 @@ type SectionItem = {
1581
1572
  /** @returns {GlobalSchema} */
1582
1573
  declare function GlobalSchema(): GlobalSchema;
1583
1574
  type GlobalSchema = {
1584
- props?: Prop[];
1585
- };
1586
- /** @returns {Prop} */
1587
- declare function Prop(): Prop;
1588
- type Prop = {
1589
- /**
1590
- * - The type of the property
1591
- */
1592
- type?: string;
1593
- /**
1594
- * - The category of the property
1595
- */
1596
- category?: string;
1597
- /**
1598
- * - The value of the property
1599
- */
1600
- value?: string;
1601
- /**
1602
- * - The ID of the property
1603
- */
1604
- id?: string;
1605
- /**
1606
- * - The label of the property
1607
- */
1608
- label?: string;
1609
- /**
1610
- * - Additional information about the property
1611
- */
1612
- info?: string;
1575
+ props?: any[];
1613
1576
  };
1614
1577
  /** @returns {Preset} */
1615
1578
  declare function Preset(): Preset;
@@ -550,17 +550,7 @@ const Joi = require("joi");
550
550
 
551
551
  /**
552
552
  * @typedef GlobalSchema
553
- * @property {Prop[]} [props]
554
- */
555
-
556
- /**
557
- * @typedef Prop
558
- * @property {string} [type] - The type of the property
559
- * @property {string} [category] - The category of the property
560
- * @property {string} [value] - The value of the property
561
- * @property {string} [id] - The ID of the property
562
- * @property {string} [label] - The label of the property
563
- * @property {string} [info] - Additional information about the property
553
+ * @property {Object[]} [props]
564
554
  */
565
555
 
566
556
  /**
@@ -1428,19 +1418,7 @@ class ThemePartnerModel {
1428
1418
  /** @returns {GlobalSchema} */
1429
1419
  static GlobalSchema() {
1430
1420
  return Joi.object({
1431
- props: Joi.array().items(ThemePartnerModel.Prop()),
1432
- });
1433
- }
1434
-
1435
- /** @returns {Prop} */
1436
- static Prop() {
1437
- return Joi.object({
1438
- type: Joi.string().allow(""),
1439
- category: Joi.string().allow(""),
1440
- value: Joi.string().allow(""),
1441
- id: Joi.string().allow(""),
1442
- label: Joi.string().allow(""),
1443
- info: Joi.string().allow(""),
1421
+ props: Joi.array().items(Joi.any()),
1444
1422
  });
1445
1423
  }
1446
1424
 
@@ -533,6 +533,8 @@ export = CartPlatformModel;
533
533
  * @property {boolean} is_authenticated - Flag indicating whether the user is
534
534
  * authenticated
535
535
  * @property {Article[]} article_ids - The list of article object in the price adjustment
536
+ * @property {boolean} [auto_remove] - This field if set true will remove mop
537
+ * type price adjustment.
536
538
  * @property {Object} [meta]
537
539
  * @property {string} cart_id - The ID of the cart
538
540
  */
@@ -554,6 +556,8 @@ export = CartPlatformModel;
554
556
  * @property {boolean} is_authenticated - Flag indicating whether the user is
555
557
  * authenticated
556
558
  * @property {Article[]} article_ids - The list of article object in the price adjustment
559
+ * @property {boolean} [auto_remove] - This field if set true will remove mop
560
+ * type price adjustment.
557
561
  * @property {Object} [meta]
558
562
  * @property {string} cart_id - The ID of the cart
559
563
  */
@@ -585,6 +589,8 @@ export = CartPlatformModel;
585
589
  * @property {Article[]} article_ids - The list of article object in the price adjustment
586
590
  * @property {Object} [meta]
587
591
  * @property {string} cart_id - The ID of the cart
592
+ * @property {boolean} [auto_remove] - This field if set true will remove mop
593
+ * type price adjustment.
588
594
  */
589
595
  /**
590
596
  * @typedef CartItem
@@ -775,6 +781,8 @@ export = CartPlatformModel;
775
781
  * @property {BuyRules[]} [buy_rules] - Buy rules for promotions
776
782
  * @property {string} [offer_text] - Offer text of current promotion
777
783
  * @property {number} [amount] - Per unit discount amount applied with current promotion
784
+ * @property {string} [float_amount] - Per unit discount amount with decimal
785
+ * values applied with current promotion.
778
786
  * @property {string} [promotion_type] - Promotion type of current promotion
779
787
  * @property {boolean} [mrp_promotion] - If applied promotion is applied on
780
788
  * product MRP or ESP
@@ -2505,6 +2513,11 @@ type PriceAdjustmentUpdate = {
2505
2513
  * - The list of article object in the price adjustment
2506
2514
  */
2507
2515
  article_ids: Article[];
2516
+ /**
2517
+ * - This field if set true will remove mop
2518
+ * type price adjustment.
2519
+ */
2520
+ auto_remove?: boolean;
2508
2521
  meta?: any;
2509
2522
  /**
2510
2523
  * - The ID of the cart
@@ -2554,6 +2567,11 @@ type PriceAdjustment = {
2554
2567
  * - The list of article object in the price adjustment
2555
2568
  */
2556
2569
  article_ids: Article[];
2570
+ /**
2571
+ * - This field if set true will remove mop
2572
+ * type price adjustment.
2573
+ */
2574
+ auto_remove?: boolean;
2557
2575
  meta?: any;
2558
2576
  /**
2559
2577
  * - The ID of the cart
@@ -2621,6 +2639,11 @@ type PriceAdjustmentAdd = {
2621
2639
  * - The ID of the cart
2622
2640
  */
2623
2641
  cart_id: string;
2642
+ /**
2643
+ * - This field if set true will remove mop
2644
+ * type price adjustment.
2645
+ */
2646
+ auto_remove?: boolean;
2624
2647
  };
2625
2648
  /** @returns {CartItem} */
2626
2649
  declare function CartItem(): CartItem;
@@ -2906,6 +2929,11 @@ type AppliedPromotion = {
2906
2929
  * - Per unit discount amount applied with current promotion
2907
2930
  */
2908
2931
  amount?: number;
2932
+ /**
2933
+ * - Per unit discount amount with decimal
2934
+ * values applied with current promotion.
2935
+ */
2936
+ float_amount?: string;
2909
2937
  /**
2910
2938
  * - Promotion type of current promotion
2911
2939
  */
@@ -593,6 +593,8 @@ const Joi = require("joi");
593
593
  * @property {boolean} is_authenticated - Flag indicating whether the user is
594
594
  * authenticated
595
595
  * @property {Article[]} article_ids - The list of article object in the price adjustment
596
+ * @property {boolean} [auto_remove] - This field if set true will remove mop
597
+ * type price adjustment.
596
598
  * @property {Object} [meta]
597
599
  * @property {string} cart_id - The ID of the cart
598
600
  */
@@ -615,6 +617,8 @@ const Joi = require("joi");
615
617
  * @property {boolean} is_authenticated - Flag indicating whether the user is
616
618
  * authenticated
617
619
  * @property {Article[]} article_ids - The list of article object in the price adjustment
620
+ * @property {boolean} [auto_remove] - This field if set true will remove mop
621
+ * type price adjustment.
618
622
  * @property {Object} [meta]
619
623
  * @property {string} cart_id - The ID of the cart
620
624
  */
@@ -649,6 +653,8 @@ const Joi = require("joi");
649
653
  * @property {Article[]} article_ids - The list of article object in the price adjustment
650
654
  * @property {Object} [meta]
651
655
  * @property {string} cart_id - The ID of the cart
656
+ * @property {boolean} [auto_remove] - This field if set true will remove mop
657
+ * type price adjustment.
652
658
  */
653
659
 
654
660
  /**
@@ -862,6 +868,8 @@ const Joi = require("joi");
862
868
  * @property {BuyRules[]} [buy_rules] - Buy rules for promotions
863
869
  * @property {string} [offer_text] - Offer text of current promotion
864
870
  * @property {number} [amount] - Per unit discount amount applied with current promotion
871
+ * @property {string} [float_amount] - Per unit discount amount with decimal
872
+ * values applied with current promotion.
865
873
  * @property {string} [promotion_type] - Promotion type of current promotion
866
874
  * @property {boolean} [mrp_promotion] - If applied promotion is applied on
867
875
  * product MRP or ESP
@@ -2647,6 +2655,7 @@ class CartPlatformModel {
2647
2655
  allowed_refund: Joi.boolean(),
2648
2656
  is_authenticated: Joi.boolean().required(),
2649
2657
  article_ids: Joi.array().items(CartPlatformModel.Article()).required(),
2658
+ auto_remove: Joi.boolean(),
2650
2659
  meta: Joi.any(),
2651
2660
  cart_id: Joi.string().allow("").required(),
2652
2661
  });
@@ -2666,6 +2675,7 @@ class CartPlatformModel {
2666
2675
  allowed_refund: Joi.boolean(),
2667
2676
  is_authenticated: Joi.boolean().required(),
2668
2677
  article_ids: Joi.array().items(CartPlatformModel.Article()).required(),
2678
+ auto_remove: Joi.boolean(),
2669
2679
  meta: Joi.any(),
2670
2680
  cart_id: Joi.string().allow("").required(),
2671
2681
  });
@@ -2701,6 +2711,7 @@ class CartPlatformModel {
2701
2711
  article_ids: Joi.array().items(CartPlatformModel.Article()).required(),
2702
2712
  meta: Joi.any(),
2703
2713
  cart_id: Joi.string().allow("").required(),
2714
+ auto_remove: Joi.boolean(),
2704
2715
  });
2705
2716
  }
2706
2717
 
@@ -2959,6 +2970,7 @@ class CartPlatformModel {
2959
2970
  buy_rules: Joi.array().items(CartPlatformModel.BuyRules()),
2960
2971
  offer_text: Joi.string().allow(""),
2961
2972
  amount: Joi.number(),
2973
+ float_amount: Joi.string().allow(""),
2962
2974
  promotion_type: Joi.string().allow(""),
2963
2975
  mrp_promotion: Joi.boolean(),
2964
2976
  promotion_group: Joi.string().allow(""),
@@ -371,8 +371,6 @@ export = CatalogPlatformModel;
371
371
  * @property {boolean} [is_active] - Indicates if the brand is active.
372
372
  * @property {number[]} [departments] - List of department IDs associated with the brand.
373
373
  * @property {string} [modified_on] - Timestamp when the brand was last modified.
374
- * @property {boolean} [active] - Boolean indicating whether the brand is
375
- * currently active or not.
376
374
  */
377
375
  /**
378
376
  * @typedef ApplicationBrandListingSchema
@@ -4021,11 +4019,6 @@ type ApplicationBrandListingItemSchema = {
4021
4019
  * - Timestamp when the brand was last modified.
4022
4020
  */
4023
4021
  modified_on?: string;
4024
- /**
4025
- * - Boolean indicating whether the brand is
4026
- * currently active or not.
4027
- */
4028
- active?: boolean;
4029
4022
  };
4030
4023
  /** @returns {ApplicationBrandListingSchema} */
4031
4024
  declare function ApplicationBrandListingSchema(): ApplicationBrandListingSchema;
@@ -417,8 +417,6 @@ const Joi = require("joi");
417
417
  * @property {boolean} [is_active] - Indicates if the brand is active.
418
418
  * @property {number[]} [departments] - List of department IDs associated with the brand.
419
419
  * @property {string} [modified_on] - Timestamp when the brand was last modified.
420
- * @property {boolean} [active] - Boolean indicating whether the brand is
421
- * currently active or not.
422
420
  */
423
421
 
424
422
  /**
@@ -4301,7 +4299,6 @@ class CatalogPlatformModel {
4301
4299
  is_active: Joi.boolean(),
4302
4300
  departments: Joi.array().items(Joi.number()),
4303
4301
  modified_on: Joi.string().allow(""),
4304
- active: Joi.boolean(),
4305
4302
  });
4306
4303
  }
4307
4304
 
@@ -7256,7 +7253,7 @@ class CatalogPlatformModel {
7256
7253
  all_company_ids: Joi.array().items(Joi.number()),
7257
7254
  all_identifiers: Joi.array().items(Joi.string().allow("")),
7258
7255
  all_sizes: Joi.array().items(Joi.any()),
7259
- attributes: Joi.any(),
7256
+ attributes: Joi.object().pattern(/\S/, Joi.any()),
7260
7257
  brand: CatalogPlatformModel.Brand(),
7261
7258
  brand_uid: Joi.number(),
7262
7259
  category: Joi.any(),
@@ -51,6 +51,10 @@ export = ConfigurationPlatformModel;
51
51
  * @property {Object[]} [company_store] - List of selling locations whose
52
52
  * inventory is available to the sales channel for displaying on the website
53
53
  * @property {number} [company_id]
54
+ * @property {boolean} [enable_zone_overlapping] - Power product listing with
55
+ * overlapping zones
56
+ * @property {boolean} [sort_popular_first] - Give preference to popularity over
57
+ * score in product listing sort
54
58
  */
55
59
  /**
56
60
  * @typedef InventoryBrand
@@ -1434,6 +1438,16 @@ type AppInventoryConfig = {
1434
1438
  */
1435
1439
  company_store?: any[];
1436
1440
  company_id?: number;
1441
+ /**
1442
+ * - Power product listing with
1443
+ * overlapping zones
1444
+ */
1445
+ enable_zone_overlapping?: boolean;
1446
+ /**
1447
+ * - Give preference to popularity over
1448
+ * score in product listing sort
1449
+ */
1450
+ sort_popular_first?: boolean;
1437
1451
  };
1438
1452
  /** @returns {InventoryBrand} */
1439
1453
  declare function InventoryBrand(): InventoryBrand;
@@ -54,6 +54,10 @@ const Joi = require("joi");
54
54
  * @property {Object[]} [company_store] - List of selling locations whose
55
55
  * inventory is available to the sales channel for displaying on the website
56
56
  * @property {number} [company_id]
57
+ * @property {boolean} [enable_zone_overlapping] - Power product listing with
58
+ * overlapping zones
59
+ * @property {boolean} [sort_popular_first] - Give preference to popularity over
60
+ * score in product listing sort
57
61
  */
58
62
 
59
63
  /**
@@ -1557,6 +1561,8 @@ class ConfigurationPlatformModel {
1557
1561
  image: Joi.array().items(Joi.string().allow("")),
1558
1562
  company_store: Joi.array().items(Joi.any()),
1559
1563
  company_id: Joi.number(),
1564
+ enable_zone_overlapping: Joi.boolean(),
1565
+ sort_popular_first: Joi.boolean(),
1560
1566
  });
1561
1567
  }
1562
1568