@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
@@ -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 ShareApplicationValidator = require("./ShareApplicationValidator");
9
- const ShareApplicationModel = require("./ShareApplicationModel");
10
- const { Logger } = require("./../../common/Logger");
11
- const Joi = require("joi");
9
+ const { validateRequiredParams } = require("../../common/Validator");
12
10
 
13
11
  class Share {
14
12
  constructor(_conf) {
@@ -43,10 +41,9 @@ class Share {
43
41
  }
44
42
 
45
43
  /**
46
- * @param {ShareApplicationValidator.CreateShortLinkParam} arg - Arg object.
47
44
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
48
45
  * @param {import("../ApplicationAPIClient").Options} - Options
49
- * @returns {Promise<ShareApplicationModel.ShortLinkRes>} - Success response
46
+ * @returns {Promise<ShortLinkRes>} - Success response
50
47
  * @name createShortLink
51
48
  * @summary: Shorten URL
52
49
  * @description: Creates a shortened version of a given URL for easier sharing. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/share/createShortLink/).
@@ -55,28 +52,6 @@ class Share {
55
52
  { body, requestHeaders } = { requestHeaders: {} },
56
53
  { responseHeaders } = { responseHeaders: false }
57
54
  ) {
58
- const { error } = ShareApplicationValidator.createShortLink().validate(
59
- { body },
60
- { abortEarly: false, allowUnknown: true }
61
- );
62
- if (error) {
63
- return Promise.reject(new FDKClientValidationError(error));
64
- }
65
-
66
- // Showing warrnings if extra unknown parameters are found
67
- const {
68
- error: warrning,
69
- } = ShareApplicationValidator.createShortLink().validate(
70
- { body },
71
- { abortEarly: false, allowUnknown: false }
72
- );
73
- if (warrning) {
74
- Logger({
75
- level: "WARN",
76
- message: `Parameter Validation warrnings for application > Share > createShortLink \n ${warrning}`,
77
- });
78
- }
79
-
80
55
  const query_params = {};
81
56
 
82
57
  const xHeaders = {};
@@ -99,32 +74,13 @@ class Share {
99
74
  responseData = response[0];
100
75
  }
101
76
 
102
- const {
103
- error: res_error,
104
- } = ShareApplicationModel.ShortLinkRes().validate(responseData, {
105
- abortEarly: false,
106
- allowUnknown: true,
107
- });
108
-
109
- if (res_error) {
110
- if (this._conf.options.strictResponseCheck === true) {
111
- return Promise.reject(new FDKResponseValidationError(res_error));
112
- } else {
113
- Logger({
114
- level: "WARN",
115
- message: `Response Validation Warnings for application > Share > createShortLink \n ${res_error}`,
116
- });
117
- }
118
- }
119
-
120
77
  return response;
121
78
  }
122
79
 
123
80
  /**
124
- * @param {ShareApplicationValidator.GetApplicationQRCodeParam} arg - Arg object.
125
81
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
126
82
  * @param {import("../ApplicationAPIClient").Options} - Options
127
- * @returns {Promise<ShareApplicationModel.QRCodeResp>} - Success response
83
+ * @returns {Promise<QRCodeResp>} - Success response
128
84
  * @name getApplicationQRCode
129
85
  * @summary: App QR code
130
86
  * @description: Generates a QR code for the application for easy sharing. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/share/getApplicationQRCode/).
@@ -133,28 +89,6 @@ class Share {
133
89
  { requestHeaders } = { requestHeaders: {} },
134
90
  { responseHeaders } = { responseHeaders: false }
135
91
  ) {
136
- const { error } = ShareApplicationValidator.getApplicationQRCode().validate(
137
- {},
138
- { abortEarly: false, allowUnknown: true }
139
- );
140
- if (error) {
141
- return Promise.reject(new FDKClientValidationError(error));
142
- }
143
-
144
- // Showing warrnings if extra unknown parameters are found
145
- const {
146
- error: warrning,
147
- } = ShareApplicationValidator.getApplicationQRCode().validate(
148
- {},
149
- { abortEarly: false, allowUnknown: false }
150
- );
151
- if (warrning) {
152
- Logger({
153
- level: "WARN",
154
- message: `Parameter Validation warrnings for application > Share > getApplicationQRCode \n ${warrning}`,
155
- });
156
- }
157
-
158
92
  const query_params = {};
159
93
 
160
94
  const xHeaders = {};
@@ -177,32 +111,13 @@ class Share {
177
111
  responseData = response[0];
178
112
  }
179
113
 
180
- const {
181
- error: res_error,
182
- } = ShareApplicationModel.QRCodeResp().validate(responseData, {
183
- abortEarly: false,
184
- allowUnknown: true,
185
- });
186
-
187
- if (res_error) {
188
- if (this._conf.options.strictResponseCheck === true) {
189
- return Promise.reject(new FDKResponseValidationError(res_error));
190
- } else {
191
- Logger({
192
- level: "WARN",
193
- message: `Response Validation Warnings for application > Share > getApplicationQRCode \n ${res_error}`,
194
- });
195
- }
196
- }
197
-
198
114
  return response;
199
115
  }
200
116
 
201
117
  /**
202
- * @param {ShareApplicationValidator.GetCollectionQRCodeBySlugParam} arg - Arg object.
203
118
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
204
119
  * @param {import("../ApplicationAPIClient").Options} - Options
205
- * @returns {Promise<ShareApplicationModel.QRCodeResp>} - Success response
120
+ * @returns {Promise<QRCodeResp>} - Success response
206
121
  * @name getCollectionQRCodeBySlug
207
122
  * @summary: Collection QR code
208
123
  * @description: Generates a QR code for a specific product collection using its slug. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/share/getCollectionQRCodeBySlug/).
@@ -211,28 +126,13 @@ class Share {
211
126
  { slug, requestHeaders } = { requestHeaders: {} },
212
127
  { responseHeaders } = { responseHeaders: false }
213
128
  ) {
214
- const {
215
- error,
216
- } = ShareApplicationValidator.getCollectionQRCodeBySlug().validate(
217
- { slug },
218
- { abortEarly: false, allowUnknown: true }
219
- );
220
- if (error) {
221
- return Promise.reject(new FDKClientValidationError(error));
222
- }
223
-
224
- // Showing warrnings if extra unknown parameters are found
225
- const {
226
- error: warrning,
227
- } = ShareApplicationValidator.getCollectionQRCodeBySlug().validate(
228
- { slug },
229
- { abortEarly: false, allowUnknown: false }
230
- );
231
- if (warrning) {
232
- Logger({
233
- level: "WARN",
234
- message: `Parameter Validation warrnings for application > Share > getCollectionQRCodeBySlug \n ${warrning}`,
129
+ const errors = validateRequiredParams(arguments[0], ["slug"]);
130
+ if (errors.length > 0) {
131
+ const error = new FDKClientValidationError({
132
+ message: "Missing required field",
133
+ details: errors,
235
134
  });
135
+ return Promise.reject(new FDKClientValidationError(error));
236
136
  }
237
137
 
238
138
  const query_params = {};
@@ -257,33 +157,13 @@ class Share {
257
157
  responseData = response[0];
258
158
  }
259
159
 
260
- const {
261
- error: res_error,
262
- } = ShareApplicationModel.QRCodeResp().validate(responseData, {
263
- abortEarly: false,
264
- allowUnknown: true,
265
- });
266
-
267
- if (res_error) {
268
- if (this._conf.options.strictResponseCheck === true) {
269
- return Promise.reject(new FDKResponseValidationError(res_error));
270
- } else {
271
- Logger({
272
- level: "WARN",
273
- message: `Response Validation Warnings for application > Share > getCollectionQRCodeBySlug \n ${res_error}`,
274
- });
275
- }
276
- }
277
-
278
160
  return response;
279
161
  }
280
162
 
281
163
  /**
282
- * @param {ShareApplicationValidator.GetOriginalShortLinkByHashParam} arg -
283
- * Arg object.
284
164
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
285
165
  * @param {import("../ApplicationAPIClient").Options} - Options
286
- * @returns {Promise<ShareApplicationModel.ShortLinkRes>} - Success response
166
+ * @returns {Promise<ShortLinkRes>} - Success response
287
167
  * @name getOriginalShortLinkByHash
288
168
  * @summary: Original URL
289
169
  * @description: Retrieve the original link from a short-link by using a hash value. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/share/getOriginalShortLinkByHash/).
@@ -292,28 +172,13 @@ class Share {
292
172
  { hash, requestHeaders } = { requestHeaders: {} },
293
173
  { responseHeaders } = { responseHeaders: false }
294
174
  ) {
295
- const {
296
- error,
297
- } = ShareApplicationValidator.getOriginalShortLinkByHash().validate(
298
- { hash },
299
- { abortEarly: false, allowUnknown: true }
300
- );
301
- if (error) {
302
- return Promise.reject(new FDKClientValidationError(error));
303
- }
304
-
305
- // Showing warrnings if extra unknown parameters are found
306
- const {
307
- error: warrning,
308
- } = ShareApplicationValidator.getOriginalShortLinkByHash().validate(
309
- { hash },
310
- { abortEarly: false, allowUnknown: false }
311
- );
312
- if (warrning) {
313
- Logger({
314
- level: "WARN",
315
- message: `Parameter Validation warrnings for application > Share > getOriginalShortLinkByHash \n ${warrning}`,
175
+ const errors = validateRequiredParams(arguments[0], ["hash"]);
176
+ if (errors.length > 0) {
177
+ const error = new FDKClientValidationError({
178
+ message: "Missing required field",
179
+ details: errors,
316
180
  });
181
+ return Promise.reject(new FDKClientValidationError(error));
317
182
  }
318
183
 
319
184
  const query_params = {};
@@ -338,32 +203,13 @@ class Share {
338
203
  responseData = response[0];
339
204
  }
340
205
 
341
- const {
342
- error: res_error,
343
- } = ShareApplicationModel.ShortLinkRes().validate(responseData, {
344
- abortEarly: false,
345
- allowUnknown: true,
346
- });
347
-
348
- if (res_error) {
349
- if (this._conf.options.strictResponseCheck === true) {
350
- return Promise.reject(new FDKResponseValidationError(res_error));
351
- } else {
352
- Logger({
353
- level: "WARN",
354
- message: `Response Validation Warnings for application > Share > getOriginalShortLinkByHash \n ${res_error}`,
355
- });
356
- }
357
- }
358
-
359
206
  return response;
360
207
  }
361
208
 
362
209
  /**
363
- * @param {ShareApplicationValidator.GetProductQRCodeBySlugParam} arg - Arg object.
364
210
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
365
211
  * @param {import("../ApplicationAPIClient").Options} - Options
366
- * @returns {Promise<ShareApplicationModel.QRCodeResp>} - Success response
212
+ * @returns {Promise<QRCodeResp>} - Success response
367
213
  * @name getProductQRCodeBySlug
368
214
  * @summary: Product QR code
369
215
  * @description: Creates a QR code for a specific product identified by its slug. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/share/getProductQRCodeBySlug/).
@@ -372,28 +218,13 @@ class Share {
372
218
  { slug, requestHeaders } = { requestHeaders: {} },
373
219
  { responseHeaders } = { responseHeaders: false }
374
220
  ) {
375
- const {
376
- error,
377
- } = ShareApplicationValidator.getProductQRCodeBySlug().validate(
378
- { slug },
379
- { abortEarly: false, allowUnknown: true }
380
- );
381
- if (error) {
382
- return Promise.reject(new FDKClientValidationError(error));
383
- }
384
-
385
- // Showing warrnings if extra unknown parameters are found
386
- const {
387
- error: warrning,
388
- } = ShareApplicationValidator.getProductQRCodeBySlug().validate(
389
- { slug },
390
- { abortEarly: false, allowUnknown: false }
391
- );
392
- if (warrning) {
393
- Logger({
394
- level: "WARN",
395
- message: `Parameter Validation warrnings for application > Share > getProductQRCodeBySlug \n ${warrning}`,
221
+ const errors = validateRequiredParams(arguments[0], ["slug"]);
222
+ if (errors.length > 0) {
223
+ const error = new FDKClientValidationError({
224
+ message: "Missing required field",
225
+ details: errors,
396
226
  });
227
+ return Promise.reject(new FDKClientValidationError(error));
397
228
  }
398
229
 
399
230
  const query_params = {};
@@ -418,32 +249,13 @@ class Share {
418
249
  responseData = response[0];
419
250
  }
420
251
 
421
- const {
422
- error: res_error,
423
- } = ShareApplicationModel.QRCodeResp().validate(responseData, {
424
- abortEarly: false,
425
- allowUnknown: true,
426
- });
427
-
428
- if (res_error) {
429
- if (this._conf.options.strictResponseCheck === true) {
430
- return Promise.reject(new FDKResponseValidationError(res_error));
431
- } else {
432
- Logger({
433
- level: "WARN",
434
- message: `Response Validation Warnings for application > Share > getProductQRCodeBySlug \n ${res_error}`,
435
- });
436
- }
437
- }
438
-
439
252
  return response;
440
253
  }
441
254
 
442
255
  /**
443
- * @param {ShareApplicationValidator.GetShortLinkByHashParam} arg - Arg object.
444
256
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
445
257
  * @param {import("../ApplicationAPIClient").Options} - Options
446
- * @returns {Promise<ShareApplicationModel.ShortLinkRes>} - Success response
258
+ * @returns {Promise<ShortLinkRes>} - Success response
447
259
  * @name getShortLinkByHash
448
260
  * @summary: Get short link
449
261
  * @description: Retrieves a previously created short link using its hash identifier. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/share/getShortLinkByHash/).
@@ -452,26 +264,13 @@ class Share {
452
264
  { hash, requestHeaders } = { requestHeaders: {} },
453
265
  { responseHeaders } = { responseHeaders: false }
454
266
  ) {
455
- const { error } = ShareApplicationValidator.getShortLinkByHash().validate(
456
- { hash },
457
- { abortEarly: false, allowUnknown: true }
458
- );
459
- if (error) {
460
- return Promise.reject(new FDKClientValidationError(error));
461
- }
462
-
463
- // Showing warrnings if extra unknown parameters are found
464
- const {
465
- error: warrning,
466
- } = ShareApplicationValidator.getShortLinkByHash().validate(
467
- { hash },
468
- { abortEarly: false, allowUnknown: false }
469
- );
470
- if (warrning) {
471
- Logger({
472
- level: "WARN",
473
- message: `Parameter Validation warrnings for application > Share > getShortLinkByHash \n ${warrning}`,
267
+ const errors = validateRequiredParams(arguments[0], ["hash"]);
268
+ if (errors.length > 0) {
269
+ const error = new FDKClientValidationError({
270
+ message: "Missing required field",
271
+ details: errors,
474
272
  });
273
+ return Promise.reject(new FDKClientValidationError(error));
475
274
  }
476
275
 
477
276
  const query_params = {};
@@ -496,32 +295,13 @@ class Share {
496
295
  responseData = response[0];
497
296
  }
498
297
 
499
- const {
500
- error: res_error,
501
- } = ShareApplicationModel.ShortLinkRes().validate(responseData, {
502
- abortEarly: false,
503
- allowUnknown: true,
504
- });
505
-
506
- if (res_error) {
507
- if (this._conf.options.strictResponseCheck === true) {
508
- return Promise.reject(new FDKResponseValidationError(res_error));
509
- } else {
510
- Logger({
511
- level: "WARN",
512
- message: `Response Validation Warnings for application > Share > getShortLinkByHash \n ${res_error}`,
513
- });
514
- }
515
- }
516
-
517
298
  return response;
518
299
  }
519
300
 
520
301
  /**
521
- * @param {ShareApplicationValidator.GetUrlQRCodeParam} arg - Arg object.
522
302
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
523
303
  * @param {import("../ApplicationAPIClient").Options} - Options
524
- * @returns {Promise<ShareApplicationModel.QRCodeResp>} - Success response
304
+ * @returns {Promise<QRCodeResp>} - Success response
525
305
  * @name getUrlQRCode
526
306
  * @summary: URL to QR code
527
307
  * @description: Converts a given URL into a scannable QR code. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/share/getUrlQRCode/).
@@ -530,28 +310,6 @@ class Share {
530
310
  { url, requestHeaders } = { requestHeaders: {} },
531
311
  { responseHeaders } = { responseHeaders: false }
532
312
  ) {
533
- const { error } = ShareApplicationValidator.getUrlQRCode().validate(
534
- { url },
535
- { abortEarly: false, allowUnknown: true }
536
- );
537
- if (error) {
538
- return Promise.reject(new FDKClientValidationError(error));
539
- }
540
-
541
- // Showing warrnings if extra unknown parameters are found
542
- const {
543
- error: warrning,
544
- } = ShareApplicationValidator.getUrlQRCode().validate(
545
- { url },
546
- { abortEarly: false, allowUnknown: false }
547
- );
548
- if (warrning) {
549
- Logger({
550
- level: "WARN",
551
- message: `Parameter Validation warrnings for application > Share > getUrlQRCode \n ${warrning}`,
552
- });
553
- }
554
-
555
313
  const query_params = {};
556
314
  query_params["url"] = url;
557
315
 
@@ -575,24 +333,6 @@ class Share {
575
333
  responseData = response[0];
576
334
  }
577
335
 
578
- const {
579
- error: res_error,
580
- } = ShareApplicationModel.QRCodeResp().validate(responseData, {
581
- abortEarly: false,
582
- allowUnknown: true,
583
- });
584
-
585
- if (res_error) {
586
- if (this._conf.options.strictResponseCheck === true) {
587
- return Promise.reject(new FDKResponseValidationError(res_error));
588
- } else {
589
- Logger({
590
- level: "WARN",
591
- message: `Response Validation Warnings for application > Share > getUrlQRCode \n ${res_error}`,
592
- });
593
- }
594
- }
595
-
596
336
  return response;
597
337
  }
598
338
  }
@@ -11,45 +11,39 @@ declare class Theme {
11
11
  _urls: {};
12
12
  updateUrls(urls: any): void;
13
13
  /**
14
- * @param {ThemeApplicationValidator.GetAllPagesParam} arg - Arg object.
15
14
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
16
15
  * @param {import("../ApplicationAPIClient").Options} - Options
17
- * @returns {Promise<ThemeApplicationModel.AllAvailablePageSchema>} - Success response
16
+ * @returns {Promise<AllAvailablePageSchema>} - Success response
18
17
  * @name getAllPages
19
18
  * @summary: List pages
20
19
  * @description: Get all page level configs, sections and seo data of a theme. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/theme/getAllPages/).
21
20
  */
22
- getAllPages({ themeId, requestHeaders }?: ThemeApplicationValidator.GetAllPagesParam, { responseHeaders }?: object): Promise<ThemeApplicationModel.AllAvailablePageSchema>;
21
+ getAllPages({ themeId, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<AllAvailablePageSchema>;
23
22
  /**
24
- * @param {ThemeApplicationValidator.GetAppliedThemeParam} arg - Arg object.
25
23
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
26
24
  * @param {import("../ApplicationAPIClient").Options} - Options
27
- * @returns {Promise<ThemeApplicationModel.ThemesSchema>} - Success response
25
+ * @returns {Promise<ThemesSchema>} - Success response
28
26
  * @name getAppliedTheme
29
27
  * @summary: Get applied theme
30
28
  * @description: Gets the theme configuration and template details of a theme applied to the application. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/theme/getAppliedTheme/).
31
29
  */
32
- getAppliedTheme({ requestHeaders }?: any, { responseHeaders }?: object): Promise<ThemeApplicationModel.ThemesSchema>;
30
+ getAppliedTheme({ requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<ThemesSchema>;
33
31
  /**
34
- * @param {ThemeApplicationValidator.GetPageParam} arg - Arg object.
35
32
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
36
33
  * @param {import("../ApplicationAPIClient").Options} - Options
37
- * @returns {Promise<ThemeApplicationModel.AvailablePageSchema>} - Success response
34
+ * @returns {Promise<AvailablePageSchema>} - Success response
38
35
  * @name getPage
39
36
  * @summary: Get theme page
40
37
  * @description: Get page level configurations, applied sections and seo data of a page by `page_value` received from list pages api. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/theme/getPage/).
41
38
  */
42
- getPage({ themeId, pageValue, filters, sectionPreviewHash, company, requestHeaders, }?: ThemeApplicationValidator.GetPageParam, { responseHeaders }?: object): Promise<ThemeApplicationModel.AvailablePageSchema>;
39
+ getPage({ themeId, pageValue, filters, sectionPreviewHash, company, requestHeaders, }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<AvailablePageSchema>;
43
40
  /**
44
- * @param {ThemeApplicationValidator.GetThemeForPreviewParam} arg - Arg object.
45
41
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
46
42
  * @param {import("../ApplicationAPIClient").Options} - Options
47
- * @returns {Promise<ThemeApplicationModel.ThemesSchema>} - Success response
43
+ * @returns {Promise<ThemesSchema>} - Success response
48
44
  * @name getThemeForPreview
49
45
  * @summary: Get theme for preview
50
46
  * @description: Gets the theme configuration and template details of a theme by theme id. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/theme/getThemeForPreview/).
51
47
  */
52
- getThemeForPreview({ themeId, requestHeaders }?: ThemeApplicationValidator.GetThemeForPreviewParam, { responseHeaders }?: object): Promise<ThemeApplicationModel.ThemesSchema>;
48
+ getThemeForPreview({ themeId, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<ThemesSchema>;
53
49
  }
54
- import ThemeApplicationValidator = require("./ThemeApplicationValidator");
55
- import ThemeApplicationModel = require("./ThemeApplicationModel");