@gofynd/fdk-client-javascript 1.4.2-beta.7 → 1.4.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 (254) hide show
  1. package/README.md +1 -10
  2. package/application.d.ts +3 -3
  3. package/common.d.ts +3 -3
  4. package/index.d.ts +15 -15
  5. package/package.json +5 -3
  6. package/partner.d.ts +3 -3
  7. package/platform.d.ts +3 -3
  8. package/public.d.ts +2 -2
  9. package/sdk/application/ApplicationAPIClient.d.ts +1 -1
  10. package/sdk/application/ApplicationAPIClient.js +0 -1
  11. package/sdk/application/ApplicationClient.d.ts +17 -17
  12. package/sdk/application/ApplicationConfig.d.ts +3 -3
  13. package/sdk/application/Cart/CartApplicationClient.d.ts +58 -58
  14. package/sdk/application/Cart/CartApplicationClient.js +56 -56
  15. package/sdk/application/Cart/CartApplicationValidator.d.ts +1 -1
  16. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +72 -72
  17. package/sdk/application/Catalog/CatalogApplicationClient.js +69 -69
  18. package/sdk/application/Common/CommonApplicationClient.d.ts +6 -6
  19. package/sdk/application/Common/CommonApplicationClient.js +4 -4
  20. package/sdk/application/Communication/CommunicationApplicationClient.d.ts +8 -8
  21. package/sdk/application/Communication/CommunicationApplicationClient.js +6 -6
  22. package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +1 -1
  23. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +34 -34
  24. package/sdk/application/Configuration/ConfigurationApplicationClient.js +32 -32
  25. package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +1 -1
  26. package/sdk/application/Content/ContentApplicationClient.d.ts +48 -48
  27. package/sdk/application/Content/ContentApplicationClient.js +45 -45
  28. package/sdk/application/Content/ContentApplicationModel.d.ts +18 -18
  29. package/sdk/application/Content/ContentApplicationModel.js +26 -26
  30. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +7 -7
  31. package/sdk/application/FileStorage/FileStorageApplicationClient.js +15 -9
  32. package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +1 -1
  33. package/sdk/application/Lead/LeadApplicationClient.d.ts +12 -12
  34. package/sdk/application/Lead/LeadApplicationClient.js +10 -10
  35. package/sdk/application/Lead/LeadApplicationModel.d.ts +64 -77
  36. package/sdk/application/Lead/LeadApplicationModel.js +42 -52
  37. package/sdk/application/Lead/LeadApplicationValidator.d.ts +1 -1
  38. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +24 -24
  39. package/sdk/application/Logistic/LogisticApplicationClient.js +22 -22
  40. package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +1 -1
  41. package/sdk/application/Order/OrderApplicationClient.d.ts +19 -30
  42. package/sdk/application/Order/OrderApplicationClient.js +17 -97
  43. package/sdk/application/Order/OrderApplicationValidator.d.ts +2 -16
  44. package/sdk/application/Order/OrderApplicationValidator.js +0 -13
  45. package/sdk/application/Payment/PaymentApplicationClient.d.ts +91 -91
  46. package/sdk/application/Payment/PaymentApplicationClient.js +94 -94
  47. package/sdk/application/Payment/PaymentApplicationModel.d.ts +5 -2
  48. package/sdk/application/Payment/PaymentApplicationModel.js +4 -2
  49. package/sdk/application/Payment/PaymentApplicationValidator.d.ts +6 -6
  50. package/sdk/application/Payment/PaymentApplicationValidator.js +3 -3
  51. package/sdk/application/PosCart/PosCartApplicationClient.d.ts +29 -29
  52. package/sdk/application/PosCart/PosCartApplicationClient.js +27 -27
  53. package/sdk/application/PosCart/PosCartApplicationValidator.d.ts +1 -1
  54. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +9 -9
  55. package/sdk/application/Rewards/RewardsApplicationClient.js +7 -7
  56. package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +1 -1
  57. package/sdk/application/Share/ShareApplicationClient.d.ts +9 -9
  58. package/sdk/application/Share/ShareApplicationClient.js +7 -7
  59. package/sdk/application/Share/ShareApplicationModel.d.ts +2 -0
  60. package/sdk/application/Share/ShareApplicationModel.js +2 -0
  61. package/sdk/application/Share/ShareApplicationValidator.d.ts +1 -1
  62. package/sdk/application/Theme/ThemeApplicationClient.d.ts +10 -10
  63. package/sdk/application/Theme/ThemeApplicationClient.js +8 -8
  64. package/sdk/application/Theme/ThemeApplicationModel.d.ts +25 -32
  65. package/sdk/application/Theme/ThemeApplicationModel.js +30 -40
  66. package/sdk/application/User/UserApplicationClient.d.ts +76 -76
  67. package/sdk/application/User/UserApplicationClient.js +74 -74
  68. package/sdk/application/User/UserApplicationModel.d.ts +44 -13
  69. package/sdk/application/User/UserApplicationModel.js +17 -13
  70. package/sdk/application/User/UserApplicationValidator.d.ts +1 -1
  71. package/sdk/application/index.d.ts +18 -18
  72. package/sdk/common/AxiosHelper.d.ts +1 -1
  73. package/sdk/common/AxiosHelper.js +38 -17
  74. package/sdk/common/Clickstream.js +22 -16
  75. package/sdk/common/curlHelper.js +1 -3
  76. package/sdk/common/utils.d.ts +15 -0
  77. package/sdk/common/utils.js +30 -0
  78. package/sdk/partner/FileStorage/FileStoragePartnerClient.d.ts +3 -3
  79. package/sdk/partner/FileStorage/FileStoragePartnerClient.js +2 -2
  80. package/sdk/partner/Lead/LeadPartnerClient.d.ts +3 -3
  81. package/sdk/partner/Lead/LeadPartnerClient.js +1 -1
  82. package/sdk/partner/Logistics/LogisticsPartnerClient.d.ts +5 -5
  83. package/sdk/partner/Logistics/LogisticsPartnerClient.js +4 -4
  84. package/sdk/partner/OAuthClient.d.ts +4 -4
  85. package/sdk/partner/PartnerAPIClient.d.ts +1 -1
  86. package/sdk/partner/PartnerAPIClient.js +0 -1
  87. package/sdk/partner/PartnerClient.d.ts +6 -6
  88. package/sdk/partner/PartnerConfig.d.ts +4 -4
  89. package/sdk/partner/Theme/ThemePartnerClient.d.ts +20 -20
  90. package/sdk/partner/Theme/ThemePartnerClient.js +19 -19
  91. package/sdk/partner/Theme/ThemePartnerModel.d.ts +25 -32
  92. package/sdk/partner/Theme/ThemePartnerModel.js +30 -40
  93. package/sdk/partner/Webhook/WebhookPartnerClient.d.ts +3 -3
  94. package/sdk/partner/Webhook/WebhookPartnerClient.js +2 -2
  95. package/sdk/partner/index.d.ts +7 -7
  96. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +8 -8
  97. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +6 -6
  98. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +1 -1
  99. package/sdk/platform/Billing/BillingPlatformClient.d.ts +25 -25
  100. package/sdk/platform/Billing/BillingPlatformClient.js +23 -23
  101. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +1 -1
  102. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +115 -115
  103. package/sdk/platform/Cart/CartPlatformApplicationClient.js +113 -113
  104. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +1 -1
  105. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +147 -146
  106. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +146 -145
  107. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +1 -1
  108. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +156 -156
  109. package/sdk/platform/Catalog/CatalogPlatformClient.js +153 -153
  110. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +65 -28
  111. package/sdk/platform/Catalog/CatalogPlatformModel.js +68 -36
  112. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +1 -1
  113. package/sdk/platform/Common/CommonPlatformClient.d.ts +5 -5
  114. package/sdk/platform/Common/CommonPlatformClient.js +3 -3
  115. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +133 -133
  116. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +131 -131
  117. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +1 -1
  118. package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +4 -4
  119. package/sdk/platform/Communication/CommunicationPlatformClient.js +2 -2
  120. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +12 -0
  121. package/sdk/platform/Communication/CommunicationPlatformModel.js +12 -0
  122. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +28 -28
  123. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +25 -25
  124. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +2 -0
  125. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +2 -0
  126. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +1 -1
  127. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +52 -52
  128. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +50 -50
  129. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +1 -1
  130. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +31 -31
  131. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +29 -29
  132. package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +1 -1
  133. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +128 -128
  134. package/sdk/platform/Content/ContentPlatformApplicationClient.js +131 -131
  135. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +5 -5
  136. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +4 -4
  137. package/sdk/platform/Content/ContentPlatformClient.d.ts +33 -33
  138. package/sdk/platform/Content/ContentPlatformClient.js +37 -37
  139. package/sdk/platform/Content/ContentPlatformModel.d.ts +18 -18
  140. package/sdk/platform/Content/ContentPlatformModel.js +26 -26
  141. package/sdk/platform/Content/ContentPlatformValidator.d.ts +5 -5
  142. package/sdk/platform/Content/ContentPlatformValidator.js +4 -4
  143. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +24 -24
  144. package/sdk/platform/Discount/DiscountPlatformClient.js +22 -22
  145. package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +1 -1
  146. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +24 -23
  147. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +32 -25
  148. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +1 -1
  149. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +15 -15
  150. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +28 -19
  151. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +12 -1
  152. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +16 -2
  153. package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +1 -1
  154. package/sdk/platform/Finance/FinancePlatformClient.d.ts +30 -30
  155. package/sdk/platform/Finance/FinancePlatformClient.js +28 -28
  156. package/sdk/platform/Finance/FinancePlatformValidator.d.ts +1 -1
  157. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +19 -19
  158. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +17 -17
  159. package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +1 -1
  160. package/sdk/platform/Lead/LeadPlatformClient.d.ts +20 -20
  161. package/sdk/platform/Lead/LeadPlatformClient.js +18 -18
  162. package/sdk/platform/Lead/LeadPlatformModel.d.ts +62 -77
  163. package/sdk/platform/Lead/LeadPlatformModel.js +40 -52
  164. package/sdk/platform/Lead/LeadPlatformValidator.d.ts +1 -1
  165. package/sdk/platform/OAuthClient.d.ts +3 -3
  166. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +12 -12
  167. package/sdk/platform/Order/OrderPlatformApplicationClient.js +10 -10
  168. package/sdk/platform/Order/OrderPlatformClient.d.ts +111 -122
  169. package/sdk/platform/Order/OrderPlatformClient.js +109 -204
  170. package/sdk/platform/Order/OrderPlatformModel.d.ts +18 -2
  171. package/sdk/platform/Order/OrderPlatformModel.js +12 -2
  172. package/sdk/platform/Order/OrderPlatformValidator.d.ts +2 -34
  173. package/sdk/platform/Order/OrderPlatformValidator.js +0 -20
  174. package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +6 -6
  175. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +4 -4
  176. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +1 -1
  177. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +97 -97
  178. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +95 -95
  179. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +1 -1
  180. package/sdk/platform/Payment/PaymentPlatformClient.d.ts +13 -13
  181. package/sdk/platform/Payment/PaymentPlatformClient.js +11 -11
  182. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +7 -0
  183. package/sdk/platform/Payment/PaymentPlatformModel.js +3 -0
  184. package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +1 -1
  185. package/sdk/platform/PlatformAPIClient.d.ts +1 -1
  186. package/sdk/platform/PlatformAPIClient.js +0 -1
  187. package/sdk/platform/PlatformApplicationClient.d.ts +16 -16
  188. package/sdk/platform/PlatformClient.d.ts +19 -21
  189. package/sdk/platform/PlatformClient.js +0 -4
  190. package/sdk/platform/PlatformConfig.d.ts +4 -4
  191. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +14 -14
  192. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +12 -12
  193. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +1 -1
  194. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +42 -42
  195. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +40 -40
  196. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +1 -1
  197. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +55 -54
  198. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +53 -52
  199. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +2 -2
  200. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +4 -2
  201. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +1 -1
  202. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +7 -7
  203. package/sdk/platform/Share/SharePlatformApplicationClient.js +5 -5
  204. package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +1 -1
  205. package/sdk/platform/Share/SharePlatformModel.d.ts +4 -0
  206. package/sdk/platform/Share/SharePlatformModel.js +4 -0
  207. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +42 -112
  208. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +40 -597
  209. package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +2 -101
  210. package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +0 -92
  211. package/sdk/platform/Theme/ThemePlatformClient.d.ts +8 -8
  212. package/sdk/platform/Theme/ThemePlatformClient.js +6 -6
  213. package/sdk/platform/Theme/ThemePlatformModel.d.ts +25 -32
  214. package/sdk/platform/Theme/ThemePlatformModel.js +30 -40
  215. package/sdk/platform/Theme/ThemePlatformValidator.d.ts +1 -1
  216. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +37 -37
  217. package/sdk/platform/User/UserPlatformApplicationClient.js +35 -35
  218. package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +1 -1
  219. package/sdk/platform/User/UserPlatformModel.d.ts +48 -13
  220. package/sdk/platform/User/UserPlatformModel.js +21 -13
  221. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +20 -19
  222. package/sdk/platform/Webhook/WebhookPlatformClient.js +18 -17
  223. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +2 -2
  224. package/sdk/platform/Webhook/WebhookPlatformModel.js +1 -1
  225. package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +1 -1
  226. package/sdk/platform/index.d.ts +24 -25
  227. package/sdk/platform/index.js +0 -2
  228. package/sdk/public/Billing/BillingPublicClient.d.ts +3 -3
  229. package/sdk/public/Billing/BillingPublicClient.js +4 -4
  230. package/sdk/public/Billing/BillingPublicValidator.d.ts +2 -2
  231. package/sdk/public/Billing/BillingPublicValidator.js +2 -2
  232. package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +3 -3
  233. package/sdk/public/Configuration/ConfigurationPublicClient.js +1 -1
  234. package/sdk/public/Content/ContentPublicClient.d.ts +2 -2
  235. package/sdk/public/Content/ContentPublicValidator.d.ts +2 -2
  236. package/sdk/public/Content/ContentPublicValidator.js +3 -3
  237. package/sdk/public/Inventory/InventoryPublicClient.d.ts +2 -2
  238. package/sdk/public/Inventory/InventoryPublicModel.d.ts +8 -8
  239. package/sdk/public/Inventory/InventoryPublicModel.js +8 -8
  240. package/sdk/public/Inventory/InventoryPublicValidator.d.ts +1 -1
  241. package/sdk/public/Partner/PartnerPublicClient.d.ts +3 -3
  242. package/sdk/public/Partner/PartnerPublicClient.js +1 -1
  243. package/sdk/public/PublicAPIClient.d.ts +1 -1
  244. package/sdk/public/PublicClient.d.ts +7 -7
  245. package/sdk/public/Webhook/WebhookPublicClient.d.ts +4 -4
  246. package/sdk/public/Webhook/WebhookPublicClient.js +2 -2
  247. package/sdk/public/Webhook/WebhookPublicValidator.d.ts +1 -1
  248. package/sdk/public/index.d.ts +8 -8
  249. package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +0 -152
  250. package/sdk/platform/Inventory/InventoryPlatformClient.js +0 -1017
  251. package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +0 -1355
  252. package/sdk/platform/Inventory/InventoryPlatformModel.js +0 -1544
  253. package/sdk/platform/Inventory/InventoryPlatformValidator.d.ts +0 -171
  254. package/sdk/platform/Inventory/InventoryPlatformValidator.js +0 -159
@@ -1,1017 +0,0 @@
1
- const PlatformAPIClient = require("../PlatformAPIClient");
2
- const {
3
- FDKClientValidationError,
4
- FDKResponseValidationError,
5
- } = require("../../common/FDKError");
6
- const Paginator = require("../../common/Paginator");
7
- const InventoryPlatformValidator = require("./InventoryPlatformValidator");
8
- const InventoryPlatformModel = require("./InventoryPlatformModel");
9
- const { Logger } = require("./../../common/Logger");
10
- const Joi = require("joi");
11
-
12
- class Inventory {
13
- constructor(config) {
14
- this.config = config;
15
- }
16
-
17
- /**
18
- * @param {InventoryPlatformValidator.CreateJobParam} arg - Arg object
19
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
20
- * @param {import("../PlatformAPIClient").Options} - Options
21
- * @returns {Promise<InventoryPlatformModel.ResponseEnvelopeString>} -
22
- * Success response
23
- * @name createJob
24
- * @summary: Creates A New Job Config
25
- * @description: REST Endpoint that creates a new job config - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/inventory/createJob/).
26
- */
27
- async createJob(
28
- { body, requestHeaders } = { requestHeaders: {} },
29
- { responseHeaders } = { responseHeaders: false }
30
- ) {
31
- const { error } = InventoryPlatformValidator.createJob().validate(
32
- {
33
- body,
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 { error: warrning } = InventoryPlatformValidator.createJob().validate(
43
- {
44
- body,
45
- },
46
- { abortEarly: false, allowUnknown: false }
47
- );
48
- if (warrning) {
49
- Logger({
50
- level: "WARN",
51
- message: `Parameter Validation warrnings for platform > Inventory > createJob \n ${warrning}`,
52
- });
53
- }
54
-
55
- const query_params = {};
56
-
57
- const xHeaders = {};
58
-
59
- const response = await PlatformAPIClient.execute(
60
- this.config,
61
- "post",
62
- `/service/platform/inventory/v1.0/company/${this.config.companyId}/jobs`,
63
- query_params,
64
- body,
65
- { ...xHeaders, ...requestHeaders },
66
- { responseHeaders }
67
- );
68
-
69
- let responseData = response;
70
- if (responseHeaders) {
71
- responseData = response[0];
72
- }
73
-
74
- const {
75
- error: res_error,
76
- } = InventoryPlatformModel.ResponseEnvelopeString().validate(responseData, {
77
- abortEarly: false,
78
- allowUnknown: true,
79
- });
80
-
81
- if (res_error) {
82
- if (this.config.options.strictResponseCheck === true) {
83
- return Promise.reject(new FDKResponseValidationError(res_error));
84
- } else {
85
- Logger({
86
- level: "WARN",
87
- message: `Response Validation Warnings for platform > Inventory > createJob \n ${res_error}`,
88
- });
89
- }
90
- }
91
-
92
- return response;
93
- }
94
-
95
- /**
96
- * @param {InventoryPlatformValidator.DisableParam} arg - Arg object
97
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
98
- * @param {import("../PlatformAPIClient").Options} - Options
99
- * @returns {Promise<InventoryPlatformModel.ResponseEnvelopeString>} -
100
- * Success response
101
- * @name disable
102
- * @summary: Disable Job Config
103
- * @description: REST Endpoint that disables Inventory Job Config - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/inventory/disable/).
104
- */
105
- async disable(
106
- { integrationId, requestHeaders } = { requestHeaders: {} },
107
- { responseHeaders } = { responseHeaders: false }
108
- ) {
109
- const { error } = InventoryPlatformValidator.disable().validate(
110
- {
111
- integrationId,
112
- },
113
- { abortEarly: false, allowUnknown: true }
114
- );
115
- if (error) {
116
- return Promise.reject(new FDKClientValidationError(error));
117
- }
118
-
119
- // Showing warrnings if extra unknown parameters are found
120
- const { error: warrning } = InventoryPlatformValidator.disable().validate(
121
- {
122
- integrationId,
123
- },
124
- { abortEarly: false, allowUnknown: false }
125
- );
126
- if (warrning) {
127
- Logger({
128
- level: "WARN",
129
- message: `Parameter Validation warrnings for platform > Inventory > disable \n ${warrning}`,
130
- });
131
- }
132
-
133
- const query_params = {};
134
-
135
- const xHeaders = {};
136
-
137
- const response = await PlatformAPIClient.execute(
138
- this.config,
139
- "get",
140
- `/service/platform/inventory/v1.0/company/${this.config.companyId}/jobs/disable/integration/${integrationId}`,
141
- query_params,
142
- undefined,
143
- { ...xHeaders, ...requestHeaders },
144
- { responseHeaders }
145
- );
146
-
147
- let responseData = response;
148
- if (responseHeaders) {
149
- responseData = response[0];
150
- }
151
-
152
- const {
153
- error: res_error,
154
- } = InventoryPlatformModel.ResponseEnvelopeString().validate(responseData, {
155
- abortEarly: false,
156
- allowUnknown: true,
157
- });
158
-
159
- if (res_error) {
160
- if (this.config.options.strictResponseCheck === true) {
161
- return Promise.reject(new FDKResponseValidationError(res_error));
162
- } else {
163
- Logger({
164
- level: "WARN",
165
- message: `Response Validation Warnings for platform > Inventory > disable \n ${res_error}`,
166
- });
167
- }
168
- }
169
-
170
- return response;
171
- }
172
-
173
- /**
174
- * @param {InventoryPlatformValidator.GetConfigByCompanyParam} arg - Arg object
175
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
176
- * @param {import("../PlatformAPIClient").Options} - Options
177
- * @returns {Promise<InventoryPlatformModel.ResponseEnvelopeListSlingshotConfigurationDetail>}
178
- * - Success response
179
- *
180
- * @name getConfigByCompany
181
- * @summary: Get Slingshot Configuration Of A Company
182
- * @description: REST Endpoint that returns all configuration detail of a company - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/inventory/getConfigByCompany/).
183
- */
184
- async getConfigByCompany(
185
- { requestHeaders } = { requestHeaders: {} },
186
- { responseHeaders } = { responseHeaders: false }
187
- ) {
188
- const { error } = InventoryPlatformValidator.getConfigByCompany().validate(
189
- {},
190
- { abortEarly: false, allowUnknown: true }
191
- );
192
- if (error) {
193
- return Promise.reject(new FDKClientValidationError(error));
194
- }
195
-
196
- // Showing warrnings if extra unknown parameters are found
197
- const {
198
- error: warrning,
199
- } = InventoryPlatformValidator.getConfigByCompany().validate(
200
- {},
201
- { abortEarly: false, allowUnknown: false }
202
- );
203
- if (warrning) {
204
- Logger({
205
- level: "WARN",
206
- message: `Parameter Validation warrnings for platform > Inventory > getConfigByCompany \n ${warrning}`,
207
- });
208
- }
209
-
210
- const query_params = {};
211
-
212
- const xHeaders = {};
213
-
214
- const response = await PlatformAPIClient.execute(
215
- this.config,
216
- "get",
217
- `/service/platform/inventory/v1.0/company/${this.config.companyId}/slingshot`,
218
- query_params,
219
- undefined,
220
- { ...xHeaders, ...requestHeaders },
221
- { responseHeaders }
222
- );
223
-
224
- let responseData = response;
225
- if (responseHeaders) {
226
- responseData = response[0];
227
- }
228
-
229
- const {
230
- error: res_error,
231
- } = InventoryPlatformModel.ResponseEnvelopeListSlingshotConfigurationDetail().validate(
232
- responseData,
233
- { abortEarly: false, allowUnknown: true }
234
- );
235
-
236
- if (res_error) {
237
- if (this.config.options.strictResponseCheck === true) {
238
- return Promise.reject(new FDKResponseValidationError(res_error));
239
- } else {
240
- Logger({
241
- level: "WARN",
242
- message: `Response Validation Warnings for platform > Inventory > getConfigByCompany \n ${res_error}`,
243
- });
244
- }
245
- }
246
-
247
- return response;
248
- }
249
-
250
- /**
251
- * @param {InventoryPlatformValidator.GetJobByCodeParam} arg - Arg object
252
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
253
- * @param {import("../PlatformAPIClient").Options} - Options
254
- * @returns {Promise<InventoryPlatformModel.ResponseEnvelopeJobConfigDTO>}
255
- * - Success response
256
- *
257
- * @name getJobByCode
258
- * @summary: Get Job Config By Code
259
- * @description: REST Endpoint that returns job config by code - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/inventory/getJobByCode/).
260
- */
261
- async getJobByCode(
262
- { code, requestHeaders } = { requestHeaders: {} },
263
- { responseHeaders } = { responseHeaders: false }
264
- ) {
265
- const { error } = InventoryPlatformValidator.getJobByCode().validate(
266
- {
267
- code,
268
- },
269
- { abortEarly: false, allowUnknown: true }
270
- );
271
- if (error) {
272
- return Promise.reject(new FDKClientValidationError(error));
273
- }
274
-
275
- // Showing warrnings if extra unknown parameters are found
276
- const {
277
- error: warrning,
278
- } = InventoryPlatformValidator.getJobByCode().validate(
279
- {
280
- code,
281
- },
282
- { abortEarly: false, allowUnknown: false }
283
- );
284
- if (warrning) {
285
- Logger({
286
- level: "WARN",
287
- message: `Parameter Validation warrnings for platform > Inventory > getJobByCode \n ${warrning}`,
288
- });
289
- }
290
-
291
- const query_params = {};
292
-
293
- const xHeaders = {};
294
-
295
- const response = await PlatformAPIClient.execute(
296
- this.config,
297
- "get",
298
- `/service/platform/inventory/v1.0/company/${this.config.companyId}/jobs/code/${code}`,
299
- query_params,
300
- undefined,
301
- { ...xHeaders, ...requestHeaders },
302
- { responseHeaders }
303
- );
304
-
305
- let responseData = response;
306
- if (responseHeaders) {
307
- responseData = response[0];
308
- }
309
-
310
- const {
311
- error: res_error,
312
- } = InventoryPlatformModel.ResponseEnvelopeJobConfigDTO().validate(
313
- responseData,
314
- { abortEarly: false, allowUnknown: true }
315
- );
316
-
317
- if (res_error) {
318
- if (this.config.options.strictResponseCheck === true) {
319
- return Promise.reject(new FDKResponseValidationError(res_error));
320
- } else {
321
- Logger({
322
- level: "WARN",
323
- message: `Response Validation Warnings for platform > Inventory > getJobByCode \n ${res_error}`,
324
- });
325
- }
326
- }
327
-
328
- return response;
329
- }
330
-
331
- /**
332
- * @param {InventoryPlatformValidator.GetJobByCompanyAndIntegrationParam} arg
333
- * - Arg object
334
- *
335
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
336
- * @param {import("../PlatformAPIClient").Options} - Options
337
- * @returns {Promise<InventoryPlatformModel.ResponseEnvelopeListJobConfigDTO>}
338
- * - Success response
339
- *
340
- * @name getJobByCompanyAndIntegration
341
- * @summary: Get Job Configs By Company And Integration
342
- * @description: REST Endpoint that returns all job configs by company And integration - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/inventory/getJobByCompanyAndIntegration/).
343
- */
344
- async getJobByCompanyAndIntegration(
345
- { integrationId, pageNo, pageSize, requestHeaders } = {
346
- requestHeaders: {},
347
- },
348
- { responseHeaders } = { responseHeaders: false }
349
- ) {
350
- const {
351
- error,
352
- } = InventoryPlatformValidator.getJobByCompanyAndIntegration().validate(
353
- {
354
- integrationId,
355
- pageNo,
356
- pageSize,
357
- },
358
- { abortEarly: false, allowUnknown: true }
359
- );
360
- if (error) {
361
- return Promise.reject(new FDKClientValidationError(error));
362
- }
363
-
364
- // Showing warrnings if extra unknown parameters are found
365
- const {
366
- error: warrning,
367
- } = InventoryPlatformValidator.getJobByCompanyAndIntegration().validate(
368
- {
369
- integrationId,
370
- pageNo,
371
- pageSize,
372
- },
373
- { abortEarly: false, allowUnknown: false }
374
- );
375
- if (warrning) {
376
- Logger({
377
- level: "WARN",
378
- message: `Parameter Validation warrnings for platform > Inventory > getJobByCompanyAndIntegration \n ${warrning}`,
379
- });
380
- }
381
-
382
- const query_params = {};
383
- query_params["page_no"] = pageNo;
384
- query_params["page_size"] = pageSize;
385
-
386
- const xHeaders = {};
387
-
388
- const response = await PlatformAPIClient.execute(
389
- this.config,
390
- "get",
391
- `/service/platform/inventory/v1.0/company/${this.config.companyId}/jobs/integration/${integrationId}`,
392
- query_params,
393
- undefined,
394
- { ...xHeaders, ...requestHeaders },
395
- { responseHeaders }
396
- );
397
-
398
- let responseData = response;
399
- if (responseHeaders) {
400
- responseData = response[0];
401
- }
402
-
403
- const {
404
- error: res_error,
405
- } = InventoryPlatformModel.ResponseEnvelopeListJobConfigDTO().validate(
406
- responseData,
407
- { abortEarly: false, allowUnknown: true }
408
- );
409
-
410
- if (res_error) {
411
- if (this.config.options.strictResponseCheck === true) {
412
- return Promise.reject(new FDKResponseValidationError(res_error));
413
- } else {
414
- Logger({
415
- level: "WARN",
416
- message: `Response Validation Warnings for platform > Inventory > getJobByCompanyAndIntegration \n ${res_error}`,
417
- });
418
- }
419
- }
420
-
421
- return response;
422
- }
423
-
424
- /**
425
- * @param {InventoryPlatformValidator.GetJobCodeMetricsParam} arg - Arg object
426
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
427
- * @param {import("../PlatformAPIClient").Options} - Options
428
- * @returns {Promise<InventoryPlatformModel.ResponseEnvelopeJobMetricsDto>}
429
- * - Success response
430
- *
431
- * @name getJobCodeMetrics
432
- * @summary: Get Job Metrics
433
- * @description: REST Endpoint that returns Inventory Run History For A Job Code - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/inventory/getJobCodeMetrics/).
434
- */
435
- async getJobCodeMetrics(
436
- { code, pageNo, pageSize, status, date, requestHeaders } = {
437
- requestHeaders: {},
438
- },
439
- { responseHeaders } = { responseHeaders: false }
440
- ) {
441
- const { error } = InventoryPlatformValidator.getJobCodeMetrics().validate(
442
- {
443
- code,
444
- pageNo,
445
- pageSize,
446
- status,
447
- date,
448
- },
449
- { abortEarly: false, allowUnknown: true }
450
- );
451
- if (error) {
452
- return Promise.reject(new FDKClientValidationError(error));
453
- }
454
-
455
- // Showing warrnings if extra unknown parameters are found
456
- const {
457
- error: warrning,
458
- } = InventoryPlatformValidator.getJobCodeMetrics().validate(
459
- {
460
- code,
461
- pageNo,
462
- pageSize,
463
- status,
464
- date,
465
- },
466
- { abortEarly: false, allowUnknown: false }
467
- );
468
- if (warrning) {
469
- Logger({
470
- level: "WARN",
471
- message: `Parameter Validation warrnings for platform > Inventory > getJobCodeMetrics \n ${warrning}`,
472
- });
473
- }
474
-
475
- const query_params = {};
476
- query_params["page_no"] = pageNo;
477
- query_params["page_size"] = pageSize;
478
- query_params["status"] = status;
479
- query_params["date"] = date;
480
-
481
- const xHeaders = {};
482
-
483
- const response = await PlatformAPIClient.execute(
484
- this.config,
485
- "get",
486
- `/service/platform/inventory/v1.0/company/${this.config.companyId}/jobs/code/${code}/metrics`,
487
- query_params,
488
- undefined,
489
- { ...xHeaders, ...requestHeaders },
490
- { responseHeaders }
491
- );
492
-
493
- let responseData = response;
494
- if (responseHeaders) {
495
- responseData = response[0];
496
- }
497
-
498
- const {
499
- error: res_error,
500
- } = InventoryPlatformModel.ResponseEnvelopeJobMetricsDto().validate(
501
- responseData,
502
- { abortEarly: false, allowUnknown: true }
503
- );
504
-
505
- if (res_error) {
506
- if (this.config.options.strictResponseCheck === true) {
507
- return Promise.reject(new FDKResponseValidationError(res_error));
508
- } else {
509
- Logger({
510
- level: "WARN",
511
- message: `Response Validation Warnings for platform > Inventory > getJobCodeMetrics \n ${res_error}`,
512
- });
513
- }
514
- }
515
-
516
- return response;
517
- }
518
-
519
- /**
520
- * @param {InventoryPlatformValidator.GetJobCodesByCompanyAndIntegrationParam} arg
521
- * - Arg object
522
- *
523
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
524
- * @param {import("../PlatformAPIClient").Options} - Options
525
- * @returns {Promise<InventoryPlatformModel.ResponseEnvelopeListJobConfigListDTO>}
526
- * - Success response
527
- *
528
- * @name getJobCodesByCompanyAndIntegration
529
- * @summary: Get Job Codes By Company And Integration
530
- * @description: REST Endpoint that returns all job codes by company And integration - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/inventory/getJobCodesByCompanyAndIntegration/).
531
- */
532
- async getJobCodesByCompanyAndIntegration(
533
- { integrationId, pageNo, pageSize, requestHeaders } = {
534
- requestHeaders: {},
535
- },
536
- { responseHeaders } = { responseHeaders: false }
537
- ) {
538
- const {
539
- error,
540
- } = InventoryPlatformValidator.getJobCodesByCompanyAndIntegration().validate(
541
- {
542
- integrationId,
543
- pageNo,
544
- pageSize,
545
- },
546
- { abortEarly: false, allowUnknown: true }
547
- );
548
- if (error) {
549
- return Promise.reject(new FDKClientValidationError(error));
550
- }
551
-
552
- // Showing warrnings if extra unknown parameters are found
553
- const {
554
- error: warrning,
555
- } = InventoryPlatformValidator.getJobCodesByCompanyAndIntegration().validate(
556
- {
557
- integrationId,
558
- pageNo,
559
- pageSize,
560
- },
561
- { abortEarly: false, allowUnknown: false }
562
- );
563
- if (warrning) {
564
- Logger({
565
- level: "WARN",
566
- message: `Parameter Validation warrnings for platform > Inventory > getJobCodesByCompanyAndIntegration \n ${warrning}`,
567
- });
568
- }
569
-
570
- const query_params = {};
571
- query_params["page_no"] = pageNo;
572
- query_params["page_size"] = pageSize;
573
-
574
- const xHeaders = {};
575
-
576
- const response = await PlatformAPIClient.execute(
577
- this.config,
578
- "get",
579
- `/service/platform/inventory/v1.0/company/${this.config.companyId}/jobs/code/integration/${integrationId}`,
580
- query_params,
581
- undefined,
582
- { ...xHeaders, ...requestHeaders },
583
- { responseHeaders }
584
- );
585
-
586
- let responseData = response;
587
- if (responseHeaders) {
588
- responseData = response[0];
589
- }
590
-
591
- const {
592
- error: res_error,
593
- } = InventoryPlatformModel.ResponseEnvelopeListJobConfigListDTO().validate(
594
- responseData,
595
- { abortEarly: false, allowUnknown: true }
596
- );
597
-
598
- if (res_error) {
599
- if (this.config.options.strictResponseCheck === true) {
600
- return Promise.reject(new FDKResponseValidationError(res_error));
601
- } else {
602
- Logger({
603
- level: "WARN",
604
- message: `Response Validation Warnings for platform > Inventory > getJobCodesByCompanyAndIntegration \n ${res_error}`,
605
- });
606
- }
607
- }
608
-
609
- return response;
610
- }
611
-
612
- /**
613
- * @param {InventoryPlatformValidator.GetJobConfigDefaultsParam} arg - Arg object
614
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
615
- * @param {import("../PlatformAPIClient").Options} - Options
616
- * @returns {Promise<InventoryPlatformModel.ResponseEnvelopeJobConfigDTO>}
617
- * - Success response
618
- *
619
- * @name getJobConfigDefaults
620
- * @summary: Get Job Configs Defaults
621
- * @description: REST Endpoint that returns default fields job configs by company And integration - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/inventory/getJobConfigDefaults/).
622
- */
623
- async getJobConfigDefaults(
624
- { requestHeaders } = { requestHeaders: {} },
625
- { responseHeaders } = { responseHeaders: false }
626
- ) {
627
- const {
628
- error,
629
- } = InventoryPlatformValidator.getJobConfigDefaults().validate(
630
- {},
631
- { abortEarly: false, allowUnknown: true }
632
- );
633
- if (error) {
634
- return Promise.reject(new FDKClientValidationError(error));
635
- }
636
-
637
- // Showing warrnings if extra unknown parameters are found
638
- const {
639
- error: warrning,
640
- } = InventoryPlatformValidator.getJobConfigDefaults().validate(
641
- {},
642
- { abortEarly: false, allowUnknown: false }
643
- );
644
- if (warrning) {
645
- Logger({
646
- level: "WARN",
647
- message: `Parameter Validation warrnings for platform > Inventory > getJobConfigDefaults \n ${warrning}`,
648
- });
649
- }
650
-
651
- const query_params = {};
652
-
653
- const xHeaders = {};
654
-
655
- const response = await PlatformAPIClient.execute(
656
- this.config,
657
- "get",
658
- `/service/platform/inventory/v1.0/company/${this.config.companyId}/jobs/defaults`,
659
- query_params,
660
- undefined,
661
- { ...xHeaders, ...requestHeaders },
662
- { responseHeaders }
663
- );
664
-
665
- let responseData = response;
666
- if (responseHeaders) {
667
- responseData = response[0];
668
- }
669
-
670
- const {
671
- error: res_error,
672
- } = InventoryPlatformModel.ResponseEnvelopeJobConfigDTO().validate(
673
- responseData,
674
- { abortEarly: false, allowUnknown: true }
675
- );
676
-
677
- if (res_error) {
678
- if (this.config.options.strictResponseCheck === true) {
679
- return Promise.reject(new FDKResponseValidationError(res_error));
680
- } else {
681
- Logger({
682
- level: "WARN",
683
- message: `Response Validation Warnings for platform > Inventory > getJobConfigDefaults \n ${res_error}`,
684
- });
685
- }
686
- }
687
-
688
- return response;
689
- }
690
-
691
- /**
692
- * @param {InventoryPlatformValidator.GetJobStepsParam} arg - Arg object
693
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
694
- * @param {import("../PlatformAPIClient").Options} - Options
695
- * @returns {Promise<InventoryPlatformModel.ResponseEnvelopeListJobStepsDTO>}
696
- * - Success response
697
- *
698
- * @name getJobSteps
699
- * @summary: Get Job Code Steps
700
- * @description: REST Endpoint that returns Inventory Job Steps - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/inventory/getJobSteps/).
701
- */
702
- async getJobSteps(
703
- { jobId, requestHeaders } = { requestHeaders: {} },
704
- { responseHeaders } = { responseHeaders: false }
705
- ) {
706
- const { error } = InventoryPlatformValidator.getJobSteps().validate(
707
- {
708
- jobId,
709
- },
710
- { abortEarly: false, allowUnknown: true }
711
- );
712
- if (error) {
713
- return Promise.reject(new FDKClientValidationError(error));
714
- }
715
-
716
- // Showing warrnings if extra unknown parameters are found
717
- const {
718
- error: warrning,
719
- } = InventoryPlatformValidator.getJobSteps().validate(
720
- {
721
- jobId,
722
- },
723
- { abortEarly: false, allowUnknown: false }
724
- );
725
- if (warrning) {
726
- Logger({
727
- level: "WARN",
728
- message: `Parameter Validation warrnings for platform > Inventory > getJobSteps \n ${warrning}`,
729
- });
730
- }
731
-
732
- const query_params = {};
733
-
734
- const xHeaders = {};
735
-
736
- const response = await PlatformAPIClient.execute(
737
- this.config,
738
- "get",
739
- `/service/platform/inventory/v1.0/company/${this.config.companyId}/jobs/steps/${jobId}`,
740
- query_params,
741
- undefined,
742
- { ...xHeaders, ...requestHeaders },
743
- { responseHeaders }
744
- );
745
-
746
- let responseData = response;
747
- if (responseHeaders) {
748
- responseData = response[0];
749
- }
750
-
751
- const {
752
- error: res_error,
753
- } = InventoryPlatformModel.ResponseEnvelopeListJobStepsDTO().validate(
754
- responseData,
755
- { abortEarly: false, allowUnknown: true }
756
- );
757
-
758
- if (res_error) {
759
- if (this.config.options.strictResponseCheck === true) {
760
- return Promise.reject(new FDKResponseValidationError(res_error));
761
- } else {
762
- Logger({
763
- level: "WARN",
764
- message: `Response Validation Warnings for platform > Inventory > getJobSteps \n ${res_error}`,
765
- });
766
- }
767
- }
768
-
769
- return response;
770
- }
771
-
772
- /**
773
- * @param {InventoryPlatformValidator.GetJobsByCompanyParam} arg - Arg object
774
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
775
- * @param {import("../PlatformAPIClient").Options} - Options
776
- * @returns {Promise<InventoryPlatformModel.ResponseEnvelopeListJobConfigRawDTO>}
777
- * - Success response
778
- *
779
- * @name getJobsByCompany
780
- * @summary: Get Job Configs For A Company
781
- * @description: REST Endpoint that returns all job configs for a company - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/inventory/getJobsByCompany/).
782
- */
783
- async getJobsByCompany(
784
- { pageNo, pageSize, requestHeaders } = { requestHeaders: {} },
785
- { responseHeaders } = { responseHeaders: false }
786
- ) {
787
- const { error } = InventoryPlatformValidator.getJobsByCompany().validate(
788
- {
789
- pageNo,
790
- pageSize,
791
- },
792
- { abortEarly: false, allowUnknown: true }
793
- );
794
- if (error) {
795
- return Promise.reject(new FDKClientValidationError(error));
796
- }
797
-
798
- // Showing warrnings if extra unknown parameters are found
799
- const {
800
- error: warrning,
801
- } = InventoryPlatformValidator.getJobsByCompany().validate(
802
- {
803
- pageNo,
804
- pageSize,
805
- },
806
- { abortEarly: false, allowUnknown: false }
807
- );
808
- if (warrning) {
809
- Logger({
810
- level: "WARN",
811
- message: `Parameter Validation warrnings for platform > Inventory > getJobsByCompany \n ${warrning}`,
812
- });
813
- }
814
-
815
- const query_params = {};
816
- query_params["page_no"] = pageNo;
817
- query_params["page_size"] = pageSize;
818
-
819
- const xHeaders = {};
820
-
821
- const response = await PlatformAPIClient.execute(
822
- this.config,
823
- "get",
824
- `/service/platform/inventory/v1.0/company/${this.config.companyId}/jobs`,
825
- query_params,
826
- undefined,
827
- { ...xHeaders, ...requestHeaders },
828
- { responseHeaders }
829
- );
830
-
831
- let responseData = response;
832
- if (responseHeaders) {
833
- responseData = response[0];
834
- }
835
-
836
- const {
837
- error: res_error,
838
- } = InventoryPlatformModel.ResponseEnvelopeListJobConfigRawDTO().validate(
839
- responseData,
840
- { abortEarly: false, allowUnknown: true }
841
- );
842
-
843
- if (res_error) {
844
- if (this.config.options.strictResponseCheck === true) {
845
- return Promise.reject(new FDKResponseValidationError(res_error));
846
- } else {
847
- Logger({
848
- level: "WARN",
849
- message: `Response Validation Warnings for platform > Inventory > getJobsByCompany \n ${res_error}`,
850
- });
851
- }
852
- }
853
-
854
- return response;
855
- }
856
-
857
- /**
858
- * @param {InventoryPlatformValidator.SuppressStoresParam} arg - Arg object
859
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
860
- * @param {import("../PlatformAPIClient").Options} - Options
861
- * @returns {Promise<InventoryPlatformModel.ResponseEnvelopeKafkaResponse>}
862
- * - Success response
863
- *
864
- * @name suppressStores
865
- * @summary: Get Slingshot Configuration Of A Company
866
- * @description: REST Endpoint that returns all configuration detail of a company - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/inventory/suppressStores/).
867
- */
868
- async suppressStores(
869
- { body, requestHeaders } = { requestHeaders: {} },
870
- { responseHeaders } = { responseHeaders: false }
871
- ) {
872
- const { error } = InventoryPlatformValidator.suppressStores().validate(
873
- {
874
- body,
875
- },
876
- { abortEarly: false, allowUnknown: true }
877
- );
878
- if (error) {
879
- return Promise.reject(new FDKClientValidationError(error));
880
- }
881
-
882
- // Showing warrnings if extra unknown parameters are found
883
- const {
884
- error: warrning,
885
- } = InventoryPlatformValidator.suppressStores().validate(
886
- {
887
- body,
888
- },
889
- { abortEarly: false, allowUnknown: false }
890
- );
891
- if (warrning) {
892
- Logger({
893
- level: "WARN",
894
- message: `Parameter Validation warrnings for platform > Inventory > suppressStores \n ${warrning}`,
895
- });
896
- }
897
-
898
- const query_params = {};
899
-
900
- const xHeaders = {};
901
-
902
- const response = await PlatformAPIClient.execute(
903
- this.config,
904
- "post",
905
- `/service/platform/inventory/v1.0/company/${this.config.companyId}/kafka/suppressStore`,
906
- query_params,
907
- body,
908
- { ...xHeaders, ...requestHeaders },
909
- { responseHeaders }
910
- );
911
-
912
- let responseData = response;
913
- if (responseHeaders) {
914
- responseData = response[0];
915
- }
916
-
917
- const {
918
- error: res_error,
919
- } = InventoryPlatformModel.ResponseEnvelopeKafkaResponse().validate(
920
- responseData,
921
- { abortEarly: false, allowUnknown: true }
922
- );
923
-
924
- if (res_error) {
925
- if (this.config.options.strictResponseCheck === true) {
926
- return Promise.reject(new FDKResponseValidationError(res_error));
927
- } else {
928
- Logger({
929
- level: "WARN",
930
- message: `Response Validation Warnings for platform > Inventory > suppressStores \n ${res_error}`,
931
- });
932
- }
933
- }
934
-
935
- return response;
936
- }
937
-
938
- /**
939
- * @param {InventoryPlatformValidator.UpdateJobParam} arg - Arg object
940
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
941
- * @param {import("../PlatformAPIClient").Options} - Options
942
- * @returns {Promise<InventoryPlatformModel.ResponseEnvelopeString>} -
943
- * Success response
944
- * @name updateJob
945
- * @summary: Updates An Existing Job Config
946
- * @description: REST Endpoint that updates a job config - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/inventory/updateJob/).
947
- */
948
- async updateJob(
949
- { body, requestHeaders } = { requestHeaders: {} },
950
- { responseHeaders } = { responseHeaders: false }
951
- ) {
952
- const { error } = InventoryPlatformValidator.updateJob().validate(
953
- {
954
- body,
955
- },
956
- { abortEarly: false, allowUnknown: true }
957
- );
958
- if (error) {
959
- return Promise.reject(new FDKClientValidationError(error));
960
- }
961
-
962
- // Showing warrnings if extra unknown parameters are found
963
- const { error: warrning } = InventoryPlatformValidator.updateJob().validate(
964
- {
965
- body,
966
- },
967
- { abortEarly: false, allowUnknown: false }
968
- );
969
- if (warrning) {
970
- Logger({
971
- level: "WARN",
972
- message: `Parameter Validation warrnings for platform > Inventory > updateJob \n ${warrning}`,
973
- });
974
- }
975
-
976
- const query_params = {};
977
-
978
- const xHeaders = {};
979
-
980
- const response = await PlatformAPIClient.execute(
981
- this.config,
982
- "put",
983
- `/service/platform/inventory/v1.0/company/${this.config.companyId}/jobs`,
984
- query_params,
985
- body,
986
- { ...xHeaders, ...requestHeaders },
987
- { responseHeaders }
988
- );
989
-
990
- let responseData = response;
991
- if (responseHeaders) {
992
- responseData = response[0];
993
- }
994
-
995
- const {
996
- error: res_error,
997
- } = InventoryPlatformModel.ResponseEnvelopeString().validate(responseData, {
998
- abortEarly: false,
999
- allowUnknown: true,
1000
- });
1001
-
1002
- if (res_error) {
1003
- if (this.config.options.strictResponseCheck === true) {
1004
- return Promise.reject(new FDKResponseValidationError(res_error));
1005
- } else {
1006
- Logger({
1007
- level: "WARN",
1008
- message: `Response Validation Warnings for platform > Inventory > updateJob \n ${res_error}`,
1009
- });
1010
- }
1011
- }
1012
-
1013
- return response;
1014
- }
1015
- }
1016
-
1017
- module.exports = Inventory;