@gofynd/fdk-client-javascript 1.0.2 → 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 (346) 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.d.ts +243 -243
  12. package/sdk/application/Cart/CartApplicationClient.js +595 -594
  13. package/sdk/application/Cart/CartApplicationModel.d.ts +64 -63
  14. package/sdk/application/Cart/CartApplicationModel.js +490 -885
  15. package/sdk/application/Cart/CartApplicationValidator.d.ts +17 -17
  16. package/sdk/application/Cart/CartApplicationValidator.js +98 -98
  17. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +358 -358
  18. package/sdk/application/Catalog/CatalogApplicationClient.js +1079 -1078
  19. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +90 -90
  20. package/sdk/application/Catalog/CatalogApplicationModel.js +683 -1249
  21. package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +19 -19
  22. package/sdk/application/Catalog/CatalogApplicationValidator.js +110 -110
  23. package/sdk/application/Common/CommonApplicationClient.d.ts +13 -13
  24. package/sdk/application/Common/CommonApplicationClient.js +43 -42
  25. package/sdk/application/Common/CommonApplicationModel.d.ts +12 -12
  26. package/sdk/application/Common/CommonApplicationModel.js +83 -160
  27. package/sdk/application/Common/CommonApplicationValidator.d.ts +1 -1
  28. package/sdk/application/Common/CommonApplicationValidator.js +6 -6
  29. package/sdk/application/Communication/CommunicationApplicationClient.d.ts +11 -11
  30. package/sdk/application/Communication/CommunicationApplicationClient.js +32 -31
  31. package/sdk/application/Communication/CommunicationApplicationModel.d.ts +6 -6
  32. package/sdk/application/Communication/CommunicationApplicationModel.js +38 -83
  33. package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +1 -1
  34. package/sdk/application/Communication/CommunicationApplicationValidator.js +4 -4
  35. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +116 -116
  36. package/sdk/application/Configuration/ConfigurationApplicationClient.js +350 -349
  37. package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +85 -85
  38. package/sdk/application/Configuration/ConfigurationApplicationModel.js +480 -851
  39. package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +8 -8
  40. package/sdk/application/Configuration/ConfigurationApplicationValidator.js +33 -33
  41. package/sdk/application/Content/ContentApplicationClient.d.ts +67 -67
  42. package/sdk/application/Content/ContentApplicationClient.js +216 -215
  43. package/sdk/application/Content/ContentApplicationModel.d.ts +76 -76
  44. package/sdk/application/Content/ContentApplicationModel.js +468 -884
  45. package/sdk/application/Content/ContentApplicationValidator.d.ts +5 -5
  46. package/sdk/application/Content/ContentApplicationValidator.js +24 -24
  47. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +25 -25
  48. package/sdk/application/FileStorage/FileStorageApplicationClient.js +65 -64
  49. package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +13 -13
  50. package/sdk/application/FileStorage/FileStorageApplicationModel.js +86 -169
  51. package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +1 -1
  52. package/sdk/application/FileStorage/FileStorageApplicationValidator.js +7 -7
  53. package/sdk/application/Lead/LeadApplicationClient.d.ts +24 -24
  54. package/sdk/application/Lead/LeadApplicationClient.js +109 -108
  55. package/sdk/application/Lead/LeadApplicationModel.d.ts +35 -35
  56. package/sdk/application/Lead/LeadApplicationModel.js +267 -474
  57. package/sdk/application/Lead/LeadApplicationValidator.d.ts +2 -2
  58. package/sdk/application/Lead/LeadApplicationValidator.js +11 -11
  59. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +31 -22
  60. package/sdk/application/Logistic/LogisticApplicationClient.js +115 -49
  61. package/sdk/application/Logistic/LogisticApplicationModel.d.ts +17 -14
  62. package/sdk/application/Logistic/LogisticApplicationModel.js +133 -201
  63. package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +3 -2
  64. package/sdk/application/Logistic/LogisticApplicationValidator.js +14 -9
  65. package/sdk/application/Order/OrderApplicationClient.d.ts +85 -85
  66. package/sdk/application/Order/OrderApplicationClient.js +247 -246
  67. package/sdk/application/Order/OrderApplicationModel.d.ts +50 -50
  68. package/sdk/application/Order/OrderApplicationModel.js +361 -656
  69. package/sdk/application/Order/OrderApplicationValidator.d.ts +7 -7
  70. package/sdk/application/Order/OrderApplicationValidator.js +28 -28
  71. package/sdk/application/Payment/PaymentApplicationClient.d.ts +318 -318
  72. package/sdk/application/Payment/PaymentApplicationClient.js +781 -780
  73. package/sdk/application/Payment/PaymentApplicationModel.d.ts +72 -72
  74. package/sdk/application/Payment/PaymentApplicationModel.js +570 -1038
  75. package/sdk/application/Payment/PaymentApplicationValidator.d.ts +28 -28
  76. package/sdk/application/Payment/PaymentApplicationValidator.js +107 -107
  77. package/sdk/application/PosCart/PosCartApplicationClient.d.ts +254 -254
  78. package/sdk/application/PosCart/PosCartApplicationClient.js +646 -645
  79. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +64 -63
  80. package/sdk/application/PosCart/PosCartApplicationModel.js +476 -870
  81. package/sdk/application/PosCart/PosCartApplicationValidator.d.ts +18 -18
  82. package/sdk/application/PosCart/PosCartApplicationValidator.js +103 -103
  83. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +27 -27
  84. package/sdk/application/Rewards/RewardsApplicationClient.js +122 -121
  85. package/sdk/application/Rewards/RewardsApplicationModel.d.ts +14 -14
  86. package/sdk/application/Rewards/RewardsApplicationModel.js +96 -191
  87. package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +3 -3
  88. package/sdk/application/Rewards/RewardsApplicationValidator.js +12 -12
  89. package/sdk/application/Share/ShareApplicationClient.d.ts +37 -37
  90. package/sdk/application/Share/ShareApplicationClient.js +94 -93
  91. package/sdk/application/Share/ShareApplicationModel.d.ts +8 -8
  92. package/sdk/application/Share/ShareApplicationModel.js +63 -123
  93. package/sdk/application/Share/ShareApplicationValidator.d.ts +4 -4
  94. package/sdk/application/Share/ShareApplicationValidator.js +12 -12
  95. package/sdk/application/Theme/ThemeApplicationClient.d.ts +8 -8
  96. package/sdk/application/Theme/ThemeApplicationClient.js +38 -37
  97. package/sdk/application/Theme/ThemeApplicationModel.d.ts +34 -34
  98. package/sdk/application/Theme/ThemeApplicationModel.js +190 -336
  99. package/sdk/application/Theme/ThemeApplicationValidator.d.ts +1 -1
  100. package/sdk/application/Theme/ThemeApplicationValidator.js +4 -4
  101. package/sdk/application/User/UserApplicationClient.d.ts +280 -280
  102. package/sdk/application/User/UserApplicationClient.js +619 -618
  103. package/sdk/application/User/UserApplicationModel.d.ts +79 -72
  104. package/sdk/application/User/UserApplicationModel.js +440 -689
  105. package/sdk/application/User/UserApplicationValidator.d.ts +24 -24
  106. package/sdk/application/User/UserApplicationValidator.js +89 -89
  107. package/sdk/common/AxiosHelper.js +18 -7
  108. package/sdk/constructUrl.d.ts +5 -0
  109. package/sdk/constructUrl.js +13 -0
  110. package/sdk/index.d.ts +3 -0
  111. package/sdk/index.js +5 -0
  112. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +51 -51
  113. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +182 -180
  114. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +6 -6
  115. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +21 -21
  116. package/sdk/platform/Analytics/AnalyticsPlatformClient.js +5 -4
  117. package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +11 -11
  118. package/sdk/platform/Analytics/AnalyticsPlatformModel.js +95 -178
  119. package/sdk/platform/Analytics/AnalyticsPlatformValidator.js +1 -0
  120. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +10 -10
  121. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +44 -43
  122. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +10 -10
  123. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +50 -89
  124. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +1 -1
  125. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +7 -6
  126. package/sdk/platform/Billing/BillingPlatformClient.d.ts +60 -60
  127. package/sdk/platform/Billing/BillingPlatformClient.js +184 -183
  128. package/sdk/platform/Billing/BillingPlatformModel.d.ts +40 -40
  129. package/sdk/platform/Billing/BillingPlatformModel.js +342 -668
  130. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +8 -8
  131. package/sdk/platform/Billing/BillingPlatformValidator.js +26 -25
  132. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +192 -165
  133. package/sdk/platform/Cart/CartPlatformApplicationClient.js +686 -510
  134. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +14 -11
  135. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +77 -61
  136. package/sdk/platform/Cart/CartPlatformModel.d.ts +84 -83
  137. package/sdk/platform/Cart/CartPlatformModel.js +676 -1206
  138. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +632 -632
  139. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1558 -1556
  140. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +40 -40
  141. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +175 -175
  142. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +688 -688
  143. package/sdk/platform/Catalog/CatalogPlatformClient.js +1556 -1559
  144. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +291 -291
  145. package/sdk/platform/Catalog/CatalogPlatformModel.js +2133 -3910
  146. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +66 -66
  147. package/sdk/platform/Catalog/CatalogPlatformValidator.js +229 -228
  148. package/sdk/platform/Common/CommonPlatformClient.d.ts +12 -12
  149. package/sdk/platform/Common/CommonPlatformClient.js +40 -51
  150. package/sdk/platform/Common/CommonPlatformModel.d.ts +12 -12
  151. package/sdk/platform/Common/CommonPlatformModel.js +83 -160
  152. package/sdk/platform/Common/CommonPlatformValidator.d.ts +1 -1
  153. package/sdk/platform/Common/CommonPlatformValidator.js +7 -6
  154. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +326 -326
  155. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +945 -943
  156. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +30 -30
  157. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +88 -88
  158. package/sdk/platform/Communication/CommunicationPlatformClient.js +4 -3
  159. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +67 -67
  160. package/sdk/platform/Communication/CommunicationPlatformModel.js +522 -974
  161. package/sdk/platform/Communication/CommunicationPlatformValidator.js +1 -0
  162. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +55 -55
  163. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +217 -216
  164. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +27 -27
  165. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +279 -542
  166. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +7 -7
  167. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +25 -24
  168. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +163 -153
  169. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +617 -552
  170. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +22 -21
  171. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +70 -64
  172. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +125 -125
  173. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +348 -347
  174. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +148 -146
  175. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +854 -1508
  176. package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +9 -9
  177. package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +39 -38
  178. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +524 -534
  179. package/sdk/platform/Content/ContentPlatformApplicationClient.js +1287 -1346
  180. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +49 -50
  181. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +153 -159
  182. package/sdk/platform/Content/ContentPlatformModel.d.ts +78 -78
  183. package/sdk/platform/Content/ContentPlatformModel.js +485 -907
  184. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +65 -65
  185. package/sdk/platform/Discount/DiscountPlatformClient.js +219 -218
  186. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +7 -7
  187. package/sdk/platform/Discount/DiscountPlatformModel.js +60 -121
  188. package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +6 -6
  189. package/sdk/platform/Discount/DiscountPlatformValidator.js +30 -29
  190. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +25 -25
  191. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +83 -61
  192. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +1 -1
  193. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +9 -9
  194. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +53 -53
  195. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +147 -125
  196. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +13 -13
  197. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +86 -169
  198. package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +3 -3
  199. package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +12 -11
  200. package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +63 -63
  201. package/sdk/platform/Inventory/InventoryPlatformClient.js +231 -230
  202. package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +30 -30
  203. package/sdk/platform/Inventory/InventoryPlatformModel.js +497 -964
  204. package/sdk/platform/Inventory/InventoryPlatformValidator.d.ts +7 -7
  205. package/sdk/platform/Inventory/InventoryPlatformValidator.js +29 -28
  206. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +73 -73
  207. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +203 -201
  208. package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +7 -7
  209. package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +29 -29
  210. package/sdk/platform/Lead/LeadPlatformClient.d.ts +80 -80
  211. package/sdk/platform/Lead/LeadPlatformClient.js +215 -214
  212. package/sdk/platform/Lead/LeadPlatformModel.d.ts +35 -35
  213. package/sdk/platform/Lead/LeadPlatformModel.js +267 -474
  214. package/sdk/platform/Lead/LeadPlatformValidator.d.ts +6 -6
  215. package/sdk/platform/Lead/LeadPlatformValidator.js +25 -24
  216. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +10 -10
  217. package/sdk/platform/Order/OrderPlatformApplicationClient.js +68 -66
  218. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -1
  219. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +7 -7
  220. package/sdk/platform/Order/OrderPlatformClient.d.ts +357 -357
  221. package/sdk/platform/Order/OrderPlatformClient.js +1046 -1033
  222. package/sdk/platform/Order/OrderPlatformModel.d.ts +198 -196
  223. package/sdk/platform/Order/OrderPlatformModel.js +1575 -2861
  224. package/sdk/platform/Order/OrderPlatformValidator.d.ts +32 -32
  225. package/sdk/platform/Order/OrderPlatformValidator.js +161 -160
  226. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +3 -1
  227. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +1 -1
  228. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -1
  229. package/sdk/platform/Partner/PartnerPlatformModel.js +10 -26
  230. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +58 -58
  231. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +178 -178
  232. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +6 -6
  233. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +24 -24
  234. package/sdk/platform/Payment/PaymentPlatformClient.d.ts +42 -42
  235. package/sdk/platform/Payment/PaymentPlatformClient.js +156 -155
  236. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +27 -27
  237. package/sdk/platform/Payment/PaymentPlatformModel.js +222 -410
  238. package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +4 -4
  239. package/sdk/platform/Payment/PaymentPlatformValidator.js +22 -21
  240. package/sdk/platform/PlatformApplicationClient.d.ts +1496 -10325
  241. package/sdk/platform/PlatformApplicationClient.js +1584 -13899
  242. package/sdk/platform/PlatformClient.d.ts +7972 -7888
  243. package/sdk/platform/PlatformClient.js +8678 -10107
  244. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +85 -85
  245. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +299 -280
  246. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +8 -8
  247. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +35 -35
  248. package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +15 -15
  249. package/sdk/platform/Rewards/RewardsPlatformModel.js +92 -194
  250. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +10 -10
  251. package/sdk/platform/Share/SharePlatformApplicationClient.js +62 -60
  252. package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +1 -1
  253. package/sdk/platform/Share/SharePlatformApplicationValidator.js +7 -7
  254. package/sdk/platform/Share/SharePlatformModel.d.ts +8 -8
  255. package/sdk/platform/Share/SharePlatformModel.js +60 -118
  256. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +132 -132
  257. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +314 -312
  258. package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +15 -15
  259. package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +45 -45
  260. package/sdk/platform/Theme/ThemePlatformModel.d.ts +34 -34
  261. package/sdk/platform/Theme/ThemePlatformModel.js +190 -336
  262. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +136 -69
  263. package/sdk/platform/User/UserPlatformApplicationClient.js +507 -166
  264. package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +12 -7
  265. package/sdk/platform/User/UserPlatformApplicationValidator.js +62 -24
  266. package/sdk/platform/User/UserPlatformModel.d.ts +79 -72
  267. package/sdk/platform/User/UserPlatformModel.js +440 -689
  268. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +31 -31
  269. package/sdk/platform/Webhook/WebhookPlatformClient.js +91 -90
  270. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +7 -7
  271. package/sdk/platform/Webhook/WebhookPlatformModel.js +68 -136
  272. package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +3 -3
  273. package/sdk/platform/Webhook/WebhookPlatformValidator.js +15 -14
  274. package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +13 -13
  275. package/sdk/public/Configuration/ConfigurationPublicClient.js +40 -38
  276. package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +12 -12
  277. package/sdk/public/Configuration/ConfigurationPublicModel.js +85 -162
  278. package/sdk/public/Configuration/ConfigurationPublicValidator.d.ts +1 -1
  279. package/sdk/public/Configuration/ConfigurationPublicValidator.js +6 -6
  280. package/sdk/public/Inventory/InventoryPublicClient.d.ts +34 -34
  281. package/sdk/public/Inventory/InventoryPublicClient.js +115 -113
  282. package/sdk/public/Inventory/InventoryPublicModel.d.ts +10 -10
  283. package/sdk/public/Inventory/InventoryPublicModel.js +119 -245
  284. package/sdk/public/Inventory/InventoryPublicValidator.d.ts +3 -3
  285. package/sdk/public/Inventory/InventoryPublicValidator.js +15 -15
  286. package/sdk/public/Webhook/WebhookPublicClient.js +2 -0
  287. package/sdk/public/Webhook/WebhookPublicModel.d.ts +7 -7
  288. package/sdk/public/Webhook/WebhookPublicModel.js +68 -136
  289. package/.github/workflows/on_create_release.yml +0 -23
  290. package/.github/workflows/on_merge_main.yml +0 -38
  291. package/.github/workflows/on_pull_request.yml +0 -35
  292. package/.prettierrc +0 -5
  293. package/documentation/application/CART.md +0 -7339
  294. package/documentation/application/CATALOG.md +0 -9597
  295. package/documentation/application/COMMON.md +0 -452
  296. package/documentation/application/COMMUNICATION.md +0 -467
  297. package/documentation/application/CONFIGURATION.md +0 -2906
  298. package/documentation/application/CONTENT.md +0 -3351
  299. package/documentation/application/FILESTORAGE.md +0 -578
  300. package/documentation/application/LEAD.md +0 -1895
  301. package/documentation/application/LOGISTIC.md +0 -765
  302. package/documentation/application/ORDER.md +0 -3432
  303. package/documentation/application/PAYMENT.md +0 -5221
  304. package/documentation/application/POSCART.md +0 -7938
  305. package/documentation/application/README.md +0 -21
  306. package/documentation/application/REWARDS.md +0 -708
  307. package/documentation/application/SHARE.md +0 -733
  308. package/documentation/application/THEME.md +0 -5800
  309. package/documentation/application/USER.md +0 -4335
  310. package/documentation/platform/ANALYTICS.md +0 -1154
  311. package/documentation/platform/AUDITTRAIL.md +0 -576
  312. package/documentation/platform/BILLING.md +0 -2400
  313. package/documentation/platform/CART.md +0 -5559
  314. package/documentation/platform/CATALOG.md +0 -23261
  315. package/documentation/platform/COMMON.md +0 -452
  316. package/documentation/platform/COMMUNICATION.md +0 -5718
  317. package/documentation/platform/COMPANYPROFILE.md +0 -2031
  318. package/documentation/platform/CONFIGURATION.md +0 -7339
  319. package/documentation/platform/CONTENT.md +0 -9098
  320. package/documentation/platform/DISCOUNT.md +0 -863
  321. package/documentation/platform/FILESTORAGE.md +0 -1081
  322. package/documentation/platform/INVENTORY.md +0 -1779
  323. package/documentation/platform/LEAD.md +0 -4740
  324. package/documentation/platform/ORDER.md +0 -8486
  325. package/documentation/platform/PARTNER.md +0 -220
  326. package/documentation/platform/PAYMENT.md +0 -3448
  327. package/documentation/platform/README.md +0 -27
  328. package/documentation/platform/REWARDS.md +0 -1083
  329. package/documentation/platform/SHARE.md +0 -606
  330. package/documentation/platform/THEME.md +0 -35729
  331. package/documentation/platform/USER.md +0 -2319
  332. package/documentation/platform/WEBHOOK.md +0 -591
  333. package/documentation/public/CONFIGURATION.md +0 -452
  334. package/documentation/public/INVENTORY.md +0 -690
  335. package/documentation/public/WEBHOOK.md +0 -352
  336. package/jest.config.d.ts +0 -4
  337. package/jest.config.js +0 -6
  338. package/tests/application/catalog.spec.js +0 -47
  339. package/tests/common/action-url.spec.js +0 -35
  340. package/tests/common/schema/action-url.json +0 -178
  341. package/tests/common/schema/url-action.json +0 -683
  342. package/tests/common/url-action.spec.js +0 -48
  343. package/tests/helpers/cookie.helper.js +0 -31
  344. package/tests/helpers/oauth.helper.js +0 -43
  345. package/tests/platform/catalog.spec.js +0 -49
  346. package/tests/public/location.spec.js +0 -39
@@ -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) {
@@ -12,17 +13,15 @@ class Billing {
12
13
 
13
14
  /**
14
15
  * @param {Object} arg - Arg object.
15
- * @param {string} arg.plan - ID of the plan.
16
- * @param {string} arg.couponCode - Coupon code.
17
- * @returns {Promise<CheckValidityResponse>} - Success response
18
- * @summary: Check coupon validity
19
- * @description: Check coupon validity.
16
+ * @param {SubscriptionActivateReq} arg.body
17
+ * @returns {Promise<SubscriptionActivateRes>} - Success response
18
+ * @summary: Activate subscription
19
+ * @description: It will activate subscription plan for customer
20
20
  */
21
- async checkCouponValidity({ plan, couponCode } = {}) {
22
- const { error } = BillingValidator.checkCouponValidity().validate(
21
+ async activateSubscriptionPlan({ body } = {}) {
22
+ const { error } = BillingValidator.activateSubscriptionPlan().validate(
23
23
  {
24
- plan,
25
- couponCode,
24
+ body,
26
25
  },
27
26
  { abortEarly: false, allowUnknown: true }
28
27
  );
@@ -31,39 +30,38 @@ class Billing {
31
30
  }
32
31
 
33
32
  // Showing warrnings if extra unknown parameters are found
34
- const { error: warrning } = BillingValidator.checkCouponValidity().validate(
33
+ const {
34
+ error: warrning,
35
+ } = BillingValidator.activateSubscriptionPlan().validate(
35
36
  {
36
- plan,
37
- couponCode,
37
+ body,
38
38
  },
39
39
  { abortEarly: false, allowUnknown: false }
40
40
  );
41
41
  if (warrning) {
42
42
  Logger({
43
43
  level: "WARN",
44
- message: "Parameter Validation warrnings for checkCouponValidity",
44
+ message: "Parameter Validation warrnings for activateSubscriptionPlan",
45
45
  });
46
46
  Logger({ level: "WARN", message: warrning });
47
47
  }
48
48
 
49
49
  const query_params = {};
50
- query_params["plan"] = plan;
51
- query_params["coupon_code"] = couponCode;
52
50
 
53
51
  const xHeaders = {};
54
52
 
55
53
  const response = await PlatformAPIClient.execute(
56
54
  this.config,
57
- "get",
58
- `/service/platform/billing/v1.0/company/${this.config.companyId}/coupon/check-validity`,
55
+ "post",
56
+ `/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/activate`,
59
57
  query_params,
60
- undefined,
58
+ body,
61
59
  xHeaders
62
60
  );
63
61
 
64
62
  const {
65
63
  error: res_error,
66
- } = BillingModel.CheckValidityResponse().validate(response, {
64
+ } = BillingModel.SubscriptionActivateRes().validate(response, {
67
65
  abortEarly: false,
68
66
  allowUnknown: false,
69
67
  });
@@ -71,7 +69,7 @@ class Billing {
71
69
  if (res_error) {
72
70
  Logger({
73
71
  level: "WARN",
74
- message: "Response Validation Warnnings for checkCouponValidity",
72
+ message: "Response Validation Warnnings for activateSubscriptionPlan",
75
73
  });
76
74
  Logger({ level: "WARN", message: res_error });
77
75
  }
@@ -82,16 +80,16 @@ class Billing {
82
80
  /**
83
81
  * @param {Object} arg - Arg object.
84
82
  * @param {string} arg.extensionId - Extension _id
85
- * @param {CreateSubscriptionCharge} arg.body
86
- * @returns {Promise<CreateSubscriptionResponse>} - Success response
87
- * @summary: Create subscription charge
88
- * @description: Register subscription charge for a seller of your extension.
83
+ * @param {string} arg.subscriptionId - Subscription charge _id
84
+ * @returns {Promise<EntitySubscription>} - Success response
85
+ * @summary: Cancel subscription charge
86
+ * @description: Cancel subscription and attached charges.
89
87
  */
90
- async createSubscriptionCharge({ extensionId, body } = {}) {
91
- const { error } = BillingValidator.createSubscriptionCharge().validate(
88
+ async cancelSubscriptionCharge({ extensionId, subscriptionId } = {}) {
89
+ const { error } = BillingValidator.cancelSubscriptionCharge().validate(
92
90
  {
93
91
  extensionId,
94
- body,
92
+ subscriptionId,
95
93
  },
96
94
  { abortEarly: false, allowUnknown: true }
97
95
  );
@@ -102,17 +100,17 @@ class Billing {
102
100
  // Showing warrnings if extra unknown parameters are found
103
101
  const {
104
102
  error: warrning,
105
- } = BillingValidator.createSubscriptionCharge().validate(
103
+ } = BillingValidator.cancelSubscriptionCharge().validate(
106
104
  {
107
105
  extensionId,
108
- body,
106
+ subscriptionId,
109
107
  },
110
108
  { abortEarly: false, allowUnknown: false }
111
109
  );
112
110
  if (warrning) {
113
111
  Logger({
114
112
  level: "WARN",
115
- message: "Parameter Validation warrnings for createSubscriptionCharge",
113
+ message: "Parameter Validation warrnings for cancelSubscriptionCharge",
116
114
  });
117
115
  Logger({ level: "WARN", message: warrning });
118
116
  }
@@ -124,15 +122,15 @@ class Billing {
124
122
  const response = await PlatformAPIClient.execute(
125
123
  this.config,
126
124
  "post",
127
- `/service/platform/billing/v1.0/company/${this.config.companyId}/extension/${extensionId}/subscription`,
125
+ `/service/platform/billing/v1.0/company/${this.config.companyId}/extension/${extensionId}/subscription/${subscriptionId}/cancel`,
128
126
  query_params,
129
- body,
127
+ undefined,
130
128
  xHeaders
131
129
  );
132
130
 
133
131
  const {
134
132
  error: res_error,
135
- } = BillingModel.CreateSubscriptionResponse().validate(response, {
133
+ } = BillingModel.EntitySubscription().validate(response, {
136
134
  abortEarly: false,
137
135
  allowUnknown: false,
138
136
  });
@@ -140,7 +138,7 @@ class Billing {
140
138
  if (res_error) {
141
139
  Logger({
142
140
  level: "WARN",
143
- message: "Response Validation Warnnings for createSubscriptionCharge",
141
+ message: "Response Validation Warnnings for cancelSubscriptionCharge",
144
142
  });
145
143
  Logger({ level: "WARN", message: res_error });
146
144
  }
@@ -150,17 +148,15 @@ class Billing {
150
148
 
151
149
  /**
152
150
  * @param {Object} arg - Arg object.
153
- * @param {string} arg.extensionId - Extension _id
154
- * @param {string} arg.subscriptionId - Subscription charge _id
155
- * @returns {Promise<EntitySubscription>} - Success response
156
- * @summary: Get subscription charge details
157
- * @description: Get created subscription charge details
151
+ * @param {CancelSubscriptionReq} arg.body
152
+ * @returns {Promise<CancelSubscriptionRes>} - Success response
153
+ * @summary: Cancel subscription
154
+ * @description: It will cancel current active subscription.
158
155
  */
159
- async getSubscriptionCharge({ extensionId, subscriptionId } = {}) {
160
- const { error } = BillingValidator.getSubscriptionCharge().validate(
156
+ async cancelSubscriptionPlan({ body } = {}) {
157
+ const { error } = BillingValidator.cancelSubscriptionPlan().validate(
161
158
  {
162
- extensionId,
163
- subscriptionId,
159
+ body,
164
160
  },
165
161
  { abortEarly: false, allowUnknown: true }
166
162
  );
@@ -171,17 +167,16 @@ class Billing {
171
167
  // Showing warrnings if extra unknown parameters are found
172
168
  const {
173
169
  error: warrning,
174
- } = BillingValidator.getSubscriptionCharge().validate(
170
+ } = BillingValidator.cancelSubscriptionPlan().validate(
175
171
  {
176
- extensionId,
177
- subscriptionId,
172
+ body,
178
173
  },
179
174
  { abortEarly: false, allowUnknown: false }
180
175
  );
181
176
  if (warrning) {
182
177
  Logger({
183
178
  level: "WARN",
184
- message: "Parameter Validation warrnings for getSubscriptionCharge",
179
+ message: "Parameter Validation warrnings for cancelSubscriptionPlan",
185
180
  });
186
181
  Logger({ level: "WARN", message: warrning });
187
182
  }
@@ -192,16 +187,16 @@ class Billing {
192
187
 
193
188
  const response = await PlatformAPIClient.execute(
194
189
  this.config,
195
- "get",
196
- `/service/platform/billing/v1.0/company/${this.config.companyId}/extension/${extensionId}/subscription/${subscriptionId}`,
190
+ "post",
191
+ `/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/cancel`,
197
192
  query_params,
198
- undefined,
193
+ body,
199
194
  xHeaders
200
195
  );
201
196
 
202
197
  const {
203
198
  error: res_error,
204
- } = BillingModel.EntitySubscription().validate(response, {
199
+ } = BillingModel.CancelSubscriptionRes().validate(response, {
205
200
  abortEarly: false,
206
201
  allowUnknown: false,
207
202
  });
@@ -209,7 +204,7 @@ class Billing {
209
204
  if (res_error) {
210
205
  Logger({
211
206
  level: "WARN",
212
- message: "Response Validation Warnnings for getSubscriptionCharge",
207
+ message: "Response Validation Warnnings for cancelSubscriptionPlan",
213
208
  });
214
209
  Logger({ level: "WARN", message: res_error });
215
210
  }
@@ -219,17 +214,17 @@ class Billing {
219
214
 
220
215
  /**
221
216
  * @param {Object} arg - Arg object.
222
- * @param {string} arg.extensionId - Extension _id
223
- * @param {string} arg.subscriptionId - Subscription charge _id
224
- * @returns {Promise<EntitySubscription>} - Success response
225
- * @summary: Cancel subscription charge
226
- * @description: Cancel subscription and attached charges.
217
+ * @param {string} arg.plan - ID of the plan.
218
+ * @param {string} arg.couponCode - Coupon code.
219
+ * @returns {Promise<CheckValidityResponse>} - Success response
220
+ * @summary: Check coupon validity
221
+ * @description: Check coupon validity.
227
222
  */
228
- async cancelSubscriptionCharge({ extensionId, subscriptionId } = {}) {
229
- const { error } = BillingValidator.cancelSubscriptionCharge().validate(
223
+ async checkCouponValidity({ plan, couponCode } = {}) {
224
+ const { error } = BillingValidator.checkCouponValidity().validate(
230
225
  {
231
- extensionId,
232
- subscriptionId,
226
+ plan,
227
+ couponCode,
233
228
  },
234
229
  { abortEarly: false, allowUnknown: true }
235
230
  );
@@ -238,31 +233,31 @@ class Billing {
238
233
  }
239
234
 
240
235
  // Showing warrnings if extra unknown parameters are found
241
- const {
242
- error: warrning,
243
- } = BillingValidator.cancelSubscriptionCharge().validate(
236
+ const { error: warrning } = BillingValidator.checkCouponValidity().validate(
244
237
  {
245
- extensionId,
246
- subscriptionId,
238
+ plan,
239
+ couponCode,
247
240
  },
248
241
  { abortEarly: false, allowUnknown: false }
249
242
  );
250
243
  if (warrning) {
251
244
  Logger({
252
245
  level: "WARN",
253
- message: "Parameter Validation warrnings for cancelSubscriptionCharge",
246
+ message: "Parameter Validation warrnings for checkCouponValidity",
254
247
  });
255
248
  Logger({ level: "WARN", message: warrning });
256
249
  }
257
250
 
258
251
  const query_params = {};
252
+ query_params["plan"] = plan;
253
+ query_params["coupon_code"] = couponCode;
259
254
 
260
255
  const xHeaders = {};
261
256
 
262
257
  const response = await PlatformAPIClient.execute(
263
258
  this.config,
264
- "post",
265
- `/service/platform/billing/v1.0/company/${this.config.companyId}/extension/${extensionId}/subscription/${subscriptionId}/cancel`,
259
+ "get",
260
+ `/service/platform/billing/v1.0/company/${this.config.companyId}/coupon/check-validity`,
266
261
  query_params,
267
262
  undefined,
268
263
  xHeaders
@@ -270,7 +265,7 @@ class Billing {
270
265
 
271
266
  const {
272
267
  error: res_error,
273
- } = BillingModel.EntitySubscription().validate(response, {
268
+ } = BillingModel.CheckValidityResponse().validate(response, {
274
269
  abortEarly: false,
275
270
  allowUnknown: false,
276
271
  });
@@ -278,7 +273,7 @@ class Billing {
278
273
  if (res_error) {
279
274
  Logger({
280
275
  level: "WARN",
281
- message: "Response Validation Warnnings for cancelSubscriptionCharge",
276
+ message: "Response Validation Warnnings for checkCouponValidity",
282
277
  });
283
278
  Logger({ level: "WARN", message: res_error });
284
279
  }
@@ -288,13 +283,18 @@ class Billing {
288
283
 
289
284
  /**
290
285
  * @param {Object} arg - Arg object.
291
- * @returns {Promise<Invoices>} - Success response
292
- * @summary: Get invoices
293
- * @description: Get invoices.
286
+ * @param {string} arg.extensionId - Extension _id
287
+ * @param {CreateSubscriptionCharge} arg.body
288
+ * @returns {Promise<CreateSubscriptionResponse>} - Success response
289
+ * @summary: Create subscription charge
290
+ * @description: Register subscription charge for a seller of your extension.
294
291
  */
295
- async getInvoices({} = {}) {
296
- const { error } = BillingValidator.getInvoices().validate(
297
- {},
292
+ async createSubscriptionCharge({ extensionId, body } = {}) {
293
+ const { error } = BillingValidator.createSubscriptionCharge().validate(
294
+ {
295
+ extensionId,
296
+ body,
297
+ },
298
298
  { abortEarly: false, allowUnknown: true }
299
299
  );
300
300
  if (error) {
@@ -302,14 +302,19 @@ class Billing {
302
302
  }
303
303
 
304
304
  // Showing warrnings if extra unknown parameters are found
305
- const { error: warrning } = BillingValidator.getInvoices().validate(
306
- {},
305
+ const {
306
+ error: warrning,
307
+ } = BillingValidator.createSubscriptionCharge().validate(
308
+ {
309
+ extensionId,
310
+ body,
311
+ },
307
312
  { abortEarly: false, allowUnknown: false }
308
313
  );
309
314
  if (warrning) {
310
315
  Logger({
311
316
  level: "WARN",
312
- message: "Parameter Validation warrnings for getInvoices",
317
+ message: "Parameter Validation warrnings for createSubscriptionCharge",
313
318
  });
314
319
  Logger({ level: "WARN", message: warrning });
315
320
  }
@@ -320,14 +325,16 @@ class Billing {
320
325
 
321
326
  const response = await PlatformAPIClient.execute(
322
327
  this.config,
323
- "get",
324
- `/service/platform/billing/v1.0/company/${this.config.companyId}/invoice/list`,
328
+ "post",
329
+ `/service/platform/billing/v1.0/company/${this.config.companyId}/extension/${extensionId}/subscription`,
325
330
  query_params,
326
- undefined,
331
+ body,
327
332
  xHeaders
328
333
  );
329
334
 
330
- const { error: res_error } = BillingModel.Invoices().validate(response, {
335
+ const {
336
+ error: res_error,
337
+ } = BillingModel.CreateSubscriptionResponse().validate(response, {
331
338
  abortEarly: false,
332
339
  allowUnknown: false,
333
340
  });
@@ -335,7 +342,7 @@ class Billing {
335
342
  if (res_error) {
336
343
  Logger({
337
344
  level: "WARN",
338
- message: "Response Validation Warnnings for getInvoices",
345
+ message: "Response Validation Warnnings for createSubscriptionCharge",
339
346
  });
340
347
  Logger({ level: "WARN", message: res_error });
341
348
  }
@@ -345,16 +352,13 @@ class Billing {
345
352
 
346
353
  /**
347
354
  * @param {Object} arg - Arg object.
348
- * @param {string} arg.invoiceId - Invoice id
349
- * @returns {Promise<Invoice>} - Success response
350
- * @summary: Get invoice by id
351
- * @description: Get invoice by id.
355
+ * @returns {Promise<SubscriptionCustomer>} - Success response
356
+ * @summary: Get subscription customer detail
357
+ * @description: Get subscription customer detail.
352
358
  */
353
- async getInvoiceById({ invoiceId } = {}) {
354
- const { error } = BillingValidator.getInvoiceById().validate(
355
- {
356
- invoiceId,
357
- },
359
+ async getCustomerDetail({} = {}) {
360
+ const { error } = BillingValidator.getCustomerDetail().validate(
361
+ {},
358
362
  { abortEarly: false, allowUnknown: true }
359
363
  );
360
364
  if (error) {
@@ -362,16 +366,14 @@ class Billing {
362
366
  }
363
367
 
364
368
  // Showing warrnings if extra unknown parameters are found
365
- const { error: warrning } = BillingValidator.getInvoiceById().validate(
366
- {
367
- invoiceId,
368
- },
369
+ const { error: warrning } = BillingValidator.getCustomerDetail().validate(
370
+ {},
369
371
  { abortEarly: false, allowUnknown: false }
370
372
  );
371
373
  if (warrning) {
372
374
  Logger({
373
375
  level: "WARN",
374
- message: "Parameter Validation warrnings for getInvoiceById",
376
+ message: "Parameter Validation warrnings for getCustomerDetail",
375
377
  });
376
378
  Logger({ level: "WARN", message: warrning });
377
379
  }
@@ -383,13 +385,15 @@ class Billing {
383
385
  const response = await PlatformAPIClient.execute(
384
386
  this.config,
385
387
  "get",
386
- `/service/platform/billing/v1.0/company/${this.config.companyId}/invoice/${invoiceId}`,
388
+ `/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/customer-detail`,
387
389
  query_params,
388
390
  undefined,
389
391
  xHeaders
390
392
  );
391
393
 
392
- const { error: res_error } = BillingModel.Invoice().validate(response, {
394
+ const {
395
+ error: res_error,
396
+ } = BillingModel.SubscriptionCustomer().validate(response, {
393
397
  abortEarly: false,
394
398
  allowUnknown: false,
395
399
  });
@@ -397,7 +401,7 @@ class Billing {
397
401
  if (res_error) {
398
402
  Logger({
399
403
  level: "WARN",
400
- message: "Response Validation Warnnings for getInvoiceById",
404
+ message: "Response Validation Warnnings for getCustomerDetail",
401
405
  });
402
406
  Logger({ level: "WARN", message: res_error });
403
407
  }
@@ -407,12 +411,12 @@ class Billing {
407
411
 
408
412
  /**
409
413
  * @param {Object} arg - Arg object.
410
- * @returns {Promise<SubscriptionCustomer>} - Success response
411
- * @summary: Get subscription customer detail
412
- * @description: Get subscription customer detail.
414
+ * @returns {Promise<SubscriptionLimit>} - Success response
415
+ * @summary: Get subscription subscription limits
416
+ * @description: Get subscription subscription limits.
413
417
  */
414
- async getCustomerDetail({} = {}) {
415
- const { error } = BillingValidator.getCustomerDetail().validate(
418
+ async getFeatureLimitConfig({} = {}) {
419
+ const { error } = BillingValidator.getFeatureLimitConfig().validate(
416
420
  {},
417
421
  { abortEarly: false, allowUnknown: true }
418
422
  );
@@ -421,14 +425,16 @@ class Billing {
421
425
  }
422
426
 
423
427
  // Showing warrnings if extra unknown parameters are found
424
- const { error: warrning } = BillingValidator.getCustomerDetail().validate(
428
+ const {
429
+ error: warrning,
430
+ } = BillingValidator.getFeatureLimitConfig().validate(
425
431
  {},
426
432
  { abortEarly: false, allowUnknown: false }
427
433
  );
428
434
  if (warrning) {
429
435
  Logger({
430
436
  level: "WARN",
431
- message: "Parameter Validation warrnings for getCustomerDetail",
437
+ message: "Parameter Validation warrnings for getFeatureLimitConfig",
432
438
  });
433
439
  Logger({ level: "WARN", message: warrning });
434
440
  }
@@ -440,7 +446,7 @@ class Billing {
440
446
  const response = await PlatformAPIClient.execute(
441
447
  this.config,
442
448
  "get",
443
- `/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/customer-detail`,
449
+ `/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/current-limit`,
444
450
  query_params,
445
451
  undefined,
446
452
  xHeaders
@@ -448,7 +454,7 @@ class Billing {
448
454
 
449
455
  const {
450
456
  error: res_error,
451
- } = BillingModel.SubscriptionCustomer().validate(response, {
457
+ } = BillingModel.SubscriptionLimit().validate(response, {
452
458
  abortEarly: false,
453
459
  allowUnknown: false,
454
460
  });
@@ -456,7 +462,7 @@ class Billing {
456
462
  if (res_error) {
457
463
  Logger({
458
464
  level: "WARN",
459
- message: "Response Validation Warnnings for getCustomerDetail",
465
+ message: "Response Validation Warnnings for getFeatureLimitConfig",
460
466
  });
461
467
  Logger({ level: "WARN", message: res_error });
462
468
  }
@@ -466,15 +472,15 @@ class Billing {
466
472
 
467
473
  /**
468
474
  * @param {Object} arg - Arg object.
469
- * @param {SubscriptionCustomerCreate} arg.body
470
- * @returns {Promise<SubscriptionCustomer>} - Success response
471
- * @summary: Upsert subscription customer detail
472
- * @description: Upsert subscription customer detail.
475
+ * @param {string} arg.invoiceId - Invoice id
476
+ * @returns {Promise<Invoice>} - Success response
477
+ * @summary: Get invoice by id
478
+ * @description: Get invoice by id.
473
479
  */
474
- async upsertCustomerDetail({ body } = {}) {
475
- const { error } = BillingValidator.upsertCustomerDetail().validate(
480
+ async getInvoiceById({ invoiceId } = {}) {
481
+ const { error } = BillingValidator.getInvoiceById().validate(
476
482
  {
477
- body,
483
+ invoiceId,
478
484
  },
479
485
  { abortEarly: false, allowUnknown: true }
480
486
  );
@@ -483,18 +489,16 @@ class Billing {
483
489
  }
484
490
 
485
491
  // Showing warrnings if extra unknown parameters are found
486
- const {
487
- error: warrning,
488
- } = BillingValidator.upsertCustomerDetail().validate(
492
+ const { error: warrning } = BillingValidator.getInvoiceById().validate(
489
493
  {
490
- body,
494
+ invoiceId,
491
495
  },
492
496
  { abortEarly: false, allowUnknown: false }
493
497
  );
494
498
  if (warrning) {
495
499
  Logger({
496
500
  level: "WARN",
497
- message: "Parameter Validation warrnings for upsertCustomerDetail",
501
+ message: "Parameter Validation warrnings for getInvoiceById",
498
502
  });
499
503
  Logger({ level: "WARN", message: warrning });
500
504
  }
@@ -505,16 +509,14 @@ class Billing {
505
509
 
506
510
  const response = await PlatformAPIClient.execute(
507
511
  this.config,
508
- "post",
509
- `/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/customer-detail`,
512
+ "get",
513
+ `/service/platform/billing/v1.0/company/${this.config.companyId}/invoice/${invoiceId}`,
510
514
  query_params,
511
- body,
515
+ undefined,
512
516
  xHeaders
513
517
  );
514
518
 
515
- const {
516
- error: res_error,
517
- } = BillingModel.SubscriptionCustomer().validate(response, {
519
+ const { error: res_error } = BillingModel.Invoice().validate(response, {
518
520
  abortEarly: false,
519
521
  allowUnknown: false,
520
522
  });
@@ -522,7 +524,7 @@ class Billing {
522
524
  if (res_error) {
523
525
  Logger({
524
526
  level: "WARN",
525
- message: "Response Validation Warnnings for upsertCustomerDetail",
527
+ message: "Response Validation Warnnings for getInvoiceById",
526
528
  });
527
529
  Logger({ level: "WARN", message: res_error });
528
530
  }
@@ -532,12 +534,12 @@ class Billing {
532
534
 
533
535
  /**
534
536
  * @param {Object} arg - Arg object.
535
- * @returns {Promise<SubscriptionStatus>} - Success response
536
- * @summary: Get current subscription detail
537
- * @description: If subscription is active then it will return is_enabled true and return subscription object. If subscription is not active then is_enabled false and message.
537
+ * @returns {Promise<Invoices>} - Success response
538
+ * @summary: Get invoices
539
+ * @description: Get invoices.
538
540
  */
539
- async getSubscription({} = {}) {
540
- const { error } = BillingValidator.getSubscription().validate(
541
+ async getInvoices({} = {}) {
542
+ const { error } = BillingValidator.getInvoices().validate(
541
543
  {},
542
544
  { abortEarly: false, allowUnknown: true }
543
545
  );
@@ -546,14 +548,14 @@ class Billing {
546
548
  }
547
549
 
548
550
  // Showing warrnings if extra unknown parameters are found
549
- const { error: warrning } = BillingValidator.getSubscription().validate(
551
+ const { error: warrning } = BillingValidator.getInvoices().validate(
550
552
  {},
551
553
  { abortEarly: false, allowUnknown: false }
552
554
  );
553
555
  if (warrning) {
554
556
  Logger({
555
557
  level: "WARN",
556
- message: "Parameter Validation warrnings for getSubscription",
558
+ message: "Parameter Validation warrnings for getInvoices",
557
559
  });
558
560
  Logger({ level: "WARN", message: warrning });
559
561
  }
@@ -565,15 +567,13 @@ class Billing {
565
567
  const response = await PlatformAPIClient.execute(
566
568
  this.config,
567
569
  "get",
568
- `/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/current`,
570
+ `/service/platform/billing/v1.0/company/${this.config.companyId}/invoice/list`,
569
571
  query_params,
570
572
  undefined,
571
573
  xHeaders
572
574
  );
573
575
 
574
- const {
575
- error: res_error,
576
- } = BillingModel.SubscriptionStatus().validate(response, {
576
+ const { error: res_error } = BillingModel.Invoices().validate(response, {
577
577
  abortEarly: false,
578
578
  allowUnknown: false,
579
579
  });
@@ -581,7 +581,7 @@ class Billing {
581
581
  if (res_error) {
582
582
  Logger({
583
583
  level: "WARN",
584
- message: "Response Validation Warnnings for getSubscription",
584
+ message: "Response Validation Warnnings for getInvoices",
585
585
  });
586
586
  Logger({ level: "WARN", message: res_error });
587
587
  }
@@ -591,12 +591,12 @@ class Billing {
591
591
 
592
592
  /**
593
593
  * @param {Object} arg - Arg object.
594
- * @returns {Promise<SubscriptionLimit>} - Success response
595
- * @summary: Get subscription subscription limits
596
- * @description: Get subscription subscription limits.
594
+ * @returns {Promise<SubscriptionStatus>} - Success response
595
+ * @summary: Get current subscription detail
596
+ * @description: If subscription is active then it will return is_enabled true and return subscription object. If subscription is not active then is_enabled false and message.
597
597
  */
598
- async getFeatureLimitConfig({} = {}) {
599
- const { error } = BillingValidator.getFeatureLimitConfig().validate(
598
+ async getSubscription({} = {}) {
599
+ const { error } = BillingValidator.getSubscription().validate(
600
600
  {},
601
601
  { abortEarly: false, allowUnknown: true }
602
602
  );
@@ -605,16 +605,14 @@ class Billing {
605
605
  }
606
606
 
607
607
  // Showing warrnings if extra unknown parameters are found
608
- const {
609
- error: warrning,
610
- } = BillingValidator.getFeatureLimitConfig().validate(
608
+ const { error: warrning } = BillingValidator.getSubscription().validate(
611
609
  {},
612
610
  { abortEarly: false, allowUnknown: false }
613
611
  );
614
612
  if (warrning) {
615
613
  Logger({
616
614
  level: "WARN",
617
- message: "Parameter Validation warrnings for getFeatureLimitConfig",
615
+ message: "Parameter Validation warrnings for getSubscription",
618
616
  });
619
617
  Logger({ level: "WARN", message: warrning });
620
618
  }
@@ -626,7 +624,7 @@ class Billing {
626
624
  const response = await PlatformAPIClient.execute(
627
625
  this.config,
628
626
  "get",
629
- `/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/current-limit`,
627
+ `/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/current`,
630
628
  query_params,
631
629
  undefined,
632
630
  xHeaders
@@ -634,7 +632,7 @@ class Billing {
634
632
 
635
633
  const {
636
634
  error: res_error,
637
- } = BillingModel.SubscriptionLimit().validate(response, {
635
+ } = BillingModel.SubscriptionStatus().validate(response, {
638
636
  abortEarly: false,
639
637
  allowUnknown: false,
640
638
  });
@@ -642,7 +640,7 @@ class Billing {
642
640
  if (res_error) {
643
641
  Logger({
644
642
  level: "WARN",
645
- message: "Response Validation Warnnings for getFeatureLimitConfig",
643
+ message: "Response Validation Warnnings for getSubscription",
646
644
  });
647
645
  Logger({ level: "WARN", message: res_error });
648
646
  }
@@ -652,15 +650,17 @@ class Billing {
652
650
 
653
651
  /**
654
652
  * @param {Object} arg - Arg object.
655
- * @param {SubscriptionActivateReq} arg.body
656
- * @returns {Promise<SubscriptionActivateRes>} - Success response
657
- * @summary: Activate subscription
658
- * @description: It will activate subscription plan for customer
653
+ * @param {string} arg.extensionId - Extension _id
654
+ * @param {string} arg.subscriptionId - Subscription charge _id
655
+ * @returns {Promise<EntitySubscription>} - Success response
656
+ * @summary: Get subscription charge details
657
+ * @description: Get created subscription charge details
659
658
  */
660
- async activateSubscriptionPlan({ body } = {}) {
661
- const { error } = BillingValidator.activateSubscriptionPlan().validate(
659
+ async getSubscriptionCharge({ extensionId, subscriptionId } = {}) {
660
+ const { error } = BillingValidator.getSubscriptionCharge().validate(
662
661
  {
663
- body,
662
+ extensionId,
663
+ subscriptionId,
664
664
  },
665
665
  { abortEarly: false, allowUnknown: true }
666
666
  );
@@ -671,16 +671,17 @@ class Billing {
671
671
  // Showing warrnings if extra unknown parameters are found
672
672
  const {
673
673
  error: warrning,
674
- } = BillingValidator.activateSubscriptionPlan().validate(
674
+ } = BillingValidator.getSubscriptionCharge().validate(
675
675
  {
676
- body,
676
+ extensionId,
677
+ subscriptionId,
677
678
  },
678
679
  { abortEarly: false, allowUnknown: false }
679
680
  );
680
681
  if (warrning) {
681
682
  Logger({
682
683
  level: "WARN",
683
- message: "Parameter Validation warrnings for activateSubscriptionPlan",
684
+ message: "Parameter Validation warrnings for getSubscriptionCharge",
684
685
  });
685
686
  Logger({ level: "WARN", message: warrning });
686
687
  }
@@ -691,16 +692,16 @@ class Billing {
691
692
 
692
693
  const response = await PlatformAPIClient.execute(
693
694
  this.config,
694
- "post",
695
- `/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/activate`,
695
+ "get",
696
+ `/service/platform/billing/v1.0/company/${this.config.companyId}/extension/${extensionId}/subscription/${subscriptionId}`,
696
697
  query_params,
697
- body,
698
+ undefined,
698
699
  xHeaders
699
700
  );
700
701
 
701
702
  const {
702
703
  error: res_error,
703
- } = BillingModel.SubscriptionActivateRes().validate(response, {
704
+ } = BillingModel.EntitySubscription().validate(response, {
704
705
  abortEarly: false,
705
706
  allowUnknown: false,
706
707
  });
@@ -708,7 +709,7 @@ class Billing {
708
709
  if (res_error) {
709
710
  Logger({
710
711
  level: "WARN",
711
- message: "Response Validation Warnnings for activateSubscriptionPlan",
712
+ message: "Response Validation Warnnings for getSubscriptionCharge",
712
713
  });
713
714
  Logger({ level: "WARN", message: res_error });
714
715
  }
@@ -718,13 +719,13 @@ class Billing {
718
719
 
719
720
  /**
720
721
  * @param {Object} arg - Arg object.
721
- * @param {CancelSubscriptionReq} arg.body
722
- * @returns {Promise<CancelSubscriptionRes>} - Success response
723
- * @summary: Cancel subscription
724
- * @description: It will cancel current active subscription.
722
+ * @param {SubscriptionCustomerCreate} arg.body
723
+ * @returns {Promise<SubscriptionCustomer>} - Success response
724
+ * @summary: Upsert subscription customer detail
725
+ * @description: Upsert subscription customer detail.
725
726
  */
726
- async cancelSubscriptionPlan({ body } = {}) {
727
- const { error } = BillingValidator.cancelSubscriptionPlan().validate(
727
+ async upsertCustomerDetail({ body } = {}) {
728
+ const { error } = BillingValidator.upsertCustomerDetail().validate(
728
729
  {
729
730
  body,
730
731
  },
@@ -737,7 +738,7 @@ class Billing {
737
738
  // Showing warrnings if extra unknown parameters are found
738
739
  const {
739
740
  error: warrning,
740
- } = BillingValidator.cancelSubscriptionPlan().validate(
741
+ } = BillingValidator.upsertCustomerDetail().validate(
741
742
  {
742
743
  body,
743
744
  },
@@ -746,7 +747,7 @@ class Billing {
746
747
  if (warrning) {
747
748
  Logger({
748
749
  level: "WARN",
749
- message: "Parameter Validation warrnings for cancelSubscriptionPlan",
750
+ message: "Parameter Validation warrnings for upsertCustomerDetail",
750
751
  });
751
752
  Logger({ level: "WARN", message: warrning });
752
753
  }
@@ -758,7 +759,7 @@ class Billing {
758
759
  const response = await PlatformAPIClient.execute(
759
760
  this.config,
760
761
  "post",
761
- `/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/cancel`,
762
+ `/service/platform/billing/v1.0/company/${this.config.companyId}/subscription/customer-detail`,
762
763
  query_params,
763
764
  body,
764
765
  xHeaders
@@ -766,7 +767,7 @@ class Billing {
766
767
 
767
768
  const {
768
769
  error: res_error,
769
- } = BillingModel.CancelSubscriptionRes().validate(response, {
770
+ } = BillingModel.SubscriptionCustomer().validate(response, {
770
771
  abortEarly: false,
771
772
  allowUnknown: false,
772
773
  });
@@ -774,7 +775,7 @@ class Billing {
774
775
  if (res_error) {
775
776
  Logger({
776
777
  level: "WARN",
777
- message: "Response Validation Warnnings for cancelSubscriptionPlan",
778
+ message: "Response Validation Warnnings for upsertCustomerDetail",
778
779
  });
779
780
  Logger({ level: "WARN", message: res_error });
780
781
  }