@gofynd/fdk-client-javascript 1.0.3 → 1.0.4

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 (175) hide show
  1. package/README.md +31 -2
  2. package/index.d.ts +4 -4
  3. package/index.js +9 -10
  4. package/package.json +14 -14
  5. package/sdk/APIClient.d.ts +11 -0
  6. package/sdk/APIClient.js +35 -0
  7. package/sdk/Client.d.ts +6 -0
  8. package/sdk/Client.js +17 -0
  9. package/sdk/Config.d.ts +9 -0
  10. package/sdk/Config.js +17 -0
  11. package/sdk/application/Cart/CartApplicationClient.js +29 -28
  12. package/sdk/application/Cart/CartApplicationModel.js +3 -1
  13. package/sdk/application/Catalog/CatalogApplicationClient.js +43 -42
  14. package/sdk/application/Catalog/CatalogApplicationModel.js +1 -1
  15. package/sdk/application/Common/CommonApplicationClient.js +5 -4
  16. package/sdk/application/Communication/CommunicationApplicationClient.js +6 -5
  17. package/sdk/application/Configuration/ConfigurationApplicationClient.js +21 -20
  18. package/sdk/application/Content/ContentApplicationClient.js +26 -25
  19. package/sdk/application/Content/ContentApplicationModel.js +1 -0
  20. package/sdk/application/FileStorage/FileStorageApplicationClient.js +6 -5
  21. package/sdk/application/Lead/LeadApplicationClient.js +10 -9
  22. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +1 -3
  23. package/sdk/application/Logistic/LogisticApplicationClient.js +11 -12
  24. package/sdk/application/Logistic/LogisticApplicationValidator.js +0 -1
  25. package/sdk/application/Order/OrderApplicationClient.js +15 -14
  26. package/sdk/application/Order/OrderApplicationModel.js +9 -0
  27. package/sdk/application/Payment/PaymentApplicationClient.js +42 -41
  28. package/sdk/application/PosCart/PosCartApplicationClient.js +30 -29
  29. package/sdk/application/PosCart/PosCartApplicationModel.js +3 -1
  30. package/sdk/application/Rewards/RewardsApplicationClient.js +11 -10
  31. package/sdk/application/Share/ShareApplicationClient.js +10 -9
  32. package/sdk/application/Theme/ThemeApplicationClient.js +7 -6
  33. package/sdk/application/User/UserApplicationClient.js +38 -37
  34. package/sdk/common/AxiosHelper.js +17 -6
  35. package/sdk/constructUrl.d.ts +5 -0
  36. package/sdk/constructUrl.js +13 -0
  37. package/sdk/index.d.ts +3 -0
  38. package/sdk/index.js +5 -0
  39. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +3 -1
  40. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +1 -1
  41. package/sdk/platform/Analytics/AnalyticsPlatformClient.js +5 -4
  42. package/sdk/platform/Analytics/AnalyticsPlatformValidator.js +1 -0
  43. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +3 -2
  44. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +1 -0
  45. package/sdk/platform/Billing/BillingPlatformClient.js +3 -2
  46. package/sdk/platform/Billing/BillingPlatformValidator.js +1 -0
  47. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +27 -0
  48. package/sdk/platform/Cart/CartPlatformApplicationClient.js +177 -1
  49. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +3 -0
  50. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +17 -1
  51. package/sdk/platform/Cart/CartPlatformModel.js +7 -3
  52. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +3 -1
  53. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +1 -1
  54. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +2 -2
  55. package/sdk/platform/Catalog/CatalogPlatformClient.js +6 -9
  56. package/sdk/platform/Catalog/CatalogPlatformModel.js +7 -7
  57. package/sdk/platform/Catalog/CatalogPlatformValidator.js +2 -1
  58. package/sdk/platform/Common/CommonPlatformClient.js +7 -18
  59. package/sdk/platform/Common/CommonPlatformValidator.js +1 -0
  60. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +3 -1
  61. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +1 -1
  62. package/sdk/platform/Communication/CommunicationPlatformClient.js +4 -3
  63. package/sdk/platform/Communication/CommunicationPlatformValidator.js +1 -0
  64. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +5 -4
  65. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +1 -0
  66. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +3 -1
  67. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +1 -1
  68. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +9 -8
  69. package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +1 -0
  70. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +0 -10
  71. package/sdk/platform/Content/ContentPlatformApplicationClient.js +3 -62
  72. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +0 -1
  73. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +1 -7
  74. package/sdk/platform/Content/ContentPlatformModel.js +1 -0
  75. package/sdk/platform/Discount/DiscountPlatformClient.js +3 -2
  76. package/sdk/platform/Discount/DiscountPlatformValidator.js +1 -0
  77. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +3 -3
  78. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +27 -5
  79. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +1 -1
  80. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +3 -3
  81. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +28 -6
  82. package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +1 -0
  83. package/sdk/platform/Inventory/InventoryPlatformClient.js +3 -2
  84. package/sdk/platform/Inventory/InventoryPlatformValidator.js +1 -0
  85. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +3 -1
  86. package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +1 -1
  87. package/sdk/platform/Lead/LeadPlatformClient.js +4 -3
  88. package/sdk/platform/Lead/LeadPlatformValidator.js +1 -0
  89. package/sdk/platform/Order/OrderPlatformApplicationClient.js +3 -1
  90. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +1 -1
  91. package/sdk/platform/Order/OrderPlatformClient.d.ts +1 -1
  92. package/sdk/platform/Order/OrderPlatformClient.js +16 -3
  93. package/sdk/platform/Order/OrderPlatformModel.js +1 -0
  94. package/sdk/platform/Order/OrderPlatformValidator.js +1 -0
  95. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +3 -1
  96. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +1 -1
  97. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +1 -1
  98. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +14 -14
  99. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +1 -1
  100. package/sdk/platform/Payment/PaymentPlatformClient.js +3 -2
  101. package/sdk/platform/Payment/PaymentPlatformValidator.js +1 -0
  102. package/sdk/platform/PlatformClient.d.ts +13 -9
  103. package/sdk/platform/PlatformClient.js +13 -9
  104. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +4 -4
  105. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +36 -17
  106. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +1 -1
  107. package/sdk/platform/Share/SharePlatformApplicationClient.js +3 -1
  108. package/sdk/platform/Share/SharePlatformApplicationValidator.js +1 -1
  109. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +3 -1
  110. package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +1 -1
  111. package/sdk/platform/User/UserPlatformApplicationClient.js +3 -1
  112. package/sdk/platform/User/UserPlatformApplicationValidator.js +1 -1
  113. package/sdk/platform/Webhook/WebhookPlatformClient.js +3 -2
  114. package/sdk/platform/Webhook/WebhookPlatformValidator.js +1 -0
  115. package/sdk/public/Configuration/ConfigurationPublicClient.js +2 -0
  116. package/sdk/public/Inventory/InventoryPublicClient.js +2 -0
  117. package/sdk/public/Webhook/WebhookPublicClient.js +2 -0
  118. package/.github/workflows/on_create_release.yml +0 -23
  119. package/.github/workflows/on_merge_main.yml +0 -38
  120. package/.github/workflows/on_pull_request.yml +0 -35
  121. package/.prettierrc +0 -5
  122. package/documentation/application/CART.md +0 -8771
  123. package/documentation/application/CATALOG.md +0 -8690
  124. package/documentation/application/COMMON.md +0 -325
  125. package/documentation/application/COMMUNICATION.md +0 -387
  126. package/documentation/application/CONFIGURATION.md +0 -2212
  127. package/documentation/application/CONTENT.md +0 -2629
  128. package/documentation/application/FILESTORAGE.md +0 -442
  129. package/documentation/application/LEAD.md +0 -1549
  130. package/documentation/application/LOGISTIC.md +0 -689
  131. package/documentation/application/ORDER.md +0 -2937
  132. package/documentation/application/PAYMENT.md +0 -4475
  133. package/documentation/application/POSCART.md +0 -9375
  134. package/documentation/application/README.md +0 -21
  135. package/documentation/application/REWARDS.md +0 -554
  136. package/documentation/application/SHARE.md +0 -635
  137. package/documentation/application/THEME.md +0 -5517
  138. package/documentation/application/USER.md +0 -3798
  139. package/documentation/platform/ANALYTICS.md +0 -1012
  140. package/documentation/platform/AUDITTRAIL.md +0 -493
  141. package/documentation/platform/BILLING.md +0 -1889
  142. package/documentation/platform/CART.md +0 -4711
  143. package/documentation/platform/CATALOG.md +0 -20522
  144. package/documentation/platform/COMMON.md +0 -325
  145. package/documentation/platform/COMMUNICATION.md +0 -4970
  146. package/documentation/platform/COMPANYPROFILE.md +0 -1646
  147. package/documentation/platform/CONFIGURATION.md +0 -6316
  148. package/documentation/platform/CONTENT.md +0 -8364
  149. package/documentation/platform/DISCOUNT.md +0 -767
  150. package/documentation/platform/FILESTORAGE.md +0 -945
  151. package/documentation/platform/INVENTORY.md +0 -1136
  152. package/documentation/platform/LEAD.md +0 -4394
  153. package/documentation/platform/ORDER.md +0 -6525
  154. package/documentation/platform/PARTNER.md +0 -193
  155. package/documentation/platform/PAYMENT.md +0 -3138
  156. package/documentation/platform/README.md +0 -27
  157. package/documentation/platform/REWARDS.md +0 -919
  158. package/documentation/platform/SHARE.md +0 -513
  159. package/documentation/platform/THEME.md +0 -35446
  160. package/documentation/platform/USER.md +0 -2174
  161. package/documentation/platform/WEBHOOK.md +0 -485
  162. package/documentation/public/CONFIGURATION.md +0 -325
  163. package/documentation/public/INVENTORY.md +0 -508
  164. package/documentation/public/WEBHOOK.md +0 -246
  165. package/jest.config.d.ts +0 -4
  166. package/jest.config.js +0 -6
  167. package/tests/application/catalog.spec.js +0 -54
  168. package/tests/common/action-url.spec.js +0 -35
  169. package/tests/common/schema/action-url.json +0 -178
  170. package/tests/common/schema/url-action.json +0 -683
  171. package/tests/common/url-action.spec.js +0 -48
  172. package/tests/helpers/cookie.helper.js +0 -31
  173. package/tests/helpers/oauth.helper.js +0 -43
  174. package/tests/platform/catalog.spec.js +0 -49
  175. package/tests/public/location.spec.js +0 -39
@@ -1,10 +1,11 @@
1
- const APIClient = require("../ApplicationAPIClient");
1
+ const ApplicationAPIClient = require("../ApplicationAPIClient");
2
+ const { FDKClientValidationError } = require("../../common/FDKError");
2
3
  const constructUrl = require("../constructUrl");
3
4
  const Paginator = require("../../common/Paginator");
4
- const { FDKClientValidationError } = require("../../common/FDKError");
5
5
  const ShareValidator = require("./ShareApplicationValidator");
6
6
  const ShareModel = require("./ShareApplicationModel");
7
7
  const { Logger } = require("./../../common/Logger");
8
+ const Joi = require("joi");
8
9
 
9
10
  class Share {
10
11
  constructor(_conf) {
@@ -71,7 +72,7 @@ class Share {
71
72
 
72
73
  const xHeaders = {};
73
74
 
74
- const response = await APIClient.execute(
75
+ const response = await ApplicationAPIClient.execute(
75
76
  this._conf,
76
77
  "post",
77
78
  constructUrl({
@@ -131,7 +132,7 @@ class Share {
131
132
 
132
133
  const xHeaders = {};
133
134
 
134
- const response = await APIClient.execute(
135
+ const response = await ApplicationAPIClient.execute(
135
136
  this._conf,
136
137
  "post",
137
138
  constructUrl({
@@ -195,7 +196,7 @@ class Share {
195
196
 
196
197
  const xHeaders = {};
197
198
 
198
- const response = await APIClient.execute(
199
+ const response = await ApplicationAPIClient.execute(
199
200
  this._conf,
200
201
  "post",
201
202
  constructUrl({
@@ -260,7 +261,7 @@ class Share {
260
261
 
261
262
  const xHeaders = {};
262
263
 
263
- const response = await APIClient.execute(
264
+ const response = await ApplicationAPIClient.execute(
264
265
  this._conf,
265
266
  "get",
266
267
  constructUrl({
@@ -324,7 +325,7 @@ class Share {
324
325
 
325
326
  const xHeaders = {};
326
327
 
327
- const response = await APIClient.execute(
328
+ const response = await ApplicationAPIClient.execute(
328
329
  this._conf,
329
330
  "post",
330
331
  constructUrl({
@@ -386,7 +387,7 @@ class Share {
386
387
 
387
388
  const xHeaders = {};
388
389
 
389
- const response = await APIClient.execute(
390
+ const response = await ApplicationAPIClient.execute(
390
391
  this._conf,
391
392
  "get",
392
393
  constructUrl({
@@ -448,7 +449,7 @@ class Share {
448
449
 
449
450
  const xHeaders = {};
450
451
 
451
- const response = await APIClient.execute(
452
+ const response = await ApplicationAPIClient.execute(
452
453
  this._conf,
453
454
  "post",
454
455
  constructUrl({
@@ -1,10 +1,11 @@
1
- const APIClient = require("../ApplicationAPIClient");
1
+ const ApplicationAPIClient = require("../ApplicationAPIClient");
2
+ const { FDKClientValidationError } = require("../../common/FDKError");
2
3
  const constructUrl = require("../constructUrl");
3
4
  const Paginator = require("../../common/Paginator");
4
- const { FDKClientValidationError } = require("../../common/FDKError");
5
5
  const ThemeValidator = require("./ThemeApplicationValidator");
6
6
  const ThemeModel = require("./ThemeApplicationModel");
7
7
  const { Logger } = require("./../../common/Logger");
8
+ const Joi = require("joi");
8
9
 
9
10
  class Theme {
10
11
  constructor(_conf) {
@@ -64,7 +65,7 @@ class Theme {
64
65
 
65
66
  const xHeaders = {};
66
67
 
67
- const response = await APIClient.execute(
68
+ const response = await ApplicationAPIClient.execute(
68
69
  this._conf,
69
70
  "get",
70
71
  constructUrl({
@@ -126,7 +127,7 @@ class Theme {
126
127
 
127
128
  const xHeaders = {};
128
129
 
129
- const response = await APIClient.execute(
130
+ const response = await ApplicationAPIClient.execute(
130
131
  this._conf,
131
132
  "get",
132
133
  constructUrl({
@@ -188,7 +189,7 @@ class Theme {
188
189
 
189
190
  const xHeaders = {};
190
191
 
191
- const response = await APIClient.execute(
192
+ const response = await ApplicationAPIClient.execute(
192
193
  this._conf,
193
194
  "get",
194
195
  constructUrl({
@@ -251,7 +252,7 @@ class Theme {
251
252
 
252
253
  const xHeaders = {};
253
254
 
254
- const response = await APIClient.execute(
255
+ const response = await ApplicationAPIClient.execute(
255
256
  this._conf,
256
257
  "get",
257
258
  constructUrl({
@@ -1,10 +1,11 @@
1
- const APIClient = require("../ApplicationAPIClient");
1
+ const ApplicationAPIClient = require("../ApplicationAPIClient");
2
+ const { FDKClientValidationError } = require("../../common/FDKError");
2
3
  const constructUrl = require("../constructUrl");
3
4
  const Paginator = require("../../common/Paginator");
4
- const { FDKClientValidationError } = require("../../common/FDKError");
5
5
  const UserValidator = require("./UserApplicationValidator");
6
6
  const UserModel = require("./UserApplicationModel");
7
7
  const { Logger } = require("./../../common/Logger");
8
+ const Joi = require("joi");
8
9
 
9
10
  class User {
10
11
  constructor(_conf) {
@@ -118,7 +119,7 @@ class User {
118
119
 
119
120
  const xHeaders = {};
120
121
 
121
- const response = await APIClient.execute(
122
+ const response = await ApplicationAPIClient.execute(
122
123
  this._conf,
123
124
  "put",
124
125
  constructUrl({
@@ -183,7 +184,7 @@ class User {
183
184
 
184
185
  const xHeaders = {};
185
186
 
186
- const response = await APIClient.execute(
187
+ const response = await ApplicationAPIClient.execute(
187
188
  this._conf,
188
189
  "put",
189
190
  constructUrl({
@@ -260,7 +261,7 @@ class User {
260
261
 
261
262
  const xHeaders = {};
262
263
 
263
- const response = await APIClient.execute(
264
+ const response = await ApplicationAPIClient.execute(
264
265
  this._conf,
265
266
  "delete",
266
267
  constructUrl({
@@ -344,7 +345,7 @@ class User {
344
345
 
345
346
  const xHeaders = {};
346
347
 
347
- const response = await APIClient.execute(
348
+ const response = await ApplicationAPIClient.execute(
348
349
  this._conf,
349
350
  "delete",
350
351
  constructUrl({
@@ -405,7 +406,7 @@ class User {
405
406
 
406
407
  const xHeaders = {};
407
408
 
408
- const response = await APIClient.execute(
409
+ const response = await ApplicationAPIClient.execute(
409
410
  this._conf,
410
411
  "post",
411
412
  constructUrl({
@@ -468,7 +469,7 @@ class User {
468
469
 
469
470
  const xHeaders = {};
470
471
 
471
- const response = await APIClient.execute(
472
+ const response = await ApplicationAPIClient.execute(
472
473
  this._conf,
473
474
  "post",
474
475
  constructUrl({
@@ -530,7 +531,7 @@ class User {
530
531
 
531
532
  const xHeaders = {};
532
533
 
533
- const response = await APIClient.execute(
534
+ const response = await ApplicationAPIClient.execute(
534
535
  this._conf,
535
536
  "get",
536
537
  constructUrl({
@@ -592,7 +593,7 @@ class User {
592
593
 
593
594
  const xHeaders = {};
594
595
 
595
- const response = await APIClient.execute(
596
+ const response = await ApplicationAPIClient.execute(
596
597
  this._conf,
597
598
  "get",
598
599
  constructUrl({
@@ -654,7 +655,7 @@ class User {
654
655
 
655
656
  const xHeaders = {};
656
657
 
657
- const response = await APIClient.execute(
658
+ const response = await ApplicationAPIClient.execute(
658
659
  this._conf,
659
660
  "get",
660
661
  constructUrl({
@@ -714,7 +715,7 @@ class User {
714
715
 
715
716
  const xHeaders = {};
716
717
 
717
- const response = await APIClient.execute(
718
+ const response = await ApplicationAPIClient.execute(
718
719
  this._conf,
719
720
  "get",
720
721
  constructUrl({
@@ -779,7 +780,7 @@ class User {
779
780
 
780
781
  const xHeaders = {};
781
782
 
782
- const response = await APIClient.execute(
783
+ const response = await ApplicationAPIClient.execute(
783
784
  this._conf,
784
785
  "post",
785
786
  constructUrl({
@@ -842,7 +843,7 @@ class User {
842
843
 
843
844
  const xHeaders = {};
844
845
 
845
- const response = await APIClient.execute(
846
+ const response = await ApplicationAPIClient.execute(
846
847
  this._conf,
847
848
  "post",
848
849
  constructUrl({
@@ -905,7 +906,7 @@ class User {
905
906
 
906
907
  const xHeaders = {};
907
908
 
908
- const response = await APIClient.execute(
909
+ const response = await ApplicationAPIClient.execute(
909
910
  this._conf,
910
911
  "post",
911
912
  constructUrl({
@@ -968,7 +969,7 @@ class User {
968
969
 
969
970
  const xHeaders = {};
970
971
 
971
- const response = await APIClient.execute(
972
+ const response = await ApplicationAPIClient.execute(
972
973
  this._conf,
973
974
  "post",
974
975
  constructUrl({
@@ -1031,7 +1032,7 @@ class User {
1031
1032
 
1032
1033
  const xHeaders = {};
1033
1034
 
1034
- const response = await APIClient.execute(
1035
+ const response = await ApplicationAPIClient.execute(
1035
1036
  this._conf,
1036
1037
  "post",
1037
1038
  constructUrl({
@@ -1094,7 +1095,7 @@ class User {
1094
1095
 
1095
1096
  const xHeaders = {};
1096
1097
 
1097
- const response = await APIClient.execute(
1098
+ const response = await ApplicationAPIClient.execute(
1098
1099
  this._conf,
1099
1100
  "post",
1100
1101
  constructUrl({
@@ -1157,7 +1158,7 @@ class User {
1157
1158
 
1158
1159
  const xHeaders = {};
1159
1160
 
1160
- const response = await APIClient.execute(
1161
+ const response = await ApplicationAPIClient.execute(
1161
1162
  this._conf,
1162
1163
  "post",
1163
1164
  constructUrl({
@@ -1218,7 +1219,7 @@ class User {
1218
1219
 
1219
1220
  const xHeaders = {};
1220
1221
 
1221
- const response = await APIClient.execute(
1222
+ const response = await ApplicationAPIClient.execute(
1222
1223
  this._conf,
1223
1224
  "post",
1224
1225
  constructUrl({
@@ -1278,7 +1279,7 @@ class User {
1278
1279
 
1279
1280
  const xHeaders = {};
1280
1281
 
1281
- const response = await APIClient.execute(
1282
+ const response = await ApplicationAPIClient.execute(
1282
1283
  this._conf,
1283
1284
  "get",
1284
1285
  constructUrl({
@@ -1341,7 +1342,7 @@ class User {
1341
1342
 
1342
1343
  const xHeaders = {};
1343
1344
 
1344
- const response = await APIClient.execute(
1345
+ const response = await ApplicationAPIClient.execute(
1345
1346
  this._conf,
1346
1347
  "post",
1347
1348
  constructUrl({
@@ -1406,7 +1407,7 @@ class User {
1406
1407
 
1407
1408
  const xHeaders = {};
1408
1409
 
1409
- const response = await APIClient.execute(
1410
+ const response = await ApplicationAPIClient.execute(
1410
1411
  this._conf,
1411
1412
  "post",
1412
1413
  constructUrl({
@@ -1469,7 +1470,7 @@ class User {
1469
1470
 
1470
1471
  const xHeaders = {};
1471
1472
 
1472
- const response = await APIClient.execute(
1473
+ const response = await ApplicationAPIClient.execute(
1473
1474
  this._conf,
1474
1475
  "post",
1475
1476
  constructUrl({
@@ -1532,7 +1533,7 @@ class User {
1532
1533
 
1533
1534
  const xHeaders = {};
1534
1535
 
1535
- const response = await APIClient.execute(
1536
+ const response = await ApplicationAPIClient.execute(
1536
1537
  this._conf,
1537
1538
  "post",
1538
1539
  constructUrl({
@@ -1599,7 +1600,7 @@ class User {
1599
1600
 
1600
1601
  const xHeaders = {};
1601
1602
 
1602
- const response = await APIClient.execute(
1603
+ const response = await ApplicationAPIClient.execute(
1603
1604
  this._conf,
1604
1605
  "post",
1605
1606
  constructUrl({
@@ -1662,7 +1663,7 @@ class User {
1662
1663
 
1663
1664
  const xHeaders = {};
1664
1665
 
1665
- const response = await APIClient.execute(
1666
+ const response = await ApplicationAPIClient.execute(
1666
1667
  this._conf,
1667
1668
  "post",
1668
1669
  constructUrl({
@@ -1730,7 +1731,7 @@ class User {
1730
1731
 
1731
1732
  const xHeaders = {};
1732
1733
 
1733
- const response = await APIClient.execute(
1734
+ const response = await ApplicationAPIClient.execute(
1734
1735
  this._conf,
1735
1736
  "post",
1736
1737
  constructUrl({
@@ -1799,7 +1800,7 @@ class User {
1799
1800
 
1800
1801
  const xHeaders = {};
1801
1802
 
1802
- const response = await APIClient.execute(
1803
+ const response = await ApplicationAPIClient.execute(
1803
1804
  this._conf,
1804
1805
  "post",
1805
1806
  constructUrl({
@@ -1863,7 +1864,7 @@ class User {
1863
1864
 
1864
1865
  const xHeaders = {};
1865
1866
 
1866
- const response = await APIClient.execute(
1867
+ const response = await ApplicationAPIClient.execute(
1867
1868
  this._conf,
1868
1869
  "post",
1869
1870
  constructUrl({
@@ -1926,7 +1927,7 @@ class User {
1926
1927
 
1927
1928
  const xHeaders = {};
1928
1929
 
1929
- const response = await APIClient.execute(
1930
+ const response = await ApplicationAPIClient.execute(
1930
1931
  this._conf,
1931
1932
  "post",
1932
1933
  constructUrl({
@@ -1987,7 +1988,7 @@ class User {
1987
1988
 
1988
1989
  const xHeaders = {};
1989
1990
 
1990
- const response = await APIClient.execute(
1991
+ const response = await ApplicationAPIClient.execute(
1991
1992
  this._conf,
1992
1993
  "post",
1993
1994
  constructUrl({
@@ -2052,7 +2053,7 @@ class User {
2052
2053
 
2053
2054
  const xHeaders = {};
2054
2055
 
2055
- const response = await APIClient.execute(
2056
+ const response = await ApplicationAPIClient.execute(
2056
2057
  this._conf,
2057
2058
  "post",
2058
2059
  constructUrl({
@@ -2115,7 +2116,7 @@ class User {
2115
2116
 
2116
2117
  const xHeaders = {};
2117
2118
 
2118
- const response = await APIClient.execute(
2119
+ const response = await ApplicationAPIClient.execute(
2119
2120
  this._conf,
2120
2121
  "post",
2121
2122
  constructUrl({
@@ -2180,7 +2181,7 @@ class User {
2180
2181
 
2181
2182
  const xHeaders = {};
2182
2183
 
2183
- const response = await APIClient.execute(
2184
+ const response = await ApplicationAPIClient.execute(
2184
2185
  this._conf,
2185
2186
  "post",
2186
2187
  constructUrl({
@@ -2241,7 +2242,7 @@ class User {
2241
2242
 
2242
2243
  const xHeaders = {};
2243
2244
 
2244
- const response = await APIClient.execute(
2245
+ const response = await ApplicationAPIClient.execute(
2245
2246
  this._conf,
2246
2247
  "post",
2247
2248
  constructUrl({
@@ -2306,7 +2307,7 @@ class User {
2306
2307
 
2307
2308
  const xHeaders = {};
2308
2309
 
2309
- const response = await APIClient.execute(
2310
+ const response = await ApplicationAPIClient.execute(
2310
2311
  this._conf,
2311
2312
  "post",
2312
2313
  constructUrl({
@@ -102,7 +102,11 @@ fdkAxios.interceptors.request.use(
102
102
  }
103
103
  },
104
104
  function (error) {
105
- Logger({ level: "ERROR", message: error });
105
+ Logger({
106
+ level: "ERROR",
107
+ message: error.data || error.message,
108
+ stack: error.data.stack || error.stack,
109
+ });
106
110
  }
107
111
  );
108
112
 
@@ -115,16 +119,19 @@ fdkAxios.interceptors.response.use(
115
119
  Logger({
116
120
  level: "DEBUG",
117
121
  type: "RESPONSE",
118
- message: response.config,
122
+ message: response.data,
119
123
  url: response.config.url,
120
- response: response.data,
121
124
  });
122
125
  return response.data; // IF 2XX then return response.data only
123
126
  },
124
127
  function (error) {
125
128
  if (error.response) {
126
129
  // Request made and server responded
127
- Logger({ level: "ERROR", message: error });
130
+ Logger({
131
+ level: "ERROR",
132
+ message: error.response.data || error.message,
133
+ stack: error.response.data.stack || error.stack,
134
+ });
128
135
  throw new FDKServerResponseError(
129
136
  error.response.data.message || error.message,
130
137
  error.response.data.stack || error.stack,
@@ -134,7 +141,11 @@ fdkAxios.interceptors.response.use(
134
141
  );
135
142
  } else if (error.request) {
136
143
  // The request was made but no error.response was received
137
- Logger({ level: "ERROR", message: error });
144
+ Logger({
145
+ level: "ERROR",
146
+ message: error.data || error.message,
147
+ stack: error.data.stack || error.stack,
148
+ });
138
149
  throw new FDKServerResponseError(
139
150
  error.message,
140
151
  error.stack,
@@ -143,7 +154,7 @@ fdkAxios.interceptors.response.use(
143
154
  );
144
155
  } else {
145
156
  // Something happened in setting up the request that triggered an Error
146
- Logger({ level: "ERROR", message: error });
157
+ Logger({ level: "ERROR", message: error.message });
147
158
  throw new FDKServerResponseError(error.message, error.stack);
148
159
  }
149
160
  }
@@ -0,0 +1,5 @@
1
+ export = constructUrl;
2
+ declare function constructUrl({ url, params }: {
3
+ url: any;
4
+ params: any;
5
+ }): any;
@@ -0,0 +1,13 @@
1
+ const camelCase = require("camelcase");
2
+ const constructUrl = ({ url, params }) => {
3
+ return url
4
+ .split("/")
5
+ .map((word) => {
6
+ if (word[0] === "{" && word[word.length - 1] === "}") {
7
+ word = params[camelCase(word.slice(1, word.length - 1))];
8
+ }
9
+ return word;
10
+ })
11
+ .join("/");
12
+ };
13
+ module.exports = constructUrl;
package/sdk/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ export const Config: typeof import("./Config");
2
+ export const Client: typeof import("./Client");
3
+ export const Model: {};
package/sdk/index.js ADDED
@@ -0,0 +1,5 @@
1
+ module.exports = {
2
+ Config: require("./Config"),
3
+ Client: require("./Client"),
4
+ Model: {},
5
+ };
@@ -1,9 +1,10 @@
1
- const Paginator = require("../../common/Paginator");
2
1
  const PlatformAPIClient = require("../PlatformAPIClient");
3
2
  const { FDKClientValidationError } = require("../../common/FDKError");
3
+ const Paginator = require("../../common/Paginator");
4
4
  const AnalyticsValidator = require("./AnalyticsPlatformApplicationValidator");
5
5
  const AnalyticsModel = require("./AnalyticsPlatformModel");
6
6
  const { Logger } = require("./../../common/Logger");
7
+ const Joi = require("joi");
7
8
 
8
9
  class Analytics {
9
10
  constructor(config, applicationId) {
@@ -553,4 +554,5 @@ class Analytics {
553
554
  return response;
554
555
  }
555
556
  }
557
+
556
558
  module.exports = Analytics;
@@ -1,6 +1,6 @@
1
1
  const Joi = require("joi");
2
- const AnalyticsModel = require("./AnalyticsPlatformModel");
3
2
 
3
+ const AnalyticsModel = require("./AnalyticsPlatformModel");
4
4
  class AnalyticsValidator {
5
5
  static getAbandonCartDetail() {
6
6
  return Joi.object({
@@ -1,9 +1,10 @@
1
- const Paginator = require("../../common/Paginator");
2
- const { FDKClientValidationError } = require("../../common/FDKError");
3
1
  const PlatformAPIClient = require("../PlatformAPIClient");
2
+ const { FDKClientValidationError } = require("../../common/FDKError");
3
+ const Paginator = require("../../common/Paginator");
4
4
  const AnalyticsValidator = require("./AnalyticsPlatformValidator");
5
5
  const AnalyticsModel = require("./AnalyticsPlatformModel");
6
6
  const { Logger } = require("./../../common/Logger");
7
+ const Joi = require("joi");
7
8
 
8
9
  class Analytics {
9
10
  constructor(config) {
@@ -247,7 +248,7 @@ class Analytics {
247
248
  });
248
249
  return data;
249
250
  };
250
- paginator.setCallback(callback);
251
+ paginator.setCallback(callback.bind(this));
251
252
  return paginator;
252
253
  }
253
254
 
@@ -352,7 +353,7 @@ class Analytics {
352
353
  });
353
354
  return data;
354
355
  };
355
- paginator.setCallback(callback);
356
+ paginator.setCallback(callback.bind(this));
356
357
  return paginator;
357
358
  }
358
359
  }
@@ -34,4 +34,5 @@ class AnalyticsValidator {
34
34
  }).required();
35
35
  }
36
36
  }
37
+
37
38
  module.exports = AnalyticsValidator;
@@ -1,9 +1,10 @@
1
- const Paginator = require("../../common/Paginator");
2
- const { FDKClientValidationError } = require("../../common/FDKError");
3
1
  const PlatformAPIClient = require("../PlatformAPIClient");
2
+ const { FDKClientValidationError } = require("../../common/FDKError");
3
+ const Paginator = require("../../common/Paginator");
4
4
  const AuditTrailValidator = require("./AuditTrailPlatformValidator");
5
5
  const AuditTrailModel = require("./AuditTrailPlatformModel");
6
6
  const { Logger } = require("./../../common/Logger");
7
+ const Joi = require("joi");
7
8
 
8
9
  class AuditTrail {
9
10
  constructor(config) {
@@ -24,4 +24,5 @@ class AuditTrailValidator {
24
24
  return Joi.object({}).required();
25
25
  }
26
26
  }
27
+
27
28
  module.exports = AuditTrailValidator;
@@ -1,9 +1,10 @@
1
- const Paginator = require("../../common/Paginator");
2
- const { FDKClientValidationError } = require("../../common/FDKError");
3
1
  const PlatformAPIClient = require("../PlatformAPIClient");
2
+ const { FDKClientValidationError } = require("../../common/FDKError");
3
+ const Paginator = require("../../common/Paginator");
4
4
  const BillingValidator = require("./BillingPlatformValidator");
5
5
  const BillingModel = require("./BillingPlatformModel");
6
6
  const { Logger } = require("./../../common/Logger");
7
+ const Joi = require("joi");
7
8
 
8
9
  class Billing {
9
10
  constructor(config) {
@@ -70,4 +70,5 @@ class BillingValidator {
70
70
  }).required();
71
71
  }
72
72
  }
73
+
73
74
  module.exports = BillingValidator;
@@ -136,6 +136,23 @@ declare class Cart {
136
136
  getCouponById({ id }?: {
137
137
  id: string;
138
138
  }): Promise<CouponUpdate>;
139
+ /**
140
+ * @param {Object} arg - Arg object.
141
+ * @param {string} [arg.code] -
142
+ * @returns {Promise<Object>} - Success response
143
+ * @summary: Check if coupon is already created with coupon code
144
+ * @description: Check if sent coupon code is already existing coupon code. As coupon code is to be unique.
145
+ */
146
+ getCouponCodeExists({ code }?: {
147
+ code?: string;
148
+ }): Promise<any>;
149
+ /**
150
+ * @param {Object} arg - Arg object.
151
+ * @returns {Promise<Object>} - Success response
152
+ * @summary: Get coupon options enums with display values
153
+ * @description: Get coupon enum values for fields in valid coupon object. Used for front end to create, update and filter coupon lists via fields
154
+ */
155
+ getCouponOptionValues({}?: any): Promise<any>;
139
156
  /**
140
157
  * @param {Object} arg - Arg object.
141
158
  * @param {number} [arg.pageNo] -
@@ -195,6 +212,16 @@ declare class Cart {
195
212
  getPromotionById({ id }?: {
196
213
  id: string;
197
214
  }): Promise<PromotionUpdate>;
215
+ /**
216
+ * @param {Object} arg - Arg object.
217
+ * @param {string} [arg.code] -
218
+ * @returns {Promise<Object>} - Success response
219
+ * @summary: Check if promotion is already created with promotion code
220
+ * @description: Check if sent promotion code is already existing promotion code. As promotion code is to be unique.
221
+ */
222
+ getPromotionCodeExists({ code }?: {
223
+ code?: string;
224
+ }): Promise<any>;
198
225
  /**
199
226
  * @param {Object} arg - Arg object.
200
227
  * @param {number} [arg.pageNo] -