@gofynd/fdk-client-javascript 1.4.16-beta.3 → 1.4.16-beta.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 (242) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/sdk/application/ApplicationClient.d.ts +0 -2
  4. package/sdk/application/ApplicationClient.js +0 -2
  5. package/sdk/application/Cart/CartApplicationClient.d.ts +48 -68
  6. package/sdk/application/Cart/CartApplicationClient.js +27 -117
  7. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +58 -59
  8. package/sdk/application/Catalog/CatalogApplicationClient.js +29 -30
  9. package/sdk/application/Common/CommonApplicationClient.d.ts +2 -2
  10. package/sdk/application/Common/CommonApplicationClient.js +1 -1
  11. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +20 -20
  12. package/sdk/application/Configuration/ConfigurationApplicationClient.js +10 -10
  13. package/sdk/application/Content/ContentApplicationClient.d.ts +30 -51
  14. package/sdk/application/Content/ContentApplicationClient.js +56 -161
  15. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +11 -9
  16. package/sdk/application/FileStorage/FileStorageApplicationClient.js +10 -7
  17. package/sdk/application/Lead/LeadApplicationClient.d.ts +2 -2
  18. package/sdk/application/Lead/LeadApplicationClient.js +1 -1
  19. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +15 -35
  20. package/sdk/application/Logistic/LogisticApplicationClient.js +8 -101
  21. package/sdk/application/Order/OrderApplicationClient.d.ts +12 -22
  22. package/sdk/application/Order/OrderApplicationClient.js +8 -56
  23. package/sdk/application/Payment/PaymentApplicationClient.d.ts +87 -87
  24. package/sdk/application/Payment/PaymentApplicationClient.js +46 -46
  25. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +13 -13
  26. package/sdk/application/Rewards/RewardsApplicationClient.js +7 -7
  27. package/sdk/application/Theme/ThemeApplicationClient.d.ts +2 -2
  28. package/sdk/application/Theme/ThemeApplicationClient.js +2 -4
  29. package/sdk/application/User/UserApplicationClient.d.ts +10 -10
  30. package/sdk/application/User/UserApplicationClient.js +6 -6
  31. package/sdk/application/Webhook/WebhookApplicationClient.d.ts +4 -4
  32. package/sdk/application/Webhook/WebhookApplicationClient.js +3 -3
  33. package/sdk/common/Utility.js +6 -3
  34. package/sdk/common/utils.d.ts +0 -1
  35. package/sdk/common/utils.js +0 -14
  36. package/sdk/partner/FileStorage/FileStoragePartnerClient.d.ts +12 -86
  37. package/sdk/partner/FileStorage/FileStoragePartnerClient.js +24 -582
  38. package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +21 -116
  39. package/sdk/partner/FileStorage/FileStoragePartnerModel.js +16 -121
  40. package/sdk/partner/FileStorage/FileStoragePartnerValidator.d.ts +1 -8
  41. package/sdk/partner/FileStorage/FileStoragePartnerValidator.js +4 -51
  42. package/sdk/partner/Lead/LeadPartnerClient.d.ts +2 -2
  43. package/sdk/partner/Lead/LeadPartnerClient.js +2 -2
  44. package/sdk/partner/Lead/LeadPartnerModel.d.ts +5 -5
  45. package/sdk/partner/Lead/LeadPartnerModel.js +15 -15
  46. package/sdk/partner/Logistics/LogisticsPartnerClient.d.ts +20 -126
  47. package/sdk/partner/Logistics/LogisticsPartnerClient.js +20 -970
  48. package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +167 -1200
  49. package/sdk/partner/Logistics/LogisticsPartnerModel.js +160 -571
  50. package/sdk/partner/Logistics/LogisticsPartnerValidator.d.ts +0 -10
  51. package/sdk/partner/Logistics/LogisticsPartnerValidator.js +7 -121
  52. package/sdk/partner/Theme/ThemePartnerClient.d.ts +10 -8
  53. package/sdk/partner/Theme/ThemePartnerClient.js +16 -14
  54. package/sdk/partner/Theme/ThemePartnerModel.d.ts +37 -96
  55. package/sdk/partner/Theme/ThemePartnerModel.js +36 -90
  56. package/sdk/partner/Theme/ThemePartnerValidator.js +4 -4
  57. package/sdk/partner/Webhook/WebhookPartnerClient.d.ts +18 -28
  58. package/sdk/partner/Webhook/WebhookPartnerClient.js +18 -103
  59. package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +179 -612
  60. package/sdk/partner/Webhook/WebhookPartnerModel.js +150 -253
  61. package/sdk/partner/Webhook/WebhookPartnerValidator.d.ts +0 -1
  62. package/sdk/partner/Webhook/WebhookPartnerValidator.js +3 -11
  63. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +4 -5
  64. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +8 -14
  65. package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +9 -59
  66. package/sdk/platform/Analytics/AnalyticsPlatformModel.js +4 -40
  67. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +32 -2
  68. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +243 -3
  69. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +130 -11
  70. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +152 -12
  71. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +39 -1
  72. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +35 -0
  73. package/sdk/platform/Billing/BillingPlatformClient.d.ts +12 -12
  74. package/sdk/platform/Billing/BillingPlatformClient.js +15 -15
  75. package/sdk/platform/Billing/BillingPlatformModel.d.ts +388 -443
  76. package/sdk/platform/Billing/BillingPlatformModel.js +263 -280
  77. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +18 -16
  78. package/sdk/platform/Billing/BillingPlatformValidator.js +9 -8
  79. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +103 -134
  80. package/sdk/platform/Cart/CartPlatformApplicationClient.js +115 -419
  81. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +65 -121
  82. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +44 -109
  83. package/sdk/platform/Cart/CartPlatformModel.d.ts +1294 -5068
  84. package/sdk/platform/Cart/CartPlatformModel.js +1217 -1992
  85. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +183 -209
  86. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +400 -457
  87. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +142 -185
  88. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +78 -96
  89. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +117 -154
  90. package/sdk/platform/Catalog/CatalogPlatformClient.js +172 -292
  91. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +1647 -6389
  92. package/sdk/platform/Catalog/CatalogPlatformModel.js +1681 -3222
  93. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +31 -72
  94. package/sdk/platform/Catalog/CatalogPlatformValidator.js +24 -50
  95. package/sdk/platform/Common/CommonPlatformClient.d.ts +2 -3
  96. package/sdk/platform/Common/CommonPlatformClient.js +2 -3
  97. package/sdk/platform/Common/CommonPlatformModel.d.ts +9 -9
  98. package/sdk/platform/Common/CommonPlatformModel.js +6 -6
  99. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +17 -16
  100. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +17 -16
  101. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +8 -8
  102. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +8 -8
  103. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +33 -43
  104. package/sdk/platform/Communication/CommunicationPlatformModel.js +34 -38
  105. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +42 -46
  106. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +43 -47
  107. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +223 -223
  108. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +212 -210
  109. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +12 -12
  110. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +12 -12
  111. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +33 -46
  112. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +54 -67
  113. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +18 -18
  114. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +18 -18
  115. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +24 -45
  116. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +30 -134
  117. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +131 -283
  118. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +97 -219
  119. package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +9 -37
  120. package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +8 -27
  121. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +141 -204
  122. package/sdk/platform/Content/ContentPlatformApplicationClient.js +475 -1073
  123. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +141 -253
  124. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +130 -256
  125. package/sdk/platform/Content/ContentPlatformClient.d.ts +106 -142
  126. package/sdk/platform/Content/ContentPlatformClient.js +336 -523
  127. package/sdk/platform/Content/ContentPlatformModel.d.ts +403 -1375
  128. package/sdk/platform/Content/ContentPlatformModel.js +394 -631
  129. package/sdk/platform/Content/ContentPlatformValidator.d.ts +117 -168
  130. package/sdk/platform/Content/ContentPlatformValidator.js +108 -162
  131. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +12 -14
  132. package/sdk/platform/Discount/DiscountPlatformClient.js +12 -14
  133. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +13 -13
  134. package/sdk/platform/Discount/DiscountPlatformModel.js +12 -12
  135. package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +2 -2
  136. package/sdk/platform/Discount/DiscountPlatformValidator.js +2 -2
  137. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +39 -95
  138. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +63 -462
  139. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +15 -62
  140. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +13 -75
  141. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +22 -20
  142. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +24 -21
  143. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +116 -370
  144. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +104 -313
  145. package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +6 -6
  146. package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +6 -6
  147. package/sdk/platform/Finance/FinancePlatformClient.d.ts +320 -0
  148. package/sdk/platform/Finance/FinancePlatformClient.js +2333 -0
  149. package/sdk/platform/Finance/FinancePlatformModel.d.ts +2890 -0
  150. package/sdk/platform/Finance/FinancePlatformModel.js +2148 -0
  151. package/sdk/platform/Finance/FinancePlatformValidator.d.ts +284 -0
  152. package/sdk/platform/Finance/FinancePlatformValidator.js +354 -0
  153. package/sdk/platform/Lead/LeadPlatformClient.d.ts +2 -2
  154. package/sdk/platform/Lead/LeadPlatformClient.js +2 -2
  155. package/sdk/platform/Lead/LeadPlatformModel.d.ts +5 -5
  156. package/sdk/platform/Lead/LeadPlatformModel.js +16 -16
  157. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +6 -17
  158. package/sdk/platform/Order/OrderPlatformApplicationClient.js +7 -85
  159. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +24 -95
  160. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +19 -39
  161. package/sdk/platform/Order/OrderPlatformClient.d.ts +96 -153
  162. package/sdk/platform/Order/OrderPlatformClient.js +198 -416
  163. package/sdk/platform/Order/OrderPlatformModel.d.ts +1286 -7619
  164. package/sdk/platform/Order/OrderPlatformModel.js +1265 -3922
  165. package/sdk/platform/Order/OrderPlatformValidator.d.ts +109 -270
  166. package/sdk/platform/Order/OrderPlatformValidator.js +77 -135
  167. package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -6
  168. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +7 -9
  169. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +9 -9
  170. package/sdk/platform/Partner/PartnerPlatformModel.js +8 -8
  171. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +105 -93
  172. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +141 -129
  173. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +48 -48
  174. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +48 -48
  175. package/sdk/platform/Payment/PaymentPlatformClient.d.ts +20 -20
  176. package/sdk/platform/Payment/PaymentPlatformClient.js +20 -20
  177. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +319 -333
  178. package/sdk/platform/Payment/PaymentPlatformModel.js +278 -288
  179. package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +8 -8
  180. package/sdk/platform/Payment/PaymentPlatformValidator.js +8 -8
  181. package/sdk/platform/PlatformClient.d.ts +2 -0
  182. package/sdk/platform/PlatformClient.js +4 -0
  183. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +2 -2
  184. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +2 -2
  185. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +2 -2
  186. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +2 -2
  187. package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +9 -9
  188. package/sdk/platform/Rewards/RewardsPlatformModel.js +8 -8
  189. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +36 -46
  190. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +41 -132
  191. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +17 -46
  192. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +14 -34
  193. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +46 -40
  194. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +68 -62
  195. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +612 -1845
  196. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +554 -886
  197. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +49 -45
  198. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +30 -28
  199. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +5 -5
  200. package/sdk/platform/Share/SharePlatformApplicationClient.js +9 -9
  201. package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +6 -3
  202. package/sdk/platform/Share/SharePlatformApplicationValidator.js +2 -2
  203. package/sdk/platform/Share/SharePlatformModel.d.ts +7 -46
  204. package/sdk/platform/Share/SharePlatformModel.js +6 -31
  205. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +3 -3
  206. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +4 -8
  207. package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +0 -5
  208. package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +0 -2
  209. package/sdk/platform/Theme/ThemePlatformModel.d.ts +11 -37
  210. package/sdk/platform/Theme/ThemePlatformModel.js +15 -33
  211. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +12 -12
  212. package/sdk/platform/User/UserPlatformApplicationClient.js +12 -12
  213. package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +2 -2
  214. package/sdk/platform/User/UserPlatformApplicationValidator.js +2 -2
  215. package/sdk/platform/User/UserPlatformModel.d.ts +21 -21
  216. package/sdk/platform/User/UserPlatformModel.js +23 -23
  217. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +78 -25
  218. package/sdk/platform/Webhook/WebhookPlatformClient.js +470 -75
  219. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +427 -720
  220. package/sdk/platform/Webhook/WebhookPlatformModel.js +386 -410
  221. package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +55 -10
  222. package/sdk/platform/Webhook/WebhookPlatformValidator.js +72 -12
  223. package/sdk/platform/index.d.ts +1 -0
  224. package/sdk/platform/index.js +2 -0
  225. package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +2 -3
  226. package/sdk/public/Configuration/ConfigurationPublicClient.js +5 -6
  227. package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +9 -9
  228. package/sdk/public/Configuration/ConfigurationPublicModel.js +6 -6
  229. package/sdk/public/Content/ContentPublicClient.d.ts +2 -112
  230. package/sdk/public/Content/ContentPublicClient.js +6 -810
  231. package/sdk/public/Content/ContentPublicModel.d.ts +3 -549
  232. package/sdk/public/Content/ContentPublicModel.js +3 -649
  233. package/sdk/public/Content/ContentPublicValidator.d.ts +3 -69
  234. package/sdk/public/Content/ContentPublicValidator.js +2 -88
  235. package/sdk/public/Webhook/WebhookPublicClient.d.ts +8 -8
  236. package/sdk/public/Webhook/WebhookPublicClient.js +8 -8
  237. package/sdk/public/Webhook/WebhookPublicModel.d.ts +21 -21
  238. package/sdk/public/Webhook/WebhookPublicModel.js +15 -15
  239. package/sdk/public/Webhook/WebhookPublicValidator.d.ts +4 -4
  240. package/sdk/public/Webhook/WebhookPublicValidator.js +4 -4
  241. package/sdk/application/Finance/FinanceApplicationClient.d.ts +0 -29
  242. package/sdk/application/Finance/FinanceApplicationClient.js +0 -111
@@ -0,0 +1,2333 @@
1
+ const PlatformAPIClient = require("../PlatformAPIClient");
2
+ const {
3
+ FDKClientValidationError,
4
+ FDKResponseValidationError,
5
+ } = require("../../common/FDKError");
6
+ const Paginator = require("../../common/Paginator");
7
+ const FinancePlatformValidator = require("./FinancePlatformValidator");
8
+ const FinancePlatformModel = require("./FinancePlatformModel");
9
+ const { Logger } = require("./../../common/Logger");
10
+ const Joi = require("joi");
11
+
12
+ class Finance {
13
+ constructor(config) {
14
+ this.config = config;
15
+ }
16
+
17
+ /**
18
+ * @param {FinancePlatformValidator.ChannelDisplayNameParam} arg - Arg object
19
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
20
+ * @param {import("../PlatformAPIClient").Options} - Options
21
+ * @returns {Promise<FinancePlatformModel.ChannelDisplayNameResponse>} -
22
+ * Success response
23
+ * @name channelDisplayName
24
+ * @summary: Get channel display name
25
+ * @description: Retrieve the display name for a channel. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/channelDisplayName/).
26
+ */
27
+ async channelDisplayName(
28
+ { filterKey, requestHeaders } = { requestHeaders: {} },
29
+ { responseHeaders } = { responseHeaders: false }
30
+ ) {
31
+ const { error } = FinancePlatformValidator.channelDisplayName().validate(
32
+ {
33
+ filterKey,
34
+ },
35
+ { abortEarly: false, allowUnknown: true }
36
+ );
37
+ if (error) {
38
+ return Promise.reject(new FDKClientValidationError(error));
39
+ }
40
+
41
+ // Showing warrnings if extra unknown parameters are found
42
+ const {
43
+ error: warrning,
44
+ } = FinancePlatformValidator.channelDisplayName().validate(
45
+ {
46
+ filterKey,
47
+ },
48
+ { abortEarly: false, allowUnknown: false }
49
+ );
50
+ if (warrning) {
51
+ Logger({
52
+ level: "WARN",
53
+ message: `Parameter Validation warrnings for platform > Finance > channelDisplayName \n ${warrning}`,
54
+ });
55
+ }
56
+
57
+ const query_params = {};
58
+ query_params["filter_key"] = filterKey;
59
+
60
+ const xHeaders = {};
61
+
62
+ const response = await PlatformAPIClient.execute(
63
+ this.config,
64
+ "get",
65
+ `/service/platform/finance/v1.0/company/${this.config.companyId}/channel-display-names`,
66
+ query_params,
67
+ undefined,
68
+ { ...xHeaders, ...requestHeaders },
69
+ { responseHeaders }
70
+ );
71
+
72
+ let responseData = response;
73
+ if (responseHeaders) {
74
+ responseData = response[0];
75
+ }
76
+
77
+ const {
78
+ error: res_error,
79
+ } = FinancePlatformModel.ChannelDisplayNameResponse().validate(
80
+ responseData,
81
+ { abortEarly: false, allowUnknown: true }
82
+ );
83
+
84
+ if (res_error) {
85
+ if (this.config.options.strictResponseCheck === true) {
86
+ return Promise.reject(new FDKResponseValidationError(res_error));
87
+ } else {
88
+ Logger({
89
+ level: "WARN",
90
+ message: `Response Validation Warnings for platform > Finance > channelDisplayName \n ${res_error}`,
91
+ });
92
+ }
93
+ }
94
+
95
+ return response;
96
+ }
97
+
98
+ /**
99
+ * @param {FinancePlatformValidator.CreateSellerCreditNoteConfigParam} arg
100
+ * - Arg object
101
+ *
102
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
103
+ * @param {import("../PlatformAPIClient").Options} - Options
104
+ * @returns {Promise<FinancePlatformModel.CreateSellerCreditNoteConfigResponse>}
105
+ * - Success response
106
+ *
107
+ * @name createSellerCreditNoteConfig
108
+ * @summary: Create seller credit note config
109
+ * @description: Set up configuration for seller credit notes. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/createSellerCreditNoteConfig/).
110
+ */
111
+ async createSellerCreditNoteConfig(
112
+ { body, requestHeaders } = { requestHeaders: {} },
113
+ { responseHeaders } = { responseHeaders: false }
114
+ ) {
115
+ const {
116
+ error,
117
+ } = FinancePlatformValidator.createSellerCreditNoteConfig().validate(
118
+ {
119
+ body,
120
+ },
121
+ { abortEarly: false, allowUnknown: true }
122
+ );
123
+ if (error) {
124
+ return Promise.reject(new FDKClientValidationError(error));
125
+ }
126
+
127
+ // Showing warrnings if extra unknown parameters are found
128
+ const {
129
+ error: warrning,
130
+ } = FinancePlatformValidator.createSellerCreditNoteConfig().validate(
131
+ {
132
+ body,
133
+ },
134
+ { abortEarly: false, allowUnknown: false }
135
+ );
136
+ if (warrning) {
137
+ Logger({
138
+ level: "WARN",
139
+ message: `Parameter Validation warrnings for platform > Finance > createSellerCreditNoteConfig \n ${warrning}`,
140
+ });
141
+ }
142
+
143
+ const query_params = {};
144
+
145
+ const xHeaders = {};
146
+
147
+ const response = await PlatformAPIClient.execute(
148
+ this.config,
149
+ "post",
150
+ `/service/platform/finance/v1.0/company/${this.config.companyId}/create-update-credit-note-config`,
151
+ query_params,
152
+ body,
153
+ { ...xHeaders, ...requestHeaders },
154
+ { responseHeaders }
155
+ );
156
+
157
+ let responseData = response;
158
+ if (responseHeaders) {
159
+ responseData = response[0];
160
+ }
161
+
162
+ const {
163
+ error: res_error,
164
+ } = FinancePlatformModel.CreateSellerCreditNoteConfigResponse().validate(
165
+ responseData,
166
+ { abortEarly: false, allowUnknown: true }
167
+ );
168
+
169
+ if (res_error) {
170
+ if (this.config.options.strictResponseCheck === true) {
171
+ return Promise.reject(new FDKResponseValidationError(res_error));
172
+ } else {
173
+ Logger({
174
+ level: "WARN",
175
+ message: `Response Validation Warnings for platform > Finance > createSellerCreditNoteConfig \n ${res_error}`,
176
+ });
177
+ }
178
+ }
179
+
180
+ return response;
181
+ }
182
+
183
+ /**
184
+ * @param {FinancePlatformValidator.CreditNoteDetailsParam} arg - Arg object
185
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
186
+ * @param {import("../PlatformAPIClient").Options} - Options
187
+ * @returns {Promise<FinancePlatformModel.CreditNoteDetailsResponse>} -
188
+ * Success response
189
+ * @name creditNoteDetails
190
+ * @summary: Get credit note details
191
+ * @description: Retrieve detailed information about a credit note. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/creditNoteDetails/).
192
+ */
193
+ async creditNoteDetails(
194
+ { body, requestHeaders } = { requestHeaders: {} },
195
+ { responseHeaders } = { responseHeaders: false }
196
+ ) {
197
+ const { error } = FinancePlatformValidator.creditNoteDetails().validate(
198
+ {
199
+ body,
200
+ },
201
+ { abortEarly: false, allowUnknown: true }
202
+ );
203
+ if (error) {
204
+ return Promise.reject(new FDKClientValidationError(error));
205
+ }
206
+
207
+ // Showing warrnings if extra unknown parameters are found
208
+ const {
209
+ error: warrning,
210
+ } = FinancePlatformValidator.creditNoteDetails().validate(
211
+ {
212
+ body,
213
+ },
214
+ { abortEarly: false, allowUnknown: false }
215
+ );
216
+ if (warrning) {
217
+ Logger({
218
+ level: "WARN",
219
+ message: `Parameter Validation warrnings for platform > Finance > creditNoteDetails \n ${warrning}`,
220
+ });
221
+ }
222
+
223
+ const query_params = {};
224
+
225
+ const xHeaders = {};
226
+
227
+ const response = await PlatformAPIClient.execute(
228
+ this.config,
229
+ "post",
230
+ `/service/platform/finance/v1.0/company/${this.config.companyId}/credit-note-details`,
231
+ query_params,
232
+ body,
233
+ { ...xHeaders, ...requestHeaders },
234
+ { responseHeaders }
235
+ );
236
+
237
+ let responseData = response;
238
+ if (responseHeaders) {
239
+ responseData = response[0];
240
+ }
241
+
242
+ const {
243
+ error: res_error,
244
+ } = FinancePlatformModel.CreditNoteDetailsResponse().validate(
245
+ responseData,
246
+ { abortEarly: false, allowUnknown: true }
247
+ );
248
+
249
+ if (res_error) {
250
+ if (this.config.options.strictResponseCheck === true) {
251
+ return Promise.reject(new FDKResponseValidationError(res_error));
252
+ } else {
253
+ Logger({
254
+ level: "WARN",
255
+ message: `Response Validation Warnings for platform > Finance > creditNoteDetails \n ${res_error}`,
256
+ });
257
+ }
258
+ }
259
+
260
+ return response;
261
+ }
262
+
263
+ /**
264
+ * @param {FinancePlatformValidator.CreditlineDataplatformParam} arg - Arg object
265
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
266
+ * @param {import("../PlatformAPIClient").Options} - Options
267
+ * @returns {Promise<FinancePlatformModel.CreditlineDataPlatformResponse>}
268
+ * - Success response
269
+ *
270
+ * @name creditlineDataplatform
271
+ * @summary: Access credit line data platform
272
+ * @description: Connect to the credit line data platform. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/creditlineDataplatform/).
273
+ */
274
+ async creditlineDataplatform(
275
+ { body, requestHeaders } = { requestHeaders: {} },
276
+ { responseHeaders } = { responseHeaders: false }
277
+ ) {
278
+ const {
279
+ error,
280
+ } = FinancePlatformValidator.creditlineDataplatform().validate(
281
+ {
282
+ body,
283
+ },
284
+ { abortEarly: false, allowUnknown: true }
285
+ );
286
+ if (error) {
287
+ return Promise.reject(new FDKClientValidationError(error));
288
+ }
289
+
290
+ // Showing warrnings if extra unknown parameters are found
291
+ const {
292
+ error: warrning,
293
+ } = FinancePlatformValidator.creditlineDataplatform().validate(
294
+ {
295
+ body,
296
+ },
297
+ { abortEarly: false, allowUnknown: false }
298
+ );
299
+ if (warrning) {
300
+ Logger({
301
+ level: "WARN",
302
+ message: `Parameter Validation warrnings for platform > Finance > creditlineDataplatform \n ${warrning}`,
303
+ });
304
+ }
305
+
306
+ const query_params = {};
307
+
308
+ const xHeaders = {};
309
+
310
+ const response = await PlatformAPIClient.execute(
311
+ this.config,
312
+ "post",
313
+ `/service/platform/finance/v1.0/company/${this.config.companyId}/credit-line-data`,
314
+ query_params,
315
+ body,
316
+ { ...xHeaders, ...requestHeaders },
317
+ { responseHeaders }
318
+ );
319
+
320
+ let responseData = response;
321
+ if (responseHeaders) {
322
+ responseData = response[0];
323
+ }
324
+
325
+ const {
326
+ error: res_error,
327
+ } = FinancePlatformModel.CreditlineDataPlatformResponse().validate(
328
+ responseData,
329
+ { abortEarly: false, allowUnknown: true }
330
+ );
331
+
332
+ if (res_error) {
333
+ if (this.config.options.strictResponseCheck === true) {
334
+ return Promise.reject(new FDKResponseValidationError(res_error));
335
+ } else {
336
+ Logger({
337
+ level: "WARN",
338
+ message: `Response Validation Warnings for platform > Finance > creditlineDataplatform \n ${res_error}`,
339
+ });
340
+ }
341
+ }
342
+
343
+ return response;
344
+ }
345
+
346
+ /**
347
+ * @param {FinancePlatformValidator.DeleteConfigParam} arg - Arg object
348
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
349
+ * @param {import("../PlatformAPIClient").Options} - Options
350
+ * @returns {Promise<FinancePlatformModel.DeleteConfigResponse>} - Success response
351
+ * @name deleteConfig
352
+ * @summary: Deletes credit note config
353
+ * @description: Deletes credit note config. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/deleteConfig/).
354
+ */
355
+ async deleteConfig(
356
+ { body, requestHeaders } = { requestHeaders: {} },
357
+ { responseHeaders } = { responseHeaders: false }
358
+ ) {
359
+ const { error } = FinancePlatformValidator.deleteConfig().validate(
360
+ {
361
+ body,
362
+ },
363
+ { abortEarly: false, allowUnknown: true }
364
+ );
365
+ if (error) {
366
+ return Promise.reject(new FDKClientValidationError(error));
367
+ }
368
+
369
+ // Showing warrnings if extra unknown parameters are found
370
+ const {
371
+ error: warrning,
372
+ } = FinancePlatformValidator.deleteConfig().validate(
373
+ {
374
+ body,
375
+ },
376
+ { abortEarly: false, allowUnknown: false }
377
+ );
378
+ if (warrning) {
379
+ Logger({
380
+ level: "WARN",
381
+ message: `Parameter Validation warrnings for platform > Finance > deleteConfig \n ${warrning}`,
382
+ });
383
+ }
384
+
385
+ const query_params = {};
386
+
387
+ const xHeaders = {};
388
+
389
+ const response = await PlatformAPIClient.execute(
390
+ this.config,
391
+ "post",
392
+ `/service/platform/finance/v1.0/company/${this.config.companyId}/delete-seller-config`,
393
+ query_params,
394
+ body,
395
+ { ...xHeaders, ...requestHeaders },
396
+ { responseHeaders }
397
+ );
398
+
399
+ let responseData = response;
400
+ if (responseHeaders) {
401
+ responseData = response[0];
402
+ }
403
+
404
+ const {
405
+ error: res_error,
406
+ } = FinancePlatformModel.DeleteConfigResponse().validate(responseData, {
407
+ abortEarly: false,
408
+ allowUnknown: true,
409
+ });
410
+
411
+ if (res_error) {
412
+ if (this.config.options.strictResponseCheck === true) {
413
+ return Promise.reject(new FDKResponseValidationError(res_error));
414
+ } else {
415
+ Logger({
416
+ level: "WARN",
417
+ message: `Response Validation Warnings for platform > Finance > deleteConfig \n ${res_error}`,
418
+ });
419
+ }
420
+ }
421
+
422
+ return response;
423
+ }
424
+
425
+ /**
426
+ * @param {FinancePlatformValidator.DownloadCreditDebitNoteParam} arg - Arg object
427
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
428
+ * @param {import("../PlatformAPIClient").Options} - Options
429
+ * @returns {Promise<FinancePlatformModel.DownloadCreditDebitNoteResponse>}
430
+ * - Success response
431
+ *
432
+ * @name downloadCreditDebitNote
433
+ * @summary: Download credit/debit note
434
+ * @description: Retrieve and save credit/debit notes. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/downloadCreditDebitNote/).
435
+ */
436
+ async downloadCreditDebitNote(
437
+ { body, requestHeaders } = { requestHeaders: {} },
438
+ { responseHeaders } = { responseHeaders: false }
439
+ ) {
440
+ const {
441
+ error,
442
+ } = FinancePlatformValidator.downloadCreditDebitNote().validate(
443
+ {
444
+ body,
445
+ },
446
+ { abortEarly: false, allowUnknown: true }
447
+ );
448
+ if (error) {
449
+ return Promise.reject(new FDKClientValidationError(error));
450
+ }
451
+
452
+ // Showing warrnings if extra unknown parameters are found
453
+ const {
454
+ error: warrning,
455
+ } = FinancePlatformValidator.downloadCreditDebitNote().validate(
456
+ {
457
+ body,
458
+ },
459
+ { abortEarly: false, allowUnknown: false }
460
+ );
461
+ if (warrning) {
462
+ Logger({
463
+ level: "WARN",
464
+ message: `Parameter Validation warrnings for platform > Finance > downloadCreditDebitNote \n ${warrning}`,
465
+ });
466
+ }
467
+
468
+ const query_params = {};
469
+
470
+ const xHeaders = {};
471
+
472
+ const response = await PlatformAPIClient.execute(
473
+ this.config,
474
+ "post",
475
+ `/service/platform/finance/v1.0/company/${this.config.companyId}/download-credit-debit-note`,
476
+ query_params,
477
+ body,
478
+ { ...xHeaders, ...requestHeaders },
479
+ { responseHeaders }
480
+ );
481
+
482
+ let responseData = response;
483
+ if (responseHeaders) {
484
+ responseData = response[0];
485
+ }
486
+
487
+ const {
488
+ error: res_error,
489
+ } = FinancePlatformModel.DownloadCreditDebitNoteResponse().validate(
490
+ responseData,
491
+ { abortEarly: false, allowUnknown: true }
492
+ );
493
+
494
+ if (res_error) {
495
+ if (this.config.options.strictResponseCheck === true) {
496
+ return Promise.reject(new FDKResponseValidationError(res_error));
497
+ } else {
498
+ Logger({
499
+ level: "WARN",
500
+ message: `Response Validation Warnings for platform > Finance > downloadCreditDebitNote \n ${res_error}`,
501
+ });
502
+ }
503
+ }
504
+
505
+ return response;
506
+ }
507
+
508
+ /**
509
+ * @param {FinancePlatformValidator.DownloadReportParam} arg - Arg object
510
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
511
+ * @param {import("../PlatformAPIClient").Options} - Options
512
+ * @returns {Promise<FinancePlatformModel.DownloadReportList>} - Success response
513
+ * @name downloadReport
514
+ * @summary: Download financial report
515
+ * @description: Retrieve and save a financial report. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/downloadReport/).
516
+ */
517
+ async downloadReport(
518
+ { body, requestHeaders } = { requestHeaders: {} },
519
+ { responseHeaders } = { responseHeaders: false }
520
+ ) {
521
+ const { error } = FinancePlatformValidator.downloadReport().validate(
522
+ {
523
+ body,
524
+ },
525
+ { abortEarly: false, allowUnknown: true }
526
+ );
527
+ if (error) {
528
+ return Promise.reject(new FDKClientValidationError(error));
529
+ }
530
+
531
+ // Showing warrnings if extra unknown parameters are found
532
+ const {
533
+ error: warrning,
534
+ } = FinancePlatformValidator.downloadReport().validate(
535
+ {
536
+ body,
537
+ },
538
+ { abortEarly: false, allowUnknown: false }
539
+ );
540
+ if (warrning) {
541
+ Logger({
542
+ level: "WARN",
543
+ message: `Parameter Validation warrnings for platform > Finance > downloadReport \n ${warrning}`,
544
+ });
545
+ }
546
+
547
+ const query_params = {};
548
+
549
+ const xHeaders = {};
550
+
551
+ const response = await PlatformAPIClient.execute(
552
+ this.config,
553
+ "post",
554
+ `/service/platform/finance/v1.0/company/${this.config.companyId}/download-report`,
555
+ query_params,
556
+ body,
557
+ { ...xHeaders, ...requestHeaders },
558
+ { responseHeaders }
559
+ );
560
+
561
+ let responseData = response;
562
+ if (responseHeaders) {
563
+ responseData = response[0];
564
+ }
565
+
566
+ const {
567
+ error: res_error,
568
+ } = FinancePlatformModel.DownloadReportList().validate(responseData, {
569
+ abortEarly: false,
570
+ allowUnknown: true,
571
+ });
572
+
573
+ if (res_error) {
574
+ if (this.config.options.strictResponseCheck === true) {
575
+ return Promise.reject(new FDKResponseValidationError(res_error));
576
+ } else {
577
+ Logger({
578
+ level: "WARN",
579
+ message: `Response Validation Warnings for platform > Finance > downloadReport \n ${res_error}`,
580
+ });
581
+ }
582
+ }
583
+
584
+ return response;
585
+ }
586
+
587
+ /**
588
+ * @param {FinancePlatformValidator.DownloadReportCustomerCnParam} arg - Arg object
589
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
590
+ * @param {import("../PlatformAPIClient").Options} - Options
591
+ * @returns {Promise<FinancePlatformModel.DownloadReportCustomerCnResponse>}
592
+ * - Success response
593
+ *
594
+ * @name downloadReportCustomerCn
595
+ * @summary: Download customer credit note report
596
+ * @description: Retrieve and save a report for customer credit notes. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/downloadReportCustomerCn/).
597
+ */
598
+ async downloadReportCustomerCn(
599
+ { body, requestHeaders } = { requestHeaders: {} },
600
+ { responseHeaders } = { responseHeaders: false }
601
+ ) {
602
+ const {
603
+ error,
604
+ } = FinancePlatformValidator.downloadReportCustomerCn().validate(
605
+ {
606
+ body,
607
+ },
608
+ { abortEarly: false, allowUnknown: true }
609
+ );
610
+ if (error) {
611
+ return Promise.reject(new FDKClientValidationError(error));
612
+ }
613
+
614
+ // Showing warrnings if extra unknown parameters are found
615
+ const {
616
+ error: warrning,
617
+ } = FinancePlatformValidator.downloadReportCustomerCn().validate(
618
+ {
619
+ body,
620
+ },
621
+ { abortEarly: false, allowUnknown: false }
622
+ );
623
+ if (warrning) {
624
+ Logger({
625
+ level: "WARN",
626
+ message: `Parameter Validation warrnings for platform > Finance > downloadReportCustomerCn \n ${warrning}`,
627
+ });
628
+ }
629
+
630
+ const query_params = {};
631
+
632
+ const xHeaders = {};
633
+
634
+ const response = await PlatformAPIClient.execute(
635
+ this.config,
636
+ "post",
637
+ `/service/platform/finance/v1.0/company/${this.config.companyId}/download-report-customer-cn`,
638
+ query_params,
639
+ body,
640
+ { ...xHeaders, ...requestHeaders },
641
+ { responseHeaders }
642
+ );
643
+
644
+ let responseData = response;
645
+ if (responseHeaders) {
646
+ responseData = response[0];
647
+ }
648
+
649
+ const {
650
+ error: res_error,
651
+ } = FinancePlatformModel.DownloadReportCustomerCnResponse().validate(
652
+ responseData,
653
+ { abortEarly: false, allowUnknown: true }
654
+ );
655
+
656
+ if (res_error) {
657
+ if (this.config.options.strictResponseCheck === true) {
658
+ return Promise.reject(new FDKResponseValidationError(res_error));
659
+ } else {
660
+ Logger({
661
+ level: "WARN",
662
+ message: `Response Validation Warnings for platform > Finance > downloadReportCustomerCn \n ${res_error}`,
663
+ });
664
+ }
665
+ }
666
+
667
+ return response;
668
+ }
669
+
670
+ /**
671
+ * @param {FinancePlatformValidator.GenerateReportParam} arg - Arg object
672
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
673
+ * @param {import("../PlatformAPIClient").Options} - Options
674
+ * @returns {Promise<FinancePlatformModel.GenerateReportJson>} - Success response
675
+ * @name generateReport
676
+ * @summary: Generate financial report
677
+ * @description: Create a financial report with relevant data. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/generateReport/).
678
+ */
679
+ async generateReport(
680
+ { body, requestHeaders } = { requestHeaders: {} },
681
+ { responseHeaders } = { responseHeaders: false }
682
+ ) {
683
+ const { error } = FinancePlatformValidator.generateReport().validate(
684
+ {
685
+ body,
686
+ },
687
+ { abortEarly: false, allowUnknown: true }
688
+ );
689
+ if (error) {
690
+ return Promise.reject(new FDKClientValidationError(error));
691
+ }
692
+
693
+ // Showing warrnings if extra unknown parameters are found
694
+ const {
695
+ error: warrning,
696
+ } = FinancePlatformValidator.generateReport().validate(
697
+ {
698
+ body,
699
+ },
700
+ { abortEarly: false, allowUnknown: false }
701
+ );
702
+ if (warrning) {
703
+ Logger({
704
+ level: "WARN",
705
+ message: `Parameter Validation warrnings for platform > Finance > generateReport \n ${warrning}`,
706
+ });
707
+ }
708
+
709
+ const query_params = {};
710
+
711
+ const xHeaders = {};
712
+
713
+ const response = await PlatformAPIClient.execute(
714
+ this.config,
715
+ "post",
716
+ `/service/platform/finance/v1.0/company/${this.config.companyId}/generate-report`,
717
+ query_params,
718
+ body,
719
+ { ...xHeaders, ...requestHeaders },
720
+ { responseHeaders }
721
+ );
722
+
723
+ let responseData = response;
724
+ if (responseHeaders) {
725
+ responseData = response[0];
726
+ }
727
+
728
+ const {
729
+ error: res_error,
730
+ } = FinancePlatformModel.GenerateReportJson().validate(responseData, {
731
+ abortEarly: false,
732
+ allowUnknown: true,
733
+ });
734
+
735
+ if (res_error) {
736
+ if (this.config.options.strictResponseCheck === true) {
737
+ return Promise.reject(new FDKResponseValidationError(res_error));
738
+ } else {
739
+ Logger({
740
+ level: "WARN",
741
+ message: `Response Validation Warnings for platform > Finance > generateReport \n ${res_error}`,
742
+ });
743
+ }
744
+ }
745
+
746
+ return response;
747
+ }
748
+
749
+ /**
750
+ * @param {FinancePlatformValidator.GenerateReportCustomerCnParam} arg - Arg object
751
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
752
+ * @param {import("../PlatformAPIClient").Options} - Options
753
+ * @returns {Promise<FinancePlatformModel.GenerateReportCustomerCnResponse>}
754
+ * - Success response
755
+ *
756
+ * @name generateReportCustomerCn
757
+ * @summary: Generate customer credit note report
758
+ * @description: Create a report specifically for customer credit notes. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/generateReportCustomerCn/).
759
+ */
760
+ async generateReportCustomerCn(
761
+ { body, requestHeaders } = { requestHeaders: {} },
762
+ { responseHeaders } = { responseHeaders: false }
763
+ ) {
764
+ const {
765
+ error,
766
+ } = FinancePlatformValidator.generateReportCustomerCn().validate(
767
+ {
768
+ body,
769
+ },
770
+ { abortEarly: false, allowUnknown: true }
771
+ );
772
+ if (error) {
773
+ return Promise.reject(new FDKClientValidationError(error));
774
+ }
775
+
776
+ // Showing warrnings if extra unknown parameters are found
777
+ const {
778
+ error: warrning,
779
+ } = FinancePlatformValidator.generateReportCustomerCn().validate(
780
+ {
781
+ body,
782
+ },
783
+ { abortEarly: false, allowUnknown: false }
784
+ );
785
+ if (warrning) {
786
+ Logger({
787
+ level: "WARN",
788
+ message: `Parameter Validation warrnings for platform > Finance > generateReportCustomerCn \n ${warrning}`,
789
+ });
790
+ }
791
+
792
+ const query_params = {};
793
+
794
+ const xHeaders = {};
795
+
796
+ const response = await PlatformAPIClient.execute(
797
+ this.config,
798
+ "post",
799
+ `/service/platform/finance/v1.0/company/${this.config.companyId}/generate-report-customer-cn`,
800
+ query_params,
801
+ body,
802
+ { ...xHeaders, ...requestHeaders },
803
+ { responseHeaders }
804
+ );
805
+
806
+ let responseData = response;
807
+ if (responseHeaders) {
808
+ responseData = response[0];
809
+ }
810
+
811
+ const {
812
+ error: res_error,
813
+ } = FinancePlatformModel.GenerateReportCustomerCnResponse().validate(
814
+ responseData,
815
+ { abortEarly: false, allowUnknown: true }
816
+ );
817
+
818
+ if (res_error) {
819
+ if (this.config.options.strictResponseCheck === true) {
820
+ return Promise.reject(new FDKResponseValidationError(res_error));
821
+ } else {
822
+ Logger({
823
+ level: "WARN",
824
+ message: `Response Validation Warnings for platform > Finance > generateReportCustomerCn \n ${res_error}`,
825
+ });
826
+ }
827
+ }
828
+
829
+ return response;
830
+ }
831
+
832
+ /**
833
+ * @param {FinancePlatformValidator.GetAffiliateParam} arg - Arg object
834
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
835
+ * @param {import("../PlatformAPIClient").Options} - Options
836
+ * @returns {Promise<FinancePlatformModel.GetAffiliateResponse>} - Success response
837
+ * @name getAffiliate
838
+ * @summary: Get affiliate details
839
+ * @description: Retrieve information about an affiliate. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/getAffiliate/).
840
+ */
841
+ async getAffiliate(
842
+ { body, requestHeaders } = { requestHeaders: {} },
843
+ { responseHeaders } = { responseHeaders: false }
844
+ ) {
845
+ const { error } = FinancePlatformValidator.getAffiliate().validate(
846
+ {
847
+ body,
848
+ },
849
+ { abortEarly: false, allowUnknown: true }
850
+ );
851
+ if (error) {
852
+ return Promise.reject(new FDKClientValidationError(error));
853
+ }
854
+
855
+ // Showing warrnings if extra unknown parameters are found
856
+ const {
857
+ error: warrning,
858
+ } = FinancePlatformValidator.getAffiliate().validate(
859
+ {
860
+ body,
861
+ },
862
+ { abortEarly: false, allowUnknown: false }
863
+ );
864
+ if (warrning) {
865
+ Logger({
866
+ level: "WARN",
867
+ message: `Parameter Validation warrnings for platform > Finance > getAffiliate \n ${warrning}`,
868
+ });
869
+ }
870
+
871
+ const query_params = {};
872
+
873
+ const xHeaders = {};
874
+
875
+ const response = await PlatformAPIClient.execute(
876
+ this.config,
877
+ "post",
878
+ `/service/platform/finance/v1.0/company/${this.config.companyId}/get-affiliate-list`,
879
+ query_params,
880
+ body,
881
+ { ...xHeaders, ...requestHeaders },
882
+ { responseHeaders }
883
+ );
884
+
885
+ let responseData = response;
886
+ if (responseHeaders) {
887
+ responseData = response[0];
888
+ }
889
+
890
+ const {
891
+ error: res_error,
892
+ } = FinancePlatformModel.GetAffiliateResponse().validate(responseData, {
893
+ abortEarly: false,
894
+ allowUnknown: true,
895
+ });
896
+
897
+ if (res_error) {
898
+ if (this.config.options.strictResponseCheck === true) {
899
+ return Promise.reject(new FDKResponseValidationError(res_error));
900
+ } else {
901
+ Logger({
902
+ level: "WARN",
903
+ message: `Response Validation Warnings for platform > Finance > getAffiliate \n ${res_error}`,
904
+ });
905
+ }
906
+ }
907
+
908
+ return response;
909
+ }
910
+
911
+ /**
912
+ * @param {FinancePlatformValidator.GetCnConfigParam} arg - Arg object
913
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
914
+ * @param {import("../PlatformAPIClient").Options} - Options
915
+ * @returns {Promise<FinancePlatformModel.GetCnConfigResponse>} - Success response
916
+ * @name getCnConfig
917
+ * @summary: Get credit note configuration
918
+ * @description: Retrieve configuration settings for credit notes. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/getCnConfig/).
919
+ */
920
+ async getCnConfig(
921
+ { body, requestHeaders } = { requestHeaders: {} },
922
+ { responseHeaders } = { responseHeaders: false }
923
+ ) {
924
+ const { error } = FinancePlatformValidator.getCnConfig().validate(
925
+ {
926
+ body,
927
+ },
928
+ { abortEarly: false, allowUnknown: true }
929
+ );
930
+ if (error) {
931
+ return Promise.reject(new FDKClientValidationError(error));
932
+ }
933
+
934
+ // Showing warrnings if extra unknown parameters are found
935
+ const { error: warrning } = FinancePlatformValidator.getCnConfig().validate(
936
+ {
937
+ body,
938
+ },
939
+ { abortEarly: false, allowUnknown: false }
940
+ );
941
+ if (warrning) {
942
+ Logger({
943
+ level: "WARN",
944
+ message: `Parameter Validation warrnings for platform > Finance > getCnConfig \n ${warrning}`,
945
+ });
946
+ }
947
+
948
+ const query_params = {};
949
+
950
+ const xHeaders = {};
951
+
952
+ const response = await PlatformAPIClient.execute(
953
+ this.config,
954
+ "post",
955
+ `/service/platform/finance/v1.0/company/${this.config.companyId}/get-seller-cn-config`,
956
+ query_params,
957
+ body,
958
+ { ...xHeaders, ...requestHeaders },
959
+ { responseHeaders }
960
+ );
961
+
962
+ let responseData = response;
963
+ if (responseHeaders) {
964
+ responseData = response[0];
965
+ }
966
+
967
+ const {
968
+ error: res_error,
969
+ } = FinancePlatformModel.GetCnConfigResponse().validate(responseData, {
970
+ abortEarly: false,
971
+ allowUnknown: true,
972
+ });
973
+
974
+ if (res_error) {
975
+ if (this.config.options.strictResponseCheck === true) {
976
+ return Promise.reject(new FDKResponseValidationError(res_error));
977
+ } else {
978
+ Logger({
979
+ level: "WARN",
980
+ message: `Response Validation Warnings for platform > Finance > getCnConfig \n ${res_error}`,
981
+ });
982
+ }
983
+ }
984
+
985
+ return response;
986
+ }
987
+
988
+ /**
989
+ * @param {FinancePlatformValidator.GetCustomerCreditBalanceParam} arg - Arg object
990
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
991
+ * @param {import("../PlatformAPIClient").Options} - Options
992
+ * @returns {Promise<FinancePlatformModel.GetCustomerCreditBalanceResponse>}
993
+ * - Success response
994
+ *
995
+ * @name getCustomerCreditBalance
996
+ * @summary: Get customer credit balance
997
+ * @description: Retrieve the credit balance of a customer. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/getCustomerCreditBalance/).
998
+ */
999
+ async getCustomerCreditBalance(
1000
+ { body, requestHeaders } = { requestHeaders: {} },
1001
+ { responseHeaders } = { responseHeaders: false }
1002
+ ) {
1003
+ const {
1004
+ error,
1005
+ } = FinancePlatformValidator.getCustomerCreditBalance().validate(
1006
+ {
1007
+ body,
1008
+ },
1009
+ { abortEarly: false, allowUnknown: true }
1010
+ );
1011
+ if (error) {
1012
+ return Promise.reject(new FDKClientValidationError(error));
1013
+ }
1014
+
1015
+ // Showing warrnings if extra unknown parameters are found
1016
+ const {
1017
+ error: warrning,
1018
+ } = FinancePlatformValidator.getCustomerCreditBalance().validate(
1019
+ {
1020
+ body,
1021
+ },
1022
+ { abortEarly: false, allowUnknown: false }
1023
+ );
1024
+ if (warrning) {
1025
+ Logger({
1026
+ level: "WARN",
1027
+ message: `Parameter Validation warrnings for platform > Finance > getCustomerCreditBalance \n ${warrning}`,
1028
+ });
1029
+ }
1030
+
1031
+ const query_params = {};
1032
+
1033
+ const xHeaders = {};
1034
+
1035
+ const response = await PlatformAPIClient.execute(
1036
+ this.config,
1037
+ "post",
1038
+ `/service/platform/finance/v1.0/company/${this.config.companyId}/customer-credit-balance`,
1039
+ query_params,
1040
+ body,
1041
+ { ...xHeaders, ...requestHeaders },
1042
+ { responseHeaders }
1043
+ );
1044
+
1045
+ let responseData = response;
1046
+ if (responseHeaders) {
1047
+ responseData = response[0];
1048
+ }
1049
+
1050
+ const {
1051
+ error: res_error,
1052
+ } = FinancePlatformModel.GetCustomerCreditBalanceResponse().validate(
1053
+ responseData,
1054
+ { abortEarly: false, allowUnknown: true }
1055
+ );
1056
+
1057
+ if (res_error) {
1058
+ if (this.config.options.strictResponseCheck === true) {
1059
+ return Promise.reject(new FDKResponseValidationError(res_error));
1060
+ } else {
1061
+ Logger({
1062
+ level: "WARN",
1063
+ message: `Response Validation Warnings for platform > Finance > getCustomerCreditBalance \n ${res_error}`,
1064
+ });
1065
+ }
1066
+ }
1067
+
1068
+ return response;
1069
+ }
1070
+
1071
+ /**
1072
+ * @param {FinancePlatformValidator.GetDataParam} arg - Arg object
1073
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1074
+ * @param {import("../PlatformAPIClient").Options} - Options
1075
+ * @returns {Promise<FinancePlatformModel.GetEngineResponse>} - Success response
1076
+ * @name getData
1077
+ * @summary: Get financial data
1078
+ * @description: Retrieve financial data for analysis. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/getData/).
1079
+ */
1080
+ async getData(
1081
+ { body, requestHeaders } = { requestHeaders: {} },
1082
+ { responseHeaders } = { responseHeaders: false }
1083
+ ) {
1084
+ const { error } = FinancePlatformValidator.getData().validate(
1085
+ {
1086
+ body,
1087
+ },
1088
+ { abortEarly: false, allowUnknown: true }
1089
+ );
1090
+ if (error) {
1091
+ return Promise.reject(new FDKClientValidationError(error));
1092
+ }
1093
+
1094
+ // Showing warrnings if extra unknown parameters are found
1095
+ const { error: warrning } = FinancePlatformValidator.getData().validate(
1096
+ {
1097
+ body,
1098
+ },
1099
+ { abortEarly: false, allowUnknown: false }
1100
+ );
1101
+ if (warrning) {
1102
+ Logger({
1103
+ level: "WARN",
1104
+ message: `Parameter Validation warrnings for platform > Finance > getData \n ${warrning}`,
1105
+ });
1106
+ }
1107
+
1108
+ const query_params = {};
1109
+
1110
+ const xHeaders = {};
1111
+
1112
+ const response = await PlatformAPIClient.execute(
1113
+ this.config,
1114
+ "post",
1115
+ `/service/platform/finance/v1.0/company/${this.config.companyId}/get-data`,
1116
+ query_params,
1117
+ body,
1118
+ { ...xHeaders, ...requestHeaders },
1119
+ { responseHeaders }
1120
+ );
1121
+
1122
+ let responseData = response;
1123
+ if (responseHeaders) {
1124
+ responseData = response[0];
1125
+ }
1126
+
1127
+ const {
1128
+ error: res_error,
1129
+ } = FinancePlatformModel.GetEngineResponse().validate(responseData, {
1130
+ abortEarly: false,
1131
+ allowUnknown: true,
1132
+ });
1133
+
1134
+ if (res_error) {
1135
+ if (this.config.options.strictResponseCheck === true) {
1136
+ return Promise.reject(new FDKResponseValidationError(res_error));
1137
+ } else {
1138
+ Logger({
1139
+ level: "WARN",
1140
+ message: `Response Validation Warnings for platform > Finance > getData \n ${res_error}`,
1141
+ });
1142
+ }
1143
+ }
1144
+
1145
+ return response;
1146
+ }
1147
+
1148
+ /**
1149
+ * @param {FinancePlatformValidator.GetPdfUrlViewParam} arg - Arg object
1150
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1151
+ * @param {import("../PlatformAPIClient").Options} - Options
1152
+ * @returns {Promise<FinancePlatformModel.GetPdfUrlViewResponse>} - Success response
1153
+ * @name getPdfUrlView
1154
+ * @summary: Get PDF URL view
1155
+ * @description: Retrieve a URL to view a PDF document. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/getPdfUrlView/).
1156
+ */
1157
+ async getPdfUrlView(
1158
+ { body, requestHeaders } = { requestHeaders: {} },
1159
+ { responseHeaders } = { responseHeaders: false }
1160
+ ) {
1161
+ const { error } = FinancePlatformValidator.getPdfUrlView().validate(
1162
+ {
1163
+ body,
1164
+ },
1165
+ { abortEarly: false, allowUnknown: true }
1166
+ );
1167
+ if (error) {
1168
+ return Promise.reject(new FDKClientValidationError(error));
1169
+ }
1170
+
1171
+ // Showing warrnings if extra unknown parameters are found
1172
+ const {
1173
+ error: warrning,
1174
+ } = FinancePlatformValidator.getPdfUrlView().validate(
1175
+ {
1176
+ body,
1177
+ },
1178
+ { abortEarly: false, allowUnknown: false }
1179
+ );
1180
+ if (warrning) {
1181
+ Logger({
1182
+ level: "WARN",
1183
+ message: `Parameter Validation warrnings for platform > Finance > getPdfUrlView \n ${warrning}`,
1184
+ });
1185
+ }
1186
+
1187
+ const query_params = {};
1188
+
1189
+ const xHeaders = {};
1190
+
1191
+ const response = await PlatformAPIClient.execute(
1192
+ this.config,
1193
+ "post",
1194
+ `/service/platform/finance/v1.0/company/${this.config.companyId}/get-cn-pdf-link`,
1195
+ query_params,
1196
+ body,
1197
+ { ...xHeaders, ...requestHeaders },
1198
+ { responseHeaders }
1199
+ );
1200
+
1201
+ let responseData = response;
1202
+ if (responseHeaders) {
1203
+ responseData = response[0];
1204
+ }
1205
+
1206
+ const {
1207
+ error: res_error,
1208
+ } = FinancePlatformModel.GetPdfUrlViewResponse().validate(responseData, {
1209
+ abortEarly: false,
1210
+ allowUnknown: true,
1211
+ });
1212
+
1213
+ if (res_error) {
1214
+ if (this.config.options.strictResponseCheck === true) {
1215
+ return Promise.reject(new FDKResponseValidationError(res_error));
1216
+ } else {
1217
+ Logger({
1218
+ level: "WARN",
1219
+ message: `Response Validation Warnings for platform > Finance > getPdfUrlView \n ${res_error}`,
1220
+ });
1221
+ }
1222
+ }
1223
+
1224
+ return response;
1225
+ }
1226
+
1227
+ /**
1228
+ * @param {FinancePlatformValidator.GetReasonParam} arg - Arg object
1229
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1230
+ * @param {import("../PlatformAPIClient").Options} - Options
1231
+ * @returns {Promise<FinancePlatformModel.GetReasonResponse>} - Success response
1232
+ * @name getReason
1233
+ * @summary: Get transaction reason
1234
+ * @description: Retrieve the reason behind a transaction. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/getReason/).
1235
+ */
1236
+ async getReason(
1237
+ { body, requestHeaders } = { requestHeaders: {} },
1238
+ { responseHeaders } = { responseHeaders: false }
1239
+ ) {
1240
+ const { error } = FinancePlatformValidator.getReason().validate(
1241
+ {
1242
+ body,
1243
+ },
1244
+ { abortEarly: false, allowUnknown: true }
1245
+ );
1246
+ if (error) {
1247
+ return Promise.reject(new FDKClientValidationError(error));
1248
+ }
1249
+
1250
+ // Showing warrnings if extra unknown parameters are found
1251
+ const { error: warrning } = FinancePlatformValidator.getReason().validate(
1252
+ {
1253
+ body,
1254
+ },
1255
+ { abortEarly: false, allowUnknown: false }
1256
+ );
1257
+ if (warrning) {
1258
+ Logger({
1259
+ level: "WARN",
1260
+ message: `Parameter Validation warrnings for platform > Finance > getReason \n ${warrning}`,
1261
+ });
1262
+ }
1263
+
1264
+ const query_params = {};
1265
+
1266
+ const xHeaders = {};
1267
+
1268
+ const response = await PlatformAPIClient.execute(
1269
+ this.config,
1270
+ "post",
1271
+ `/service/platform/finance/v1.0/company/${this.config.companyId}/get-reason`,
1272
+ query_params,
1273
+ body,
1274
+ { ...xHeaders, ...requestHeaders },
1275
+ { responseHeaders }
1276
+ );
1277
+
1278
+ let responseData = response;
1279
+ if (responseHeaders) {
1280
+ responseData = response[0];
1281
+ }
1282
+
1283
+ const {
1284
+ error: res_error,
1285
+ } = FinancePlatformModel.GetReasonResponse().validate(responseData, {
1286
+ abortEarly: false,
1287
+ allowUnknown: true,
1288
+ });
1289
+
1290
+ if (res_error) {
1291
+ if (this.config.options.strictResponseCheck === true) {
1292
+ return Promise.reject(new FDKResponseValidationError(res_error));
1293
+ } else {
1294
+ Logger({
1295
+ level: "WARN",
1296
+ message: `Response Validation Warnings for platform > Finance > getReason \n ${res_error}`,
1297
+ });
1298
+ }
1299
+ }
1300
+
1301
+ return response;
1302
+ }
1303
+
1304
+ /**
1305
+ * @param {FinancePlatformValidator.GetReportListParam} arg - Arg object
1306
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1307
+ * @param {import("../PlatformAPIClient").Options} - Options
1308
+ * @returns {Promise<FinancePlatformModel.GetReportListResponse>} - Success response
1309
+ * @name getReportList
1310
+ * @summary: Get report list
1311
+ * @description: Retrieve a list of available financial reports. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/getReportList/).
1312
+ */
1313
+ async getReportList(
1314
+ { body, requestHeaders } = { requestHeaders: {} },
1315
+ { responseHeaders } = { responseHeaders: false }
1316
+ ) {
1317
+ const { error } = FinancePlatformValidator.getReportList().validate(
1318
+ {
1319
+ body,
1320
+ },
1321
+ { abortEarly: false, allowUnknown: true }
1322
+ );
1323
+ if (error) {
1324
+ return Promise.reject(new FDKClientValidationError(error));
1325
+ }
1326
+
1327
+ // Showing warrnings if extra unknown parameters are found
1328
+ const {
1329
+ error: warrning,
1330
+ } = FinancePlatformValidator.getReportList().validate(
1331
+ {
1332
+ body,
1333
+ },
1334
+ { abortEarly: false, allowUnknown: false }
1335
+ );
1336
+ if (warrning) {
1337
+ Logger({
1338
+ level: "WARN",
1339
+ message: `Parameter Validation warrnings for platform > Finance > getReportList \n ${warrning}`,
1340
+ });
1341
+ }
1342
+
1343
+ const query_params = {};
1344
+
1345
+ const xHeaders = {};
1346
+
1347
+ const response = await PlatformAPIClient.execute(
1348
+ this.config,
1349
+ "post",
1350
+ `/service/platform/finance/v1.0/company/${this.config.companyId}/get-report-list`,
1351
+ query_params,
1352
+ body,
1353
+ { ...xHeaders, ...requestHeaders },
1354
+ { responseHeaders }
1355
+ );
1356
+
1357
+ let responseData = response;
1358
+ if (responseHeaders) {
1359
+ responseData = response[0];
1360
+ }
1361
+
1362
+ const {
1363
+ error: res_error,
1364
+ } = FinancePlatformModel.GetReportListResponse().validate(responseData, {
1365
+ abortEarly: false,
1366
+ allowUnknown: true,
1367
+ });
1368
+
1369
+ if (res_error) {
1370
+ if (this.config.options.strictResponseCheck === true) {
1371
+ return Promise.reject(new FDKResponseValidationError(res_error));
1372
+ } else {
1373
+ Logger({
1374
+ level: "WARN",
1375
+ message: `Response Validation Warnings for platform > Finance > getReportList \n ${res_error}`,
1376
+ });
1377
+ }
1378
+ }
1379
+
1380
+ return response;
1381
+ }
1382
+
1383
+ /**
1384
+ * @param {FinancePlatformValidator.GetReportingFiltersParam} arg - Arg object
1385
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1386
+ * @param {import("../PlatformAPIClient").Options} - Options
1387
+ * @returns {Promise<FinancePlatformModel.GetReportingFiltersResponse>} -
1388
+ * Success response
1389
+ * @name getReportingFilters
1390
+ * @summary: Get reporting filters
1391
+ * @description: Retrieve available filters for financial reporting. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/getReportingFilters/).
1392
+ */
1393
+ async getReportingFilters(
1394
+ { filterKey, affiliateId, requestHeaders } = { requestHeaders: {} },
1395
+ { responseHeaders } = { responseHeaders: false }
1396
+ ) {
1397
+ const { error } = FinancePlatformValidator.getReportingFilters().validate(
1398
+ {
1399
+ filterKey,
1400
+ affiliateId,
1401
+ },
1402
+ { abortEarly: false, allowUnknown: true }
1403
+ );
1404
+ if (error) {
1405
+ return Promise.reject(new FDKClientValidationError(error));
1406
+ }
1407
+
1408
+ // Showing warrnings if extra unknown parameters are found
1409
+ const {
1410
+ error: warrning,
1411
+ } = FinancePlatformValidator.getReportingFilters().validate(
1412
+ {
1413
+ filterKey,
1414
+ affiliateId,
1415
+ },
1416
+ { abortEarly: false, allowUnknown: false }
1417
+ );
1418
+ if (warrning) {
1419
+ Logger({
1420
+ level: "WARN",
1421
+ message: `Parameter Validation warrnings for platform > Finance > getReportingFilters \n ${warrning}`,
1422
+ });
1423
+ }
1424
+
1425
+ const query_params = {};
1426
+ query_params["filter_key"] = filterKey;
1427
+ query_params["affiliate_id"] = affiliateId;
1428
+
1429
+ const xHeaders = {};
1430
+
1431
+ const response = await PlatformAPIClient.execute(
1432
+ this.config,
1433
+ "get",
1434
+ `/service/platform/finance/v1.0/company/${this.config.companyId}/reporting-filters`,
1435
+ query_params,
1436
+ undefined,
1437
+ { ...xHeaders, ...requestHeaders },
1438
+ { responseHeaders }
1439
+ );
1440
+
1441
+ let responseData = response;
1442
+ if (responseHeaders) {
1443
+ responseData = response[0];
1444
+ }
1445
+
1446
+ const {
1447
+ error: res_error,
1448
+ } = FinancePlatformModel.GetReportingFiltersResponse().validate(
1449
+ responseData,
1450
+ { abortEarly: false, allowUnknown: true }
1451
+ );
1452
+
1453
+ if (res_error) {
1454
+ if (this.config.options.strictResponseCheck === true) {
1455
+ return Promise.reject(new FDKResponseValidationError(res_error));
1456
+ } else {
1457
+ Logger({
1458
+ level: "WARN",
1459
+ message: `Response Validation Warnings for platform > Finance > getReportingFilters \n ${res_error}`,
1460
+ });
1461
+ }
1462
+ }
1463
+
1464
+ return response;
1465
+ }
1466
+
1467
+ /**
1468
+ * @param {FinancePlatformValidator.InvoiceActivityLogsParam} arg - Arg object
1469
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1470
+ * @param {import("../PlatformAPIClient").Options} - Options
1471
+ * @returns {Promise<FinancePlatformModel.InvoiceActivityLogsResponse>} -
1472
+ * Success response
1473
+ * @name invoiceActivityLogs
1474
+ * @summary: Display activity log details of an invoice
1475
+ * @description: Display activity log details of invoice. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/invoiceActivityLogs/).
1476
+ */
1477
+ async invoiceActivityLogs(
1478
+ { invoiceNumber, requestHeaders } = { requestHeaders: {} },
1479
+ { responseHeaders } = { responseHeaders: false }
1480
+ ) {
1481
+ const { error } = FinancePlatformValidator.invoiceActivityLogs().validate(
1482
+ {
1483
+ invoiceNumber,
1484
+ },
1485
+ { abortEarly: false, allowUnknown: true }
1486
+ );
1487
+ if (error) {
1488
+ return Promise.reject(new FDKClientValidationError(error));
1489
+ }
1490
+
1491
+ // Showing warrnings if extra unknown parameters are found
1492
+ const {
1493
+ error: warrning,
1494
+ } = FinancePlatformValidator.invoiceActivityLogs().validate(
1495
+ {
1496
+ invoiceNumber,
1497
+ },
1498
+ { abortEarly: false, allowUnknown: false }
1499
+ );
1500
+ if (warrning) {
1501
+ Logger({
1502
+ level: "WARN",
1503
+ message: `Parameter Validation warrnings for platform > Finance > invoiceActivityLogs \n ${warrning}`,
1504
+ });
1505
+ }
1506
+
1507
+ const query_params = {};
1508
+
1509
+ const xHeaders = {};
1510
+
1511
+ const response = await PlatformAPIClient.execute(
1512
+ this.config,
1513
+ "get",
1514
+ `/service/platform/finance/v1.0/company/${this.config.companyId}/invoice/${invoiceNumber}/activity`,
1515
+ query_params,
1516
+ undefined,
1517
+ { ...xHeaders, ...requestHeaders },
1518
+ { responseHeaders }
1519
+ );
1520
+
1521
+ let responseData = response;
1522
+ if (responseHeaders) {
1523
+ responseData = response[0];
1524
+ }
1525
+
1526
+ const {
1527
+ error: res_error,
1528
+ } = FinancePlatformModel.InvoiceActivityLogsResponse().validate(
1529
+ responseData,
1530
+ { abortEarly: false, allowUnknown: true }
1531
+ );
1532
+
1533
+ if (res_error) {
1534
+ if (this.config.options.strictResponseCheck === true) {
1535
+ return Promise.reject(new FDKResponseValidationError(res_error));
1536
+ } else {
1537
+ Logger({
1538
+ level: "WARN",
1539
+ message: `Response Validation Warnings for platform > Finance > invoiceActivityLogs \n ${res_error}`,
1540
+ });
1541
+ }
1542
+ }
1543
+
1544
+ return response;
1545
+ }
1546
+
1547
+ /**
1548
+ * @param {FinancePlatformValidator.InvoiceListingParam} arg - Arg object
1549
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1550
+ * @param {import("../PlatformAPIClient").Options} - Options
1551
+ * @returns {Promise<FinancePlatformModel.InvoiceListingResponse>} - Success response
1552
+ * @name invoiceListing
1553
+ * @summary: List invoices
1554
+ * @description: Provides list of invoices generated for a company. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/invoiceListing/).
1555
+ */
1556
+ async invoiceListing(
1557
+ { body, requestHeaders } = { requestHeaders: {} },
1558
+ { responseHeaders } = { responseHeaders: false }
1559
+ ) {
1560
+ const { error } = FinancePlatformValidator.invoiceListing().validate(
1561
+ {
1562
+ body,
1563
+ },
1564
+ { abortEarly: false, allowUnknown: true }
1565
+ );
1566
+ if (error) {
1567
+ return Promise.reject(new FDKClientValidationError(error));
1568
+ }
1569
+
1570
+ // Showing warrnings if extra unknown parameters are found
1571
+ const {
1572
+ error: warrning,
1573
+ } = FinancePlatformValidator.invoiceListing().validate(
1574
+ {
1575
+ body,
1576
+ },
1577
+ { abortEarly: false, allowUnknown: false }
1578
+ );
1579
+ if (warrning) {
1580
+ Logger({
1581
+ level: "WARN",
1582
+ message: `Parameter Validation warrnings for platform > Finance > invoiceListing \n ${warrning}`,
1583
+ });
1584
+ }
1585
+
1586
+ const query_params = {};
1587
+
1588
+ const xHeaders = {};
1589
+
1590
+ const response = await PlatformAPIClient.execute(
1591
+ this.config,
1592
+ "post",
1593
+ `/service/platform/finance/v1.0/company/${this.config.companyId}/invoice/listing`,
1594
+ query_params,
1595
+ body,
1596
+ { ...xHeaders, ...requestHeaders },
1597
+ { responseHeaders }
1598
+ );
1599
+
1600
+ let responseData = response;
1601
+ if (responseHeaders) {
1602
+ responseData = response[0];
1603
+ }
1604
+
1605
+ const {
1606
+ error: res_error,
1607
+ } = FinancePlatformModel.InvoiceListingResponse().validate(responseData, {
1608
+ abortEarly: false,
1609
+ allowUnknown: true,
1610
+ });
1611
+
1612
+ if (res_error) {
1613
+ if (this.config.options.strictResponseCheck === true) {
1614
+ return Promise.reject(new FDKResponseValidationError(res_error));
1615
+ } else {
1616
+ Logger({
1617
+ level: "WARN",
1618
+ message: `Response Validation Warnings for platform > Finance > invoiceListing \n ${res_error}`,
1619
+ });
1620
+ }
1621
+ }
1622
+
1623
+ return response;
1624
+ }
1625
+
1626
+ /**
1627
+ * @param {FinancePlatformValidator.InvoicePDFParam} arg - Arg object
1628
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1629
+ * @param {import("../PlatformAPIClient").Options} - Options
1630
+ * @returns {Promise<FinancePlatformModel.InvoicePdfResponse>} - Success response
1631
+ * @name invoicePDF
1632
+ * @summary: Get invoice PDF
1633
+ * @description: Retrieve the PDF version of an invoice. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/invoicePDF/).
1634
+ */
1635
+ async invoicePDF(
1636
+ { body, requestHeaders } = { requestHeaders: {} },
1637
+ { responseHeaders } = { responseHeaders: false }
1638
+ ) {
1639
+ const { error } = FinancePlatformValidator.invoicePDF().validate(
1640
+ {
1641
+ body,
1642
+ },
1643
+ { abortEarly: false, allowUnknown: true }
1644
+ );
1645
+ if (error) {
1646
+ return Promise.reject(new FDKClientValidationError(error));
1647
+ }
1648
+
1649
+ // Showing warrnings if extra unknown parameters are found
1650
+ const { error: warrning } = FinancePlatformValidator.invoicePDF().validate(
1651
+ {
1652
+ body,
1653
+ },
1654
+ { abortEarly: false, allowUnknown: false }
1655
+ );
1656
+ if (warrning) {
1657
+ Logger({
1658
+ level: "WARN",
1659
+ message: `Parameter Validation warrnings for platform > Finance > invoicePDF \n ${warrning}`,
1660
+ });
1661
+ }
1662
+
1663
+ const query_params = {};
1664
+
1665
+ const xHeaders = {};
1666
+
1667
+ const response = await PlatformAPIClient.execute(
1668
+ this.config,
1669
+ "post",
1670
+ `/service/platform/finance/v1.0/company/${this.config.companyId}/invoice/pdf-view`,
1671
+ query_params,
1672
+ body,
1673
+ { ...xHeaders, ...requestHeaders },
1674
+ { responseHeaders }
1675
+ );
1676
+
1677
+ let responseData = response;
1678
+ if (responseHeaders) {
1679
+ responseData = response[0];
1680
+ }
1681
+
1682
+ const {
1683
+ error: res_error,
1684
+ } = FinancePlatformModel.InvoicePdfResponse().validate(responseData, {
1685
+ abortEarly: false,
1686
+ allowUnknown: true,
1687
+ });
1688
+
1689
+ if (res_error) {
1690
+ if (this.config.options.strictResponseCheck === true) {
1691
+ return Promise.reject(new FDKResponseValidationError(res_error));
1692
+ } else {
1693
+ Logger({
1694
+ level: "WARN",
1695
+ message: `Response Validation Warnings for platform > Finance > invoicePDF \n ${res_error}`,
1696
+ });
1697
+ }
1698
+ }
1699
+
1700
+ return response;
1701
+ }
1702
+
1703
+ /**
1704
+ * @param {FinancePlatformValidator.InvoicePaymentDetailsParam} arg - Arg object
1705
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1706
+ * @param {import("../PlatformAPIClient").Options} - Options
1707
+ * @returns {Promise<FinancePlatformModel.InvoicePaymentDetailsResponse>} -
1708
+ * Success response
1709
+ * @name invoicePaymentDetails
1710
+ * @summary: Display payment details of an invoice
1711
+ * @description: Display payment details of invoice. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/invoicePaymentDetails/).
1712
+ */
1713
+ async invoicePaymentDetails(
1714
+ { invoiceNumber, requestHeaders } = { requestHeaders: {} },
1715
+ { responseHeaders } = { responseHeaders: false }
1716
+ ) {
1717
+ const { error } = FinancePlatformValidator.invoicePaymentDetails().validate(
1718
+ {
1719
+ invoiceNumber,
1720
+ },
1721
+ { abortEarly: false, allowUnknown: true }
1722
+ );
1723
+ if (error) {
1724
+ return Promise.reject(new FDKClientValidationError(error));
1725
+ }
1726
+
1727
+ // Showing warrnings if extra unknown parameters are found
1728
+ const {
1729
+ error: warrning,
1730
+ } = FinancePlatformValidator.invoicePaymentDetails().validate(
1731
+ {
1732
+ invoiceNumber,
1733
+ },
1734
+ { abortEarly: false, allowUnknown: false }
1735
+ );
1736
+ if (warrning) {
1737
+ Logger({
1738
+ level: "WARN",
1739
+ message: `Parameter Validation warrnings for platform > Finance > invoicePaymentDetails \n ${warrning}`,
1740
+ });
1741
+ }
1742
+
1743
+ const query_params = {};
1744
+
1745
+ const xHeaders = {};
1746
+
1747
+ const response = await PlatformAPIClient.execute(
1748
+ this.config,
1749
+ "get",
1750
+ `/service/platform/finance/v1.0/company/${this.config.companyId}/invoice/${invoiceNumber}/payment`,
1751
+ query_params,
1752
+ undefined,
1753
+ { ...xHeaders, ...requestHeaders },
1754
+ { responseHeaders }
1755
+ );
1756
+
1757
+ let responseData = response;
1758
+ if (responseHeaders) {
1759
+ responseData = response[0];
1760
+ }
1761
+
1762
+ const {
1763
+ error: res_error,
1764
+ } = FinancePlatformModel.InvoicePaymentDetailsResponse().validate(
1765
+ responseData,
1766
+ { abortEarly: false, allowUnknown: true }
1767
+ );
1768
+
1769
+ if (res_error) {
1770
+ if (this.config.options.strictResponseCheck === true) {
1771
+ return Promise.reject(new FDKResponseValidationError(res_error));
1772
+ } else {
1773
+ Logger({
1774
+ level: "WARN",
1775
+ message: `Response Validation Warnings for platform > Finance > invoicePaymentDetails \n ${res_error}`,
1776
+ });
1777
+ }
1778
+ }
1779
+
1780
+ return response;
1781
+ }
1782
+
1783
+ /**
1784
+ * @param {FinancePlatformValidator.InvoicePaymentOptionsParam} arg - Arg object
1785
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1786
+ * @param {import("../PlatformAPIClient").Options} - Options
1787
+ * @returns {Promise<FinancePlatformModel.InvoicePaymentOptionsResponse>} -
1788
+ * Success response
1789
+ * @name invoicePaymentOptions
1790
+ * @summary: Display all payment options for invoice.
1791
+ * @description: Display all payment options for invoice. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/invoicePaymentOptions/).
1792
+ */
1793
+ async invoicePaymentOptions(
1794
+ { body, requestHeaders } = { requestHeaders: {} },
1795
+ { responseHeaders } = { responseHeaders: false }
1796
+ ) {
1797
+ const { error } = FinancePlatformValidator.invoicePaymentOptions().validate(
1798
+ {
1799
+ body,
1800
+ },
1801
+ { abortEarly: false, allowUnknown: true }
1802
+ );
1803
+ if (error) {
1804
+ return Promise.reject(new FDKClientValidationError(error));
1805
+ }
1806
+
1807
+ // Showing warrnings if extra unknown parameters are found
1808
+ const {
1809
+ error: warrning,
1810
+ } = FinancePlatformValidator.invoicePaymentOptions().validate(
1811
+ {
1812
+ body,
1813
+ },
1814
+ { abortEarly: false, allowUnknown: false }
1815
+ );
1816
+ if (warrning) {
1817
+ Logger({
1818
+ level: "WARN",
1819
+ message: `Parameter Validation warrnings for platform > Finance > invoicePaymentOptions \n ${warrning}`,
1820
+ });
1821
+ }
1822
+
1823
+ const query_params = {};
1824
+
1825
+ const xHeaders = {};
1826
+
1827
+ const response = await PlatformAPIClient.execute(
1828
+ this.config,
1829
+ "post",
1830
+ `/service/platform/finance/v1.0/company/${this.config.companyId}/invoice-payment-options`,
1831
+ query_params,
1832
+ body,
1833
+ { ...xHeaders, ...requestHeaders },
1834
+ { responseHeaders }
1835
+ );
1836
+
1837
+ let responseData = response;
1838
+ if (responseHeaders) {
1839
+ responseData = response[0];
1840
+ }
1841
+
1842
+ const {
1843
+ error: res_error,
1844
+ } = FinancePlatformModel.InvoicePaymentOptionsResponse().validate(
1845
+ responseData,
1846
+ { abortEarly: false, allowUnknown: true }
1847
+ );
1848
+
1849
+ if (res_error) {
1850
+ if (this.config.options.strictResponseCheck === true) {
1851
+ return Promise.reject(new FDKResponseValidationError(res_error));
1852
+ } else {
1853
+ Logger({
1854
+ level: "WARN",
1855
+ message: `Response Validation Warnings for platform > Finance > invoicePaymentOptions \n ${res_error}`,
1856
+ });
1857
+ }
1858
+ }
1859
+
1860
+ return response;
1861
+ }
1862
+
1863
+ /**
1864
+ * @param {FinancePlatformValidator.InvoiceTypeParam} arg - Arg object
1865
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1866
+ * @param {import("../PlatformAPIClient").Options} - Options
1867
+ * @returns {Promise<FinancePlatformModel.InvoiceTypeResponse>} - Success response
1868
+ * @name invoiceType
1869
+ * @summary: Get invoice types
1870
+ * @description: Retrieve a list of available invoice types. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/invoiceType/).
1871
+ */
1872
+ async invoiceType(
1873
+ { body, requestHeaders } = { requestHeaders: {} },
1874
+ { responseHeaders } = { responseHeaders: false }
1875
+ ) {
1876
+ const { error } = FinancePlatformValidator.invoiceType().validate(
1877
+ {
1878
+ body,
1879
+ },
1880
+ { abortEarly: false, allowUnknown: true }
1881
+ );
1882
+ if (error) {
1883
+ return Promise.reject(new FDKClientValidationError(error));
1884
+ }
1885
+
1886
+ // Showing warrnings if extra unknown parameters are found
1887
+ const { error: warrning } = FinancePlatformValidator.invoiceType().validate(
1888
+ {
1889
+ body,
1890
+ },
1891
+ { abortEarly: false, allowUnknown: false }
1892
+ );
1893
+ if (warrning) {
1894
+ Logger({
1895
+ level: "WARN",
1896
+ message: `Parameter Validation warrnings for platform > Finance > invoiceType \n ${warrning}`,
1897
+ });
1898
+ }
1899
+
1900
+ const query_params = {};
1901
+
1902
+ const xHeaders = {};
1903
+
1904
+ const response = await PlatformAPIClient.execute(
1905
+ this.config,
1906
+ "post",
1907
+ `/service/platform/finance/v1.0/company/${this.config.companyId}/invoice-type`,
1908
+ query_params,
1909
+ body,
1910
+ { ...xHeaders, ...requestHeaders },
1911
+ { responseHeaders }
1912
+ );
1913
+
1914
+ let responseData = response;
1915
+ if (responseHeaders) {
1916
+ responseData = response[0];
1917
+ }
1918
+
1919
+ const {
1920
+ error: res_error,
1921
+ } = FinancePlatformModel.InvoiceTypeResponse().validate(responseData, {
1922
+ abortEarly: false,
1923
+ allowUnknown: true,
1924
+ });
1925
+
1926
+ if (res_error) {
1927
+ if (this.config.options.strictResponseCheck === true) {
1928
+ return Promise.reject(new FDKResponseValidationError(res_error));
1929
+ } else {
1930
+ Logger({
1931
+ level: "WARN",
1932
+ message: `Response Validation Warnings for platform > Finance > invoiceType \n ${res_error}`,
1933
+ });
1934
+ }
1935
+ }
1936
+
1937
+ return response;
1938
+ }
1939
+
1940
+ /**
1941
+ * @param {FinancePlatformValidator.IsCnRefundMethodParam} arg - Arg object
1942
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1943
+ * @param {import("../PlatformAPIClient").Options} - Options
1944
+ * @returns {Promise<FinancePlatformModel.IsCnRefundMethodResponse>} -
1945
+ * Success response
1946
+ * @name isCnRefundMethod
1947
+ * @summary: Check refund method
1948
+ * @description: Verify the refund method for credit notes. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/isCnRefundMethod/).
1949
+ */
1950
+ async isCnRefundMethod(
1951
+ { body, requestHeaders } = { requestHeaders: {} },
1952
+ { responseHeaders } = { responseHeaders: false }
1953
+ ) {
1954
+ const { error } = FinancePlatformValidator.isCnRefundMethod().validate(
1955
+ {
1956
+ body,
1957
+ },
1958
+ { abortEarly: false, allowUnknown: true }
1959
+ );
1960
+ if (error) {
1961
+ return Promise.reject(new FDKClientValidationError(error));
1962
+ }
1963
+
1964
+ // Showing warrnings if extra unknown parameters are found
1965
+ const {
1966
+ error: warrning,
1967
+ } = FinancePlatformValidator.isCnRefundMethod().validate(
1968
+ {
1969
+ body,
1970
+ },
1971
+ { abortEarly: false, allowUnknown: false }
1972
+ );
1973
+ if (warrning) {
1974
+ Logger({
1975
+ level: "WARN",
1976
+ message: `Parameter Validation warrnings for platform > Finance > isCnRefundMethod \n ${warrning}`,
1977
+ });
1978
+ }
1979
+
1980
+ const query_params = {};
1981
+
1982
+ const xHeaders = {};
1983
+
1984
+ const response = await PlatformAPIClient.execute(
1985
+ this.config,
1986
+ "post",
1987
+ `/service/platform/finance/v1.0/company/${this.config.companyId}/cn-as-refund-method`,
1988
+ query_params,
1989
+ body,
1990
+ { ...xHeaders, ...requestHeaders },
1991
+ { responseHeaders }
1992
+ );
1993
+
1994
+ let responseData = response;
1995
+ if (responseHeaders) {
1996
+ responseData = response[0];
1997
+ }
1998
+
1999
+ const {
2000
+ error: res_error,
2001
+ } = FinancePlatformModel.IsCnRefundMethodResponse().validate(responseData, {
2002
+ abortEarly: false,
2003
+ allowUnknown: true,
2004
+ });
2005
+
2006
+ if (res_error) {
2007
+ if (this.config.options.strictResponseCheck === true) {
2008
+ return Promise.reject(new FDKResponseValidationError(res_error));
2009
+ } else {
2010
+ Logger({
2011
+ level: "WARN",
2012
+ message: `Response Validation Warnings for platform > Finance > isCnRefundMethod \n ${res_error}`,
2013
+ });
2014
+ }
2015
+ }
2016
+
2017
+ return response;
2018
+ }
2019
+
2020
+ /**
2021
+ * @param {FinancePlatformValidator.IsCreditlinePlatformParam} arg - Arg object
2022
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2023
+ * @param {import("../PlatformAPIClient").Options} - Options
2024
+ * @returns {Promise<FinancePlatformModel.IsCreditlinePlatformResponse>} -
2025
+ * Success response
2026
+ * @name isCreditlinePlatform
2027
+ * @summary: Check credit line platform status
2028
+ * @description: Determine if the credit line platform is operational. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/isCreditlinePlatform/).
2029
+ */
2030
+ async isCreditlinePlatform(
2031
+ { body, requestHeaders } = { requestHeaders: {} },
2032
+ { responseHeaders } = { responseHeaders: false }
2033
+ ) {
2034
+ const { error } = FinancePlatformValidator.isCreditlinePlatform().validate(
2035
+ {
2036
+ body,
2037
+ },
2038
+ { abortEarly: false, allowUnknown: true }
2039
+ );
2040
+ if (error) {
2041
+ return Promise.reject(new FDKClientValidationError(error));
2042
+ }
2043
+
2044
+ // Showing warrnings if extra unknown parameters are found
2045
+ const {
2046
+ error: warrning,
2047
+ } = FinancePlatformValidator.isCreditlinePlatform().validate(
2048
+ {
2049
+ body,
2050
+ },
2051
+ { abortEarly: false, allowUnknown: false }
2052
+ );
2053
+ if (warrning) {
2054
+ Logger({
2055
+ level: "WARN",
2056
+ message: `Parameter Validation warrnings for platform > Finance > isCreditlinePlatform \n ${warrning}`,
2057
+ });
2058
+ }
2059
+
2060
+ const query_params = {};
2061
+
2062
+ const xHeaders = {};
2063
+
2064
+ const response = await PlatformAPIClient.execute(
2065
+ this.config,
2066
+ "post",
2067
+ `/service/platform/finance/v1.0/company/${this.config.companyId}/creditline-opted`,
2068
+ query_params,
2069
+ body,
2070
+ { ...xHeaders, ...requestHeaders },
2071
+ { responseHeaders }
2072
+ );
2073
+
2074
+ let responseData = response;
2075
+ if (responseHeaders) {
2076
+ responseData = response[0];
2077
+ }
2078
+
2079
+ const {
2080
+ error: res_error,
2081
+ } = FinancePlatformModel.IsCreditlinePlatformResponse().validate(
2082
+ responseData,
2083
+ { abortEarly: false, allowUnknown: true }
2084
+ );
2085
+
2086
+ if (res_error) {
2087
+ if (this.config.options.strictResponseCheck === true) {
2088
+ return Promise.reject(new FDKResponseValidationError(res_error));
2089
+ } else {
2090
+ Logger({
2091
+ level: "WARN",
2092
+ message: `Response Validation Warnings for platform > Finance > isCreditlinePlatform \n ${res_error}`,
2093
+ });
2094
+ }
2095
+ }
2096
+
2097
+ return response;
2098
+ }
2099
+
2100
+ /**
2101
+ * @param {FinancePlatformValidator.OrderFreezeParam} arg - Arg object
2102
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2103
+ * @param {import("../PlatformAPIClient").Options} - Options
2104
+ * @returns {Promise<FinancePlatformModel.OrederFreezeResponse>} - Success response
2105
+ * @name orderFreeze
2106
+ * @summary: Get status of oms freeze.
2107
+ * @description: Used to get status of oms freeze. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/orderFreeze/).
2108
+ */
2109
+ async orderFreeze(
2110
+ { requestHeaders } = { requestHeaders: {} },
2111
+ { responseHeaders } = { responseHeaders: false }
2112
+ ) {
2113
+ const { error } = FinancePlatformValidator.orderFreeze().validate(
2114
+ {},
2115
+ { abortEarly: false, allowUnknown: true }
2116
+ );
2117
+ if (error) {
2118
+ return Promise.reject(new FDKClientValidationError(error));
2119
+ }
2120
+
2121
+ // Showing warrnings if extra unknown parameters are found
2122
+ const { error: warrning } = FinancePlatformValidator.orderFreeze().validate(
2123
+ {},
2124
+ { abortEarly: false, allowUnknown: false }
2125
+ );
2126
+ if (warrning) {
2127
+ Logger({
2128
+ level: "WARN",
2129
+ message: `Parameter Validation warrnings for platform > Finance > orderFreeze \n ${warrning}`,
2130
+ });
2131
+ }
2132
+
2133
+ const query_params = {};
2134
+
2135
+ const xHeaders = {};
2136
+
2137
+ const response = await PlatformAPIClient.execute(
2138
+ this.config,
2139
+ "get",
2140
+ `/service/platform/finance/v1.0/company/${this.config.companyId}/order/freeze`,
2141
+ query_params,
2142
+ undefined,
2143
+ { ...xHeaders, ...requestHeaders },
2144
+ { responseHeaders }
2145
+ );
2146
+
2147
+ let responseData = response;
2148
+ if (responseHeaders) {
2149
+ responseData = response[0];
2150
+ }
2151
+
2152
+ const {
2153
+ error: res_error,
2154
+ } = FinancePlatformModel.OrederFreezeResponse().validate(responseData, {
2155
+ abortEarly: false,
2156
+ allowUnknown: true,
2157
+ });
2158
+
2159
+ if (res_error) {
2160
+ if (this.config.options.strictResponseCheck === true) {
2161
+ return Promise.reject(new FDKResponseValidationError(res_error));
2162
+ } else {
2163
+ Logger({
2164
+ level: "WARN",
2165
+ message: `Response Validation Warnings for platform > Finance > orderFreeze \n ${res_error}`,
2166
+ });
2167
+ }
2168
+ }
2169
+
2170
+ return response;
2171
+ }
2172
+
2173
+ /**
2174
+ * @param {FinancePlatformValidator.PaymentProcessParam} arg - Arg object
2175
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2176
+ * @param {import("../PlatformAPIClient").Options} - Options
2177
+ * @returns {Promise<FinancePlatformModel.PaymentProcessResponse>} - Success response
2178
+ * @name paymentProcess
2179
+ * @summary: Process payments
2180
+ * @description: Initiate and manage payment processes. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/paymentProcess/).
2181
+ */
2182
+ async paymentProcess(
2183
+ { body, requestHeaders } = { requestHeaders: {} },
2184
+ { responseHeaders } = { responseHeaders: false }
2185
+ ) {
2186
+ const { error } = FinancePlatformValidator.paymentProcess().validate(
2187
+ {
2188
+ body,
2189
+ },
2190
+ { abortEarly: false, allowUnknown: true }
2191
+ );
2192
+ if (error) {
2193
+ return Promise.reject(new FDKClientValidationError(error));
2194
+ }
2195
+
2196
+ // Showing warrnings if extra unknown parameters are found
2197
+ const {
2198
+ error: warrning,
2199
+ } = FinancePlatformValidator.paymentProcess().validate(
2200
+ {
2201
+ body,
2202
+ },
2203
+ { abortEarly: false, allowUnknown: false }
2204
+ );
2205
+ if (warrning) {
2206
+ Logger({
2207
+ level: "WARN",
2208
+ message: `Parameter Validation warrnings for platform > Finance > paymentProcess \n ${warrning}`,
2209
+ });
2210
+ }
2211
+
2212
+ const query_params = {};
2213
+
2214
+ const xHeaders = {};
2215
+
2216
+ const response = await PlatformAPIClient.execute(
2217
+ this.config,
2218
+ "post",
2219
+ `/service/platform/finance/v1.0/company/${this.config.companyId}/payment-process`,
2220
+ query_params,
2221
+ body,
2222
+ { ...xHeaders, ...requestHeaders },
2223
+ { responseHeaders }
2224
+ );
2225
+
2226
+ let responseData = response;
2227
+ if (responseHeaders) {
2228
+ responseData = response[0];
2229
+ }
2230
+
2231
+ const {
2232
+ error: res_error,
2233
+ } = FinancePlatformModel.PaymentProcessResponse().validate(responseData, {
2234
+ abortEarly: false,
2235
+ allowUnknown: true,
2236
+ });
2237
+
2238
+ if (res_error) {
2239
+ if (this.config.options.strictResponseCheck === true) {
2240
+ return Promise.reject(new FDKResponseValidationError(res_error));
2241
+ } else {
2242
+ Logger({
2243
+ level: "WARN",
2244
+ message: `Response Validation Warnings for platform > Finance > paymentProcess \n ${res_error}`,
2245
+ });
2246
+ }
2247
+ }
2248
+
2249
+ return response;
2250
+ }
2251
+
2252
+ /**
2253
+ * @param {FinancePlatformValidator.UnlockCreditNoteParam} arg - Arg object
2254
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2255
+ * @param {import("../PlatformAPIClient").Options} - Options
2256
+ * @returns {Promise<FinancePlatformModel.UnlockCreditNoteResponse>} -
2257
+ * Success response
2258
+ * @name unlockCreditNote
2259
+ * @summary: Unlock credit notes
2260
+ * @description: Used to unlock all request credit notes. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/finance/unlockCreditNote/).
2261
+ */
2262
+ async unlockCreditNote(
2263
+ { body, requestHeaders } = { requestHeaders: {} },
2264
+ { responseHeaders } = { responseHeaders: false }
2265
+ ) {
2266
+ const { error } = FinancePlatformValidator.unlockCreditNote().validate(
2267
+ {
2268
+ body,
2269
+ },
2270
+ { abortEarly: false, allowUnknown: true }
2271
+ );
2272
+ if (error) {
2273
+ return Promise.reject(new FDKClientValidationError(error));
2274
+ }
2275
+
2276
+ // Showing warrnings if extra unknown parameters are found
2277
+ const {
2278
+ error: warrning,
2279
+ } = FinancePlatformValidator.unlockCreditNote().validate(
2280
+ {
2281
+ body,
2282
+ },
2283
+ { abortEarly: false, allowUnknown: false }
2284
+ );
2285
+ if (warrning) {
2286
+ Logger({
2287
+ level: "WARN",
2288
+ message: `Parameter Validation warrnings for platform > Finance > unlockCreditNote \n ${warrning}`,
2289
+ });
2290
+ }
2291
+
2292
+ const query_params = {};
2293
+
2294
+ const xHeaders = {};
2295
+
2296
+ const response = await PlatformAPIClient.execute(
2297
+ this.config,
2298
+ "post",
2299
+ `/service/platform/finance/v1.0/company/${this.config.companyId}/credit-notes/unlock`,
2300
+ query_params,
2301
+ body,
2302
+ { ...xHeaders, ...requestHeaders },
2303
+ { responseHeaders }
2304
+ );
2305
+
2306
+ let responseData = response;
2307
+ if (responseHeaders) {
2308
+ responseData = response[0];
2309
+ }
2310
+
2311
+ const {
2312
+ error: res_error,
2313
+ } = FinancePlatformModel.UnlockCreditNoteResponse().validate(responseData, {
2314
+ abortEarly: false,
2315
+ allowUnknown: true,
2316
+ });
2317
+
2318
+ if (res_error) {
2319
+ if (this.config.options.strictResponseCheck === true) {
2320
+ return Promise.reject(new FDKResponseValidationError(res_error));
2321
+ } else {
2322
+ Logger({
2323
+ level: "WARN",
2324
+ message: `Response Validation Warnings for platform > Finance > unlockCreditNote \n ${res_error}`,
2325
+ });
2326
+ }
2327
+ }
2328
+
2329
+ return response;
2330
+ }
2331
+ }
2332
+
2333
+ module.exports = Finance;