@gofynd/fdk-client-javascript 1.0.3 → 1.1.0

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 (185) hide show
  1. package/README.md +51 -2
  2. package/index.d.ts +7 -4
  3. package/index.js +22 -7
  4. package/package.json +23 -14
  5. package/partner.d.ts +4 -0
  6. package/partner.js +7 -0
  7. package/sdk/application/ApplicationAPIClient.js +2 -4
  8. package/sdk/application/Cart/CartApplicationClient.js +29 -28
  9. package/sdk/application/Cart/CartApplicationModel.js +3 -1
  10. package/sdk/application/Catalog/CatalogApplicationClient.js +43 -42
  11. package/sdk/application/Catalog/CatalogApplicationModel.js +5 -3
  12. package/sdk/application/Common/CommonApplicationClient.js +5 -4
  13. package/sdk/application/Communication/CommunicationApplicationClient.js +6 -5
  14. package/sdk/application/Configuration/ConfigurationApplicationClient.js +21 -20
  15. package/sdk/application/Content/ContentApplicationClient.js +26 -25
  16. package/sdk/application/FileStorage/FileStorageApplicationClient.js +6 -5
  17. package/sdk/application/Lead/LeadApplicationClient.js +10 -9
  18. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +1 -3
  19. package/sdk/application/Logistic/LogisticApplicationClient.js +11 -12
  20. package/sdk/application/Logistic/LogisticApplicationValidator.js +0 -1
  21. package/sdk/application/Order/OrderApplicationClient.js +15 -14
  22. package/sdk/application/Order/OrderApplicationModel.js +9 -0
  23. package/sdk/application/Payment/PaymentApplicationClient.js +42 -41
  24. package/sdk/application/PosCart/PosCartApplicationClient.js +30 -29
  25. package/sdk/application/PosCart/PosCartApplicationModel.js +3 -1
  26. package/sdk/application/Rewards/RewardsApplicationClient.js +11 -10
  27. package/sdk/application/Share/ShareApplicationClient.js +10 -9
  28. package/sdk/application/Theme/ThemeApplicationClient.js +7 -6
  29. package/sdk/application/User/UserApplicationClient.js +38 -37
  30. package/sdk/common/AxiosHelper.js +17 -6
  31. package/sdk/common/BaseOAuthClient.d.ts +17 -0
  32. package/sdk/common/BaseOAuthClient.js +67 -0
  33. package/sdk/common/RequestSigner.js +0 -5
  34. package/sdk/partner/OAuthClient.d.ts +14 -0
  35. package/sdk/partner/OAuthClient.js +112 -0
  36. package/sdk/partner/PartnerAPIClient.d.ts +12 -0
  37. package/sdk/partner/PartnerAPIClient.js +42 -0
  38. package/sdk/partner/PartnerClient.d.ts +6 -0
  39. package/sdk/partner/PartnerClient.js +17 -0
  40. package/sdk/partner/PartnerConfig.d.ts +30 -0
  41. package/sdk/partner/PartnerConfig.js +39 -0
  42. package/sdk/partner/index.d.ts +3 -0
  43. package/sdk/partner/index.js +5 -0
  44. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +3 -1
  45. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +1 -1
  46. package/sdk/platform/Analytics/AnalyticsPlatformClient.js +5 -4
  47. package/sdk/platform/Analytics/AnalyticsPlatformValidator.js +1 -0
  48. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +3 -2
  49. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +1 -0
  50. package/sdk/platform/Billing/BillingPlatformClient.d.ts +24 -0
  51. package/sdk/platform/Billing/BillingPlatformClient.js +137 -2
  52. package/sdk/platform/Billing/BillingPlatformModel.d.ts +4 -0
  53. package/sdk/platform/Billing/BillingPlatformModel.js +44 -0
  54. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +2 -0
  55. package/sdk/platform/Billing/BillingPlatformValidator.js +15 -0
  56. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +27 -0
  57. package/sdk/platform/Cart/CartPlatformApplicationClient.js +177 -1
  58. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +3 -0
  59. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +17 -1
  60. package/sdk/platform/Cart/CartPlatformModel.js +7 -3
  61. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +3 -1
  62. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +1 -1
  63. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +2 -2
  64. package/sdk/platform/Catalog/CatalogPlatformClient.js +6 -9
  65. package/sdk/platform/Catalog/CatalogPlatformModel.js +9 -9
  66. package/sdk/platform/Catalog/CatalogPlatformValidator.js +2 -1
  67. package/sdk/platform/Common/CommonPlatformClient.js +7 -18
  68. package/sdk/platform/Common/CommonPlatformValidator.js +1 -0
  69. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +3 -1
  70. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +1 -1
  71. package/sdk/platform/Communication/CommunicationPlatformClient.js +4 -3
  72. package/sdk/platform/Communication/CommunicationPlatformValidator.js +1 -0
  73. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +5 -4
  74. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +1 -0
  75. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +3 -1
  76. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +1 -1
  77. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +9 -8
  78. package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +1 -0
  79. package/sdk/platform/Content/ContentPlatformApplicationClient.js +3 -1
  80. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +1 -1
  81. package/sdk/platform/Discount/DiscountPlatformClient.js +3 -2
  82. package/sdk/platform/Discount/DiscountPlatformValidator.js +1 -0
  83. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +3 -3
  84. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +27 -5
  85. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +1 -1
  86. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +3 -3
  87. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +28 -6
  88. package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +1 -0
  89. package/sdk/platform/Inventory/InventoryPlatformClient.js +3 -2
  90. package/sdk/platform/Inventory/InventoryPlatformValidator.js +1 -0
  91. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +3 -1
  92. package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +1 -1
  93. package/sdk/platform/Lead/LeadPlatformClient.js +4 -3
  94. package/sdk/platform/Lead/LeadPlatformValidator.js +1 -0
  95. package/sdk/platform/OAuthClient.js +3 -9
  96. package/sdk/platform/Order/OrderPlatformApplicationClient.js +3 -1
  97. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +1 -1
  98. package/sdk/platform/Order/OrderPlatformClient.d.ts +1 -1
  99. package/sdk/platform/Order/OrderPlatformClient.js +16 -3
  100. package/sdk/platform/Order/OrderPlatformModel.js +1 -0
  101. package/sdk/platform/Order/OrderPlatformValidator.js +1 -0
  102. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +3 -1
  103. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +1 -1
  104. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +1 -1
  105. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +14 -14
  106. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +1 -1
  107. package/sdk/platform/Payment/PaymentPlatformClient.js +3 -2
  108. package/sdk/platform/Payment/PaymentPlatformValidator.js +1 -0
  109. package/sdk/platform/PlatformApplicationClient.d.ts +5 -1
  110. package/sdk/platform/PlatformApplicationClient.js +4 -0
  111. package/sdk/platform/PlatformClient.d.ts +51 -12
  112. package/sdk/platform/PlatformClient.js +54 -11
  113. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +17 -19
  114. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +88 -83
  115. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +1 -1
  116. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +8 -9
  117. package/sdk/platform/Share/SharePlatformApplicationClient.js +3 -1
  118. package/sdk/platform/Share/SharePlatformApplicationValidator.js +1 -1
  119. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +3 -1
  120. package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +1 -1
  121. package/sdk/platform/User/UserPlatformApplicationClient.js +3 -1
  122. package/sdk/platform/User/UserPlatformApplicationValidator.js +1 -1
  123. package/sdk/platform/Webhook/WebhookPlatformClient.js +3 -2
  124. package/sdk/platform/Webhook/WebhookPlatformValidator.js +1 -0
  125. package/sdk/public/Configuration/ConfigurationPublicClient.js +2 -0
  126. package/sdk/public/Inventory/InventoryPublicClient.js +2 -0
  127. package/sdk/public/Webhook/WebhookPublicClient.js +2 -0
  128. package/.github/workflows/on_create_release.yml +0 -23
  129. package/.github/workflows/on_merge_main.yml +0 -38
  130. package/.github/workflows/on_pull_request.yml +0 -35
  131. package/.prettierrc +0 -5
  132. package/documentation/application/CART.md +0 -8771
  133. package/documentation/application/CATALOG.md +0 -8690
  134. package/documentation/application/COMMON.md +0 -325
  135. package/documentation/application/COMMUNICATION.md +0 -387
  136. package/documentation/application/CONFIGURATION.md +0 -2212
  137. package/documentation/application/CONTENT.md +0 -2629
  138. package/documentation/application/FILESTORAGE.md +0 -442
  139. package/documentation/application/LEAD.md +0 -1549
  140. package/documentation/application/LOGISTIC.md +0 -689
  141. package/documentation/application/ORDER.md +0 -2937
  142. package/documentation/application/PAYMENT.md +0 -4475
  143. package/documentation/application/POSCART.md +0 -9375
  144. package/documentation/application/README.md +0 -21
  145. package/documentation/application/REWARDS.md +0 -554
  146. package/documentation/application/SHARE.md +0 -635
  147. package/documentation/application/THEME.md +0 -5517
  148. package/documentation/application/USER.md +0 -3798
  149. package/documentation/platform/ANALYTICS.md +0 -1012
  150. package/documentation/platform/AUDITTRAIL.md +0 -493
  151. package/documentation/platform/BILLING.md +0 -1889
  152. package/documentation/platform/CART.md +0 -4711
  153. package/documentation/platform/CATALOG.md +0 -20522
  154. package/documentation/platform/COMMON.md +0 -325
  155. package/documentation/platform/COMMUNICATION.md +0 -4970
  156. package/documentation/platform/COMPANYPROFILE.md +0 -1646
  157. package/documentation/platform/CONFIGURATION.md +0 -6316
  158. package/documentation/platform/CONTENT.md +0 -8364
  159. package/documentation/platform/DISCOUNT.md +0 -767
  160. package/documentation/platform/FILESTORAGE.md +0 -945
  161. package/documentation/platform/INVENTORY.md +0 -1136
  162. package/documentation/platform/LEAD.md +0 -4394
  163. package/documentation/platform/ORDER.md +0 -6525
  164. package/documentation/platform/PARTNER.md +0 -193
  165. package/documentation/platform/PAYMENT.md +0 -3138
  166. package/documentation/platform/README.md +0 -27
  167. package/documentation/platform/REWARDS.md +0 -919
  168. package/documentation/platform/SHARE.md +0 -513
  169. package/documentation/platform/THEME.md +0 -35446
  170. package/documentation/platform/USER.md +0 -2174
  171. package/documentation/platform/WEBHOOK.md +0 -485
  172. package/documentation/public/CONFIGURATION.md +0 -325
  173. package/documentation/public/INVENTORY.md +0 -508
  174. package/documentation/public/WEBHOOK.md +0 -246
  175. package/jest.config.d.ts +0 -4
  176. package/jest.config.js +0 -6
  177. package/tests/application/catalog.spec.js +0 -54
  178. package/tests/common/action-url.spec.js +0 -35
  179. package/tests/common/schema/action-url.json +0 -178
  180. package/tests/common/schema/url-action.json +0 -683
  181. package/tests/common/url-action.spec.js +0 -48
  182. package/tests/helpers/cookie.helper.js +0 -31
  183. package/tests/helpers/oauth.helper.js +0 -43
  184. package/tests/platform/catalog.spec.js +0 -49
  185. 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 PaymentValidator = require("./PaymentApplicationValidator");
6
6
  const PaymentModel = require("./PaymentApplicationModel");
7
7
  const { Logger } = require("./../../common/Logger");
8
+ const Joi = require("joi");
8
9
 
9
10
  class Payment {
10
11
  constructor(_conf) {
@@ -127,7 +128,7 @@ class Payment {
127
128
 
128
129
  const xHeaders = {};
129
130
 
130
- const response = await APIClient.execute(
131
+ const response = await ApplicationAPIClient.execute(
131
132
  this._conf,
132
133
  "post",
133
134
  constructUrl({
@@ -193,7 +194,7 @@ class Payment {
193
194
 
194
195
  const xHeaders = {};
195
196
 
196
- const response = await APIClient.execute(
197
+ const response = await ApplicationAPIClient.execute(
197
198
  this._conf,
198
199
  "post",
199
200
  constructUrl({
@@ -259,7 +260,7 @@ class Payment {
259
260
 
260
261
  const xHeaders = {};
261
262
 
262
- const response = await APIClient.execute(
263
+ const response = await ApplicationAPIClient.execute(
263
264
  this._conf,
264
265
  "post",
265
266
  constructUrl({
@@ -322,7 +323,7 @@ class Payment {
322
323
 
323
324
  const xHeaders = {};
324
325
 
325
- const response = await APIClient.execute(
326
+ const response = await ApplicationAPIClient.execute(
326
327
  this._conf,
327
328
  "post",
328
329
  constructUrl({
@@ -388,7 +389,7 @@ class Payment {
388
389
 
389
390
  const xHeaders = {};
390
391
 
391
- const response = await APIClient.execute(
392
+ const response = await ApplicationAPIClient.execute(
392
393
  this._conf,
393
394
  "post",
394
395
  constructUrl({
@@ -457,7 +458,7 @@ class Payment {
457
458
 
458
459
  const xHeaders = {};
459
460
 
460
- const response = await APIClient.execute(
461
+ const response = await ApplicationAPIClient.execute(
461
462
  this._conf,
462
463
  "post",
463
464
  constructUrl({
@@ -522,7 +523,7 @@ class Payment {
522
523
 
523
524
  const xHeaders = {};
524
525
 
525
- const response = await APIClient.execute(
526
+ const response = await ApplicationAPIClient.execute(
526
527
  this._conf,
527
528
  "get",
528
529
  constructUrl({
@@ -588,7 +589,7 @@ class Payment {
588
589
 
589
590
  const xHeaders = {};
590
591
 
591
- const response = await APIClient.execute(
592
+ const response = await ApplicationAPIClient.execute(
592
593
  this._conf,
593
594
  "post",
594
595
  constructUrl({
@@ -652,7 +653,7 @@ class Payment {
652
653
 
653
654
  const xHeaders = {};
654
655
 
655
- const response = await APIClient.execute(
656
+ const response = await ApplicationAPIClient.execute(
656
657
  this._conf,
657
658
  "post",
658
659
  constructUrl({
@@ -718,7 +719,7 @@ class Payment {
718
719
 
719
720
  const xHeaders = {};
720
721
 
721
- const response = await APIClient.execute(
722
+ const response = await ApplicationAPIClient.execute(
722
723
  this._conf,
723
724
  "get",
724
725
  constructUrl({
@@ -781,7 +782,7 @@ class Payment {
781
782
 
782
783
  const xHeaders = {};
783
784
 
784
- const response = await APIClient.execute(
785
+ const response = await ApplicationAPIClient.execute(
785
786
  this._conf,
786
787
  "post",
787
788
  constructUrl({
@@ -844,7 +845,7 @@ class Payment {
844
845
 
845
846
  const xHeaders = {};
846
847
 
847
- const response = await APIClient.execute(
848
+ const response = await ApplicationAPIClient.execute(
848
849
  this._conf,
849
850
  "post",
850
851
  constructUrl({
@@ -912,7 +913,7 @@ class Payment {
912
913
 
913
914
  const xHeaders = {};
914
915
 
915
- const response = await APIClient.execute(
916
+ const response = await ApplicationAPIClient.execute(
916
917
  this._conf,
917
918
  "put",
918
919
  constructUrl({
@@ -979,7 +980,7 @@ class Payment {
979
980
 
980
981
  const xHeaders = {};
981
982
 
982
- const response = await APIClient.execute(
983
+ const response = await ApplicationAPIClient.execute(
983
984
  this._conf,
984
985
  "get",
985
986
  constructUrl({
@@ -1044,7 +1045,7 @@ class Payment {
1044
1045
 
1045
1046
  const xHeaders = {};
1046
1047
 
1047
- const response = await APIClient.execute(
1048
+ const response = await ApplicationAPIClient.execute(
1048
1049
  this._conf,
1049
1050
  "get",
1050
1051
  constructUrl({
@@ -1109,7 +1110,7 @@ class Payment {
1109
1110
 
1110
1111
  const xHeaders = {};
1111
1112
 
1112
- const response = await APIClient.execute(
1113
+ const response = await ApplicationAPIClient.execute(
1113
1114
  this._conf,
1114
1115
  "get",
1115
1116
  constructUrl({
@@ -1179,7 +1180,7 @@ class Payment {
1179
1180
  const xHeaders = {};
1180
1181
  xHeaders["x-api-token"] = xApiToken;
1181
1182
 
1182
- const response = await APIClient.execute(
1183
+ const response = await ApplicationAPIClient.execute(
1183
1184
  this._conf,
1184
1185
  "get",
1185
1186
  constructUrl({
@@ -1243,7 +1244,7 @@ class Payment {
1243
1244
 
1244
1245
  const xHeaders = {};
1245
1246
 
1246
- const response = await APIClient.execute(
1247
+ const response = await ApplicationAPIClient.execute(
1247
1248
  this._conf,
1248
1249
  "get",
1249
1250
  constructUrl({
@@ -1311,7 +1312,7 @@ class Payment {
1311
1312
 
1312
1313
  const xHeaders = {};
1313
1314
 
1314
- const response = await APIClient.execute(
1315
+ const response = await ApplicationAPIClient.execute(
1315
1316
  this._conf,
1316
1317
  "get",
1317
1318
  constructUrl({
@@ -1376,7 +1377,7 @@ class Payment {
1376
1377
 
1377
1378
  const xHeaders = {};
1378
1379
 
1379
- const response = await APIClient.execute(
1380
+ const response = await ApplicationAPIClient.execute(
1380
1381
  this._conf,
1381
1382
  "get",
1382
1383
  constructUrl({
@@ -1482,7 +1483,7 @@ class Payment {
1482
1483
 
1483
1484
  const xHeaders = {};
1484
1485
 
1485
- const response = await APIClient.execute(
1486
+ const response = await ApplicationAPIClient.execute(
1486
1487
  this._conf,
1487
1488
  "get",
1488
1489
  constructUrl({
@@ -1551,7 +1552,7 @@ class Payment {
1551
1552
 
1552
1553
  const xHeaders = {};
1553
1554
 
1554
- const response = await APIClient.execute(
1555
+ const response = await ApplicationAPIClient.execute(
1555
1556
  this._conf,
1556
1557
  "get",
1557
1558
  constructUrl({
@@ -1665,7 +1666,7 @@ class Payment {
1665
1666
 
1666
1667
  const xHeaders = {};
1667
1668
 
1668
- const response = await APIClient.execute(
1669
+ const response = await ApplicationAPIClient.execute(
1669
1670
  this._conf,
1670
1671
  "get",
1671
1672
  constructUrl({
@@ -1729,7 +1730,7 @@ class Payment {
1729
1730
 
1730
1731
  const xHeaders = {};
1731
1732
 
1732
- const response = await APIClient.execute(
1733
+ const response = await ApplicationAPIClient.execute(
1733
1734
  this._conf,
1734
1735
  "get",
1735
1736
  constructUrl({
@@ -1797,7 +1798,7 @@ class Payment {
1797
1798
 
1798
1799
  const xHeaders = {};
1799
1800
 
1800
- const response = await APIClient.execute(
1801
+ const response = await ApplicationAPIClient.execute(
1801
1802
  this._conf,
1802
1803
  "get",
1803
1804
  constructUrl({
@@ -1860,7 +1861,7 @@ class Payment {
1860
1861
 
1861
1862
  const xHeaders = {};
1862
1863
 
1863
- const response = await APIClient.execute(
1864
+ const response = await ApplicationAPIClient.execute(
1864
1865
  this._conf,
1865
1866
  "post",
1866
1867
  constructUrl({
@@ -1926,7 +1927,7 @@ class Payment {
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({
@@ -1991,7 +1992,7 @@ class Payment {
1991
1992
 
1992
1993
  const xHeaders = {};
1993
1994
 
1994
- const response = await APIClient.execute(
1995
+ const response = await ApplicationAPIClient.execute(
1995
1996
  this._conf,
1996
1997
  "get",
1997
1998
  constructUrl({
@@ -2061,7 +2062,7 @@ class Payment {
2061
2062
 
2062
2063
  const xHeaders = {};
2063
2064
 
2064
- const response = await APIClient.execute(
2065
+ const response = await ApplicationAPIClient.execute(
2065
2066
  this._conf,
2066
2067
  "get",
2067
2068
  constructUrl({
@@ -2124,7 +2125,7 @@ class Payment {
2124
2125
 
2125
2126
  const xHeaders = {};
2126
2127
 
2127
- const response = await APIClient.execute(
2128
+ const response = await ApplicationAPIClient.execute(
2128
2129
  this._conf,
2129
2130
  "post",
2130
2131
  constructUrl({
@@ -2189,7 +2190,7 @@ class Payment {
2189
2190
 
2190
2191
  const xHeaders = {};
2191
2192
 
2192
- const response = await APIClient.execute(
2193
+ const response = await ApplicationAPIClient.execute(
2193
2194
  this._conf,
2194
2195
  "post",
2195
2196
  constructUrl({
@@ -2252,7 +2253,7 @@ class Payment {
2252
2253
 
2253
2254
  const xHeaders = {};
2254
2255
 
2255
- const response = await APIClient.execute(
2256
+ const response = await ApplicationAPIClient.execute(
2256
2257
  this._conf,
2257
2258
  "post",
2258
2259
  constructUrl({
@@ -2317,7 +2318,7 @@ class Payment {
2317
2318
 
2318
2319
  const xHeaders = {};
2319
2320
 
2320
- const response = await APIClient.execute(
2321
+ const response = await ApplicationAPIClient.execute(
2321
2322
  this._conf,
2322
2323
  "post",
2323
2324
  constructUrl({
@@ -2380,7 +2381,7 @@ class Payment {
2380
2381
 
2381
2382
  const xHeaders = {};
2382
2383
 
2383
- const response = await APIClient.execute(
2384
+ const response = await ApplicationAPIClient.execute(
2384
2385
  this._conf,
2385
2386
  "post",
2386
2387
  constructUrl({
@@ -2445,7 +2446,7 @@ class Payment {
2445
2446
 
2446
2447
  const xHeaders = {};
2447
2448
 
2448
- const response = await APIClient.execute(
2449
+ const response = await ApplicationAPIClient.execute(
2449
2450
  this._conf,
2450
2451
  "post",
2451
2452
  constructUrl({
@@ -2510,7 +2511,7 @@ class Payment {
2510
2511
 
2511
2512
  const xHeaders = {};
2512
2513
 
2513
- const response = await APIClient.execute(
2514
+ const response = await ApplicationAPIClient.execute(
2514
2515
  this._conf,
2515
2516
  "post",
2516
2517
  constructUrl({
@@ -2575,7 +2576,7 @@ class Payment {
2575
2576
 
2576
2577
  const xHeaders = {};
2577
2578
 
2578
- const response = await APIClient.execute(
2579
+ const response = await ApplicationAPIClient.execute(
2579
2580
  this._conf,
2580
2581
  "get",
2581
2582
  constructUrl({
@@ -2643,7 +2644,7 @@ class Payment {
2643
2644
 
2644
2645
  const xHeaders = {};
2645
2646
 
2646
- const response = await APIClient.execute(
2647
+ const response = await ApplicationAPIClient.execute(
2647
2648
  this._conf,
2648
2649
  "post",
2649
2650
  constructUrl({
@@ -2712,7 +2713,7 @@ class Payment {
2712
2713
 
2713
2714
  const xHeaders = {};
2714
2715
 
2715
- const response = await APIClient.execute(
2716
+ const response = await ApplicationAPIClient.execute(
2716
2717
  this._conf,
2717
2718
  "post",
2718
2719
  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 PosCartValidator = require("./PosCartApplicationValidator");
6
6
  const PosCartModel = require("./PosCartApplicationModel");
7
7
  const { Logger } = require("./../../common/Logger");
8
+ const Joi = require("joi");
8
9
 
9
10
  class PosCart {
10
11
  constructor(_conf) {
@@ -91,7 +92,7 @@ class PosCart {
91
92
 
92
93
  const xHeaders = {};
93
94
 
94
- const response = await APIClient.execute(
95
+ const response = await ApplicationAPIClient.execute(
95
96
  this._conf,
96
97
  "post",
97
98
  constructUrl({
@@ -162,7 +163,7 @@ class PosCart {
162
163
 
163
164
  const xHeaders = {};
164
165
 
165
- const response = await APIClient.execute(
166
+ const response = await ApplicationAPIClient.execute(
166
167
  this._conf,
167
168
  "post",
168
169
  constructUrl({
@@ -235,7 +236,7 @@ class PosCart {
235
236
 
236
237
  const xHeaders = {};
237
238
 
238
- const response = await APIClient.execute(
239
+ const response = await ApplicationAPIClient.execute(
239
240
  this._conf,
240
241
  "post",
241
242
  constructUrl({
@@ -306,7 +307,7 @@ class PosCart {
306
307
 
307
308
  const xHeaders = {};
308
309
 
309
- const response = await APIClient.execute(
310
+ const response = await ApplicationAPIClient.execute(
310
311
  this._conf,
311
312
  "post",
312
313
  constructUrl({
@@ -371,7 +372,7 @@ class PosCart {
371
372
 
372
373
  const xHeaders = {};
373
374
 
374
- const response = await APIClient.execute(
375
+ const response = await ApplicationAPIClient.execute(
375
376
  this._conf,
376
377
  "post",
377
378
  constructUrl({
@@ -454,7 +455,7 @@ class PosCart {
454
455
 
455
456
  const xHeaders = {};
456
457
 
457
- const response = await APIClient.execute(
458
+ const response = await ApplicationAPIClient.execute(
458
459
  this._conf,
459
460
  "get",
460
461
  constructUrl({
@@ -533,7 +534,7 @@ class PosCart {
533
534
 
534
535
  const xHeaders = {};
535
536
 
536
- const response = await APIClient.execute(
537
+ const response = await ApplicationAPIClient.execute(
537
538
  this._conf,
538
539
  "get",
539
540
  constructUrl({
@@ -601,7 +602,7 @@ class PosCart {
601
602
 
602
603
  const xHeaders = {};
603
604
 
604
- const response = await APIClient.execute(
605
+ const response = await ApplicationAPIClient.execute(
605
606
  this._conf,
606
607
  "get",
607
608
  constructUrl({
@@ -675,7 +676,7 @@ class PosCart {
675
676
 
676
677
  const xHeaders = {};
677
678
 
678
- const response = await APIClient.execute(
679
+ const response = await ApplicationAPIClient.execute(
679
680
  this._conf,
680
681
  "get",
681
682
  constructUrl({
@@ -749,7 +750,7 @@ class PosCart {
749
750
 
750
751
  const xHeaders = {};
751
752
 
752
- const response = await APIClient.execute(
753
+ const response = await ApplicationAPIClient.execute(
753
754
  this._conf,
754
755
  "get",
755
756
  constructUrl({
@@ -813,7 +814,7 @@ class PosCart {
813
814
 
814
815
  const xHeaders = {};
815
816
 
816
- const response = await APIClient.execute(
817
+ const response = await ApplicationAPIClient.execute(
817
818
  this._conf,
818
819
  "head",
819
820
  constructUrl({
@@ -873,7 +874,7 @@ class PosCart {
873
874
 
874
875
  const xHeaders = {};
875
876
 
876
- const response = await APIClient.execute(
877
+ const response = await ApplicationAPIClient.execute(
877
878
  this._conf,
878
879
  "post",
879
880
  constructUrl({
@@ -936,7 +937,7 @@ class PosCart {
936
937
 
937
938
  const xHeaders = {};
938
939
 
939
- const response = await APIClient.execute(
940
+ const response = await ApplicationAPIClient.execute(
940
941
  this._conf,
941
942
  "get",
942
943
  constructUrl({
@@ -1002,7 +1003,7 @@ class PosCart {
1002
1003
 
1003
1004
  const xHeaders = {};
1004
1005
 
1005
- const response = await APIClient.execute(
1006
+ const response = await ApplicationAPIClient.execute(
1006
1007
  this._conf,
1007
1008
  "get",
1008
1009
  constructUrl({
@@ -1068,7 +1069,7 @@ class PosCart {
1068
1069
 
1069
1070
  const xHeaders = {};
1070
1071
 
1071
- const response = await APIClient.execute(
1072
+ const response = await ApplicationAPIClient.execute(
1072
1073
  this._conf,
1073
1074
  "get",
1074
1075
  constructUrl({
@@ -1172,7 +1173,7 @@ class PosCart {
1172
1173
 
1173
1174
  const xHeaders = {};
1174
1175
 
1175
- const response = await APIClient.execute(
1176
+ const response = await ApplicationAPIClient.execute(
1176
1177
  this._conf,
1177
1178
  "get",
1178
1179
  constructUrl({
@@ -1238,7 +1239,7 @@ class PosCart {
1238
1239
 
1239
1240
  const xHeaders = {};
1240
1241
 
1241
- const response = await APIClient.execute(
1242
+ const response = await ApplicationAPIClient.execute(
1242
1243
  this._conf,
1243
1244
  "get",
1244
1245
  constructUrl({
@@ -1301,7 +1302,7 @@ class PosCart {
1301
1302
 
1302
1303
  const xHeaders = {};
1303
1304
 
1304
- const response = await APIClient.execute(
1305
+ const response = await ApplicationAPIClient.execute(
1305
1306
  this._conf,
1306
1307
  "delete",
1307
1308
  constructUrl({
@@ -1367,7 +1368,7 @@ class PosCart {
1367
1368
 
1368
1369
  const xHeaders = {};
1369
1370
 
1370
- const response = await APIClient.execute(
1371
+ const response = await ApplicationAPIClient.execute(
1371
1372
  this._conf,
1372
1373
  "delete",
1373
1374
  constructUrl({
@@ -1438,7 +1439,7 @@ class PosCart {
1438
1439
 
1439
1440
  const xHeaders = {};
1440
1441
 
1441
- const response = await APIClient.execute(
1442
+ const response = await ApplicationAPIClient.execute(
1442
1443
  this._conf,
1443
1444
  "post",
1444
1445
  constructUrl({
@@ -1505,7 +1506,7 @@ class PosCart {
1505
1506
 
1506
1507
  const xHeaders = {};
1507
1508
 
1508
- const response = await APIClient.execute(
1509
+ const response = await ApplicationAPIClient.execute(
1509
1510
  this._conf,
1510
1511
  "put",
1511
1512
  constructUrl({
@@ -1569,7 +1570,7 @@ class PosCart {
1569
1570
 
1570
1571
  const xHeaders = {};
1571
1572
 
1572
- const response = await APIClient.execute(
1573
+ const response = await ApplicationAPIClient.execute(
1573
1574
  this._conf,
1574
1575
  "put",
1575
1576
  constructUrl({
@@ -1642,7 +1643,7 @@ class PosCart {
1642
1643
 
1643
1644
  const xHeaders = {};
1644
1645
 
1645
- const response = await APIClient.execute(
1646
+ const response = await ApplicationAPIClient.execute(
1646
1647
  this._conf,
1647
1648
  "put",
1648
1649
  constructUrl({
@@ -1709,7 +1710,7 @@ class PosCart {
1709
1710
 
1710
1711
  const xHeaders = {};
1711
1712
 
1712
- const response = await APIClient.execute(
1713
+ const response = await ApplicationAPIClient.execute(
1713
1714
  this._conf,
1714
1715
  "put",
1715
1716
  constructUrl({
@@ -1776,7 +1777,7 @@ class PosCart {
1776
1777
 
1777
1778
  const xHeaders = {};
1778
1779
 
1779
- const response = await APIClient.execute(
1780
+ const response = await ApplicationAPIClient.execute(
1780
1781
  this._conf,
1781
1782
  "post",
1782
1783
  constructUrl({
@@ -1853,7 +1854,7 @@ class PosCart {
1853
1854
 
1854
1855
  const xHeaders = {};
1855
1856
 
1856
- const response = await APIClient.execute(
1857
+ const response = await ApplicationAPIClient.execute(
1857
1858
  this._conf,
1858
1859
  "put",
1859
1860
  constructUrl({
@@ -1955,7 +1956,7 @@ class PosCart {
1955
1956
 
1956
1957
  const xHeaders = {};
1957
1958
 
1958
- const response = await APIClient.execute(
1959
+ const response = await ApplicationAPIClient.execute(
1959
1960
  this._conf,
1960
1961
  "get",
1961
1962
  constructUrl({
@@ -28,7 +28,9 @@ class PosCartModel {
28
28
  extra_meta: Joi.any(),
29
29
  item_id: Joi.number(),
30
30
  item_size: Joi.string().allow(""),
31
- parent_item_identifiers: Joi.any(),
31
+ parent_item_identifiers: Joi.array().items(
32
+ Joi.object().pattern(/\S/, Joi.string().allow(""))
33
+ ),
32
34
  pos: Joi.boolean(),
33
35
  product_group_tags: Joi.array().items(Joi.string().allow("").allow(null)),
34
36
  quantity: Joi.number(),
@@ -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 RewardsValidator = require("./RewardsApplicationValidator");
6
6
  const RewardsModel = require("./RewardsApplicationModel");
7
7
  const { Logger } = require("./../../common/Logger");
8
+ const Joi = require("joi");
8
9
 
9
10
  class Rewards {
10
11
  constructor(_conf) {
@@ -72,7 +73,7 @@ class Rewards {
72
73
 
73
74
  const xHeaders = {};
74
75
 
75
- const response = await APIClient.execute(
76
+ const response = await ApplicationAPIClient.execute(
76
77
  this._conf,
77
78
  "post",
78
79
  constructUrl({
@@ -135,7 +136,7 @@ class Rewards {
135
136
 
136
137
  const xHeaders = {};
137
138
 
138
- const response = await APIClient.execute(
139
+ const response = await ApplicationAPIClient.execute(
139
140
  this._conf,
140
141
  "get",
141
142
  constructUrl({
@@ -196,7 +197,7 @@ class Rewards {
196
197
 
197
198
  const xHeaders = {};
198
199
 
199
- const response = await APIClient.execute(
200
+ const response = await ApplicationAPIClient.execute(
200
201
  this._conf,
201
202
  "post",
202
203
  constructUrl({
@@ -258,7 +259,7 @@ class Rewards {
258
259
 
259
260
  const xHeaders = {};
260
261
 
261
- const response = await APIClient.execute(
262
+ const response = await ApplicationAPIClient.execute(
262
263
  this._conf,
263
264
  "get",
264
265
  constructUrl({
@@ -327,7 +328,7 @@ class Rewards {
327
328
 
328
329
  const xHeaders = {};
329
330
 
330
- const response = await APIClient.execute(
331
+ const response = await ApplicationAPIClient.execute(
331
332
  this._conf,
332
333
  "get",
333
334
  constructUrl({
@@ -379,7 +380,7 @@ class Rewards {
379
380
  });
380
381
  return data;
381
382
  };
382
- paginator.setCallback(callback);
383
+ paginator.setCallback(callback.bind(this));
383
384
  return paginator;
384
385
  }
385
386
 
@@ -417,7 +418,7 @@ class Rewards {
417
418
 
418
419
  const xHeaders = {};
419
420
 
420
- const response = await APIClient.execute(
421
+ const response = await ApplicationAPIClient.execute(
421
422
  this._conf,
422
423
  "get",
423
424
  constructUrl({
@@ -480,7 +481,7 @@ class Rewards {
480
481
 
481
482
  const xHeaders = {};
482
483
 
483
- const response = await APIClient.execute(
484
+ const response = await ApplicationAPIClient.execute(
484
485
  this._conf,
485
486
  "post",
486
487
  constructUrl({