@gofynd/fdk-client-javascript 1.0.0 → 1.0.2

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 (156) hide show
  1. package/documentation/application/CART.md +251 -251
  2. package/documentation/application/CATALOG.md +393 -393
  3. package/documentation/application/CONTENT.md +15 -1
  4. package/documentation/application/ORDER.md +268 -268
  5. package/documentation/application/PAYMENT.md +249 -249
  6. package/documentation/application/POSCART.md +297 -297
  7. package/documentation/platform/CART.md +499 -499
  8. package/documentation/platform/CATALOG.md +3497 -3097
  9. package/documentation/platform/COMPANYPROFILE.md +207 -207
  10. package/documentation/platform/CONTENT.md +123 -1
  11. package/documentation/platform/ORDER.md +1518 -1324
  12. package/documentation/platform/PARTNER.md +7 -7
  13. package/documentation/platform/PAYMENT.md +96 -96
  14. package/index.js +7 -1
  15. package/package.json +1 -1
  16. package/sdk/application/ApplicationConfig.js +1 -1
  17. package/sdk/application/Cart/CartApplicationClient.js +865 -52
  18. package/sdk/application/Cart/CartApplicationModel.d.ts +7 -7
  19. package/sdk/application/Cart/CartApplicationModel.js +335 -335
  20. package/sdk/application/Cart/CartApplicationValidator.js +1 -0
  21. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +1 -1
  22. package/sdk/application/Catalog/CatalogApplicationClient.js +1034 -60
  23. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +19 -19
  24. package/sdk/application/Catalog/CatalogApplicationModel.js +532 -532
  25. package/sdk/application/Catalog/CatalogApplicationValidator.js +1 -0
  26. package/sdk/application/Common/CommonApplicationClient.js +66 -4
  27. package/sdk/application/Common/CommonApplicationValidator.js +1 -0
  28. package/sdk/application/Communication/CommunicationApplicationClient.js +108 -6
  29. package/sdk/application/Communication/CommunicationApplicationValidator.js +1 -0
  30. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +1 -1
  31. package/sdk/application/Configuration/ConfigurationApplicationClient.js +558 -32
  32. package/sdk/application/Configuration/ConfigurationApplicationValidator.js +1 -0
  33. package/sdk/application/Content/ContentApplicationClient.js +621 -38
  34. package/sdk/application/Content/ContentApplicationModel.d.ts +1 -0
  35. package/sdk/application/Content/ContentApplicationModel.js +11 -1
  36. package/sdk/application/Content/ContentApplicationValidator.js +1 -0
  37. package/sdk/application/FileStorage/FileStorageApplicationClient.js +101 -6
  38. package/sdk/application/FileStorage/FileStorageApplicationValidator.js +1 -0
  39. package/sdk/application/Lead/LeadApplicationClient.js +229 -14
  40. package/sdk/application/Lead/LeadApplicationValidator.js +1 -0
  41. package/sdk/application/Logistic/LogisticApplicationClient.js +134 -8
  42. package/sdk/application/Logistic/LogisticApplicationValidator.js +1 -0
  43. package/sdk/application/Order/OrderApplicationClient.d.ts +1 -1
  44. package/sdk/application/Order/OrderApplicationClient.js +403 -24
  45. package/sdk/application/Order/OrderApplicationModel.d.ts +20 -20
  46. package/sdk/application/Order/OrderApplicationModel.js +334 -334
  47. package/sdk/application/Order/OrderApplicationValidator.js +1 -0
  48. package/sdk/application/Payment/PaymentApplicationClient.js +1381 -78
  49. package/sdk/application/Payment/PaymentApplicationModel.d.ts +2 -2
  50. package/sdk/application/Payment/PaymentApplicationModel.js +350 -350
  51. package/sdk/application/Payment/PaymentApplicationValidator.js +1 -0
  52. package/sdk/application/PosCart/PosCartApplicationClient.js +914 -54
  53. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +15 -15
  54. package/sdk/application/PosCart/PosCartApplicationModel.js +389 -389
  55. package/sdk/application/PosCart/PosCartApplicationValidator.js +1 -0
  56. package/sdk/application/Rewards/RewardsApplicationClient.js +235 -14
  57. package/sdk/application/Rewards/RewardsApplicationValidator.js +1 -0
  58. package/sdk/application/Share/ShareApplicationClient.js +226 -14
  59. package/sdk/application/Share/ShareApplicationValidator.js +1 -0
  60. package/sdk/application/Theme/ThemeApplicationClient.js +130 -8
  61. package/sdk/application/Theme/ThemeApplicationValidator.js +1 -0
  62. package/sdk/application/User/UserApplicationClient.js +1133 -70
  63. package/sdk/application/User/UserApplicationValidator.js +1 -0
  64. package/sdk/common/AxiosHelper.js +1 -1
  65. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +16 -8
  66. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +287 -16
  67. package/sdk/platform/Analytics/AnalyticsPlatformClient.d.ts +8 -4
  68. package/sdk/platform/Analytics/AnalyticsPlatformClient.js +153 -8
  69. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +8 -4
  70. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +141 -8
  71. package/sdk/platform/Billing/BillingPlatformClient.d.ts +24 -12
  72. package/sdk/platform/Billing/BillingPlatformClient.js +429 -24
  73. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +34 -17
  74. package/sdk/platform/Cart/CartPlatformApplicationClient.js +617 -34
  75. package/sdk/platform/Cart/CartPlatformModel.d.ts +35 -35
  76. package/sdk/platform/Cart/CartPlatformModel.js +617 -617
  77. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +191 -138
  78. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +2202 -302
  79. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +11 -11
  80. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +45 -45
  81. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +344 -226
  82. package/sdk/platform/Catalog/CatalogPlatformClient.js +3282 -488
  83. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +110 -100
  84. package/sdk/platform/Catalog/CatalogPlatformModel.js +2073 -1795
  85. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +23 -21
  86. package/sdk/platform/Catalog/CatalogPlatformValidator.js +103 -84
  87. package/sdk/platform/Common/CommonPlatformClient.d.ts +4 -2
  88. package/sdk/platform/Common/CommonPlatformClient.js +73 -4
  89. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +80 -40
  90. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +1499 -80
  91. package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +2 -1
  92. package/sdk/platform/Communication/CommunicationPlatformClient.js +41 -2
  93. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +27 -14
  94. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +486 -26
  95. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +9 -9
  96. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +274 -274
  97. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +56 -28
  98. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +1022 -56
  99. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +36 -18
  100. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +693 -36
  101. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +148 -67
  102. package/sdk/platform/Content/ContentPlatformApplicationClient.js +2446 -140
  103. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +1 -0
  104. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +7 -0
  105. package/sdk/platform/Content/ContentPlatformModel.d.ts +4 -0
  106. package/sdk/platform/Content/ContentPlatformModel.js +43 -1
  107. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +21 -10
  108. package/sdk/platform/Discount/DiscountPlatformClient.js +400 -22
  109. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +8 -4
  110. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +148 -8
  111. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +12 -6
  112. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +214 -12
  113. package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +27 -14
  114. package/sdk/platform/Inventory/InventoryPlatformClient.js +449 -24
  115. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +26 -13
  116. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +447 -26
  117. package/sdk/platform/Lead/LeadPlatformClient.d.ts +22 -11
  118. package/sdk/platform/Lead/LeadPlatformClient.js +384 -22
  119. package/sdk/platform/OAuthClient.js +8 -8
  120. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +6 -3
  121. package/sdk/platform/Order/OrderPlatformApplicationClient.js +125 -6
  122. package/sdk/platform/Order/OrderPlatformClient.d.ts +108 -47
  123. package/sdk/platform/Order/OrderPlatformClient.js +1641 -100
  124. package/sdk/platform/Order/OrderPlatformModel.d.ts +69 -58
  125. package/sdk/platform/Order/OrderPlatformModel.js +1485 -1493
  126. package/sdk/platform/Order/OrderPlatformValidator.d.ts +2 -1
  127. package/sdk/platform/Order/OrderPlatformValidator.js +15 -4
  128. package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -2
  129. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +74 -4
  130. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -1
  131. package/sdk/platform/Partner/PartnerPlatformModel.js +8 -8
  132. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +22 -11
  133. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +418 -22
  134. package/sdk/platform/Payment/PaymentPlatformClient.d.ts +21 -11
  135. package/sdk/platform/Payment/PaymentPlatformClient.js +374 -20
  136. package/sdk/platform/Payment/PaymentPlatformModel.js +139 -139
  137. package/sdk/platform/PlatformApplicationClient.d.ts +2973 -2827
  138. package/sdk/platform/PlatformApplicationClient.js +3461 -3263
  139. package/sdk/platform/PlatformClient.d.ts +2973 -2827
  140. package/sdk/platform/PlatformClient.js +3461 -3263
  141. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +26 -13
  142. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +449 -26
  143. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +8 -4
  144. package/sdk/platform/Share/SharePlatformApplicationClient.js +139 -8
  145. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +47 -23
  146. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +816 -48
  147. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +24 -12
  148. package/sdk/platform/User/UserPlatformApplicationClient.js +417 -24
  149. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +12 -6
  150. package/sdk/platform/Webhook/WebhookPlatformClient.js +229 -12
  151. package/sdk/public/Configuration/ConfigurationPublicClient.js +72 -4
  152. package/sdk/public/Configuration/ConfigurationPublicValidator.js +3 -1
  153. package/sdk/public/Inventory/InventoryPublicClient.js +210 -12
  154. package/sdk/public/Inventory/InventoryPublicValidator.js +3 -1
  155. package/sdk/public/Webhook/WebhookPublicClient.js +74 -4
  156. package/sdk/public/Webhook/WebhookPublicValidator.js +3 -1
@@ -2,6 +2,9 @@ const Paginator = require("../../common/Paginator");
2
2
  const { FDKClientValidationError } = require("../../common/FDKError");
3
3
  const PlatformAPIClient = require("../PlatformAPIClient");
4
4
  const InventoryValidator = require("./InventoryPlatformValidator");
5
+ const InventoryModel = require("./InventoryPlatformModel");
6
+ const { Logger } = require("./../../common/Logger");
7
+
5
8
  class Inventory {
6
9
  constructor(config) {
7
10
  this.config = config;
@@ -11,10 +14,11 @@ class Inventory {
11
14
  * @param {Object} arg - Arg object.
12
15
  * @param {number} [arg.pageNo] - Page Number
13
16
  * @param {number} [arg.pageSize] - Page Size
17
+ * @returns {Promise<ResponseEnvelopeListJobConfigRawDTO>} - Success response
14
18
  * @summary: Get Job Configs For A Company
15
19
  * @description: REST Endpoint that returns all job configs for a company
16
20
  */
17
- getJobsByCompany({ pageNo, pageSize } = {}) {
21
+ async getJobsByCompany({ pageNo, pageSize } = {}) {
18
22
  const { error } = InventoryValidator.getJobsByCompany().validate(
19
23
  {
20
24
  pageNo,
@@ -26,13 +30,29 @@ class Inventory {
26
30
  return Promise.reject(new FDKClientValidationError(error));
27
31
  }
28
32
 
33
+ // Showing warrnings if extra unknown parameters are found
34
+ const { error: warrning } = InventoryValidator.getJobsByCompany().validate(
35
+ {
36
+ pageNo,
37
+ pageSize,
38
+ },
39
+ { abortEarly: false, allowUnknown: false }
40
+ );
41
+ if (warrning) {
42
+ Logger({
43
+ level: "WARN",
44
+ message: "Parameter Validation warrnings for getJobsByCompany",
45
+ });
46
+ Logger({ level: "WARN", message: warrning });
47
+ }
48
+
29
49
  const query_params = {};
30
50
  query_params["page_no"] = pageNo;
31
51
  query_params["page_size"] = pageSize;
32
52
 
33
53
  const xHeaders = {};
34
54
 
35
- return PlatformAPIClient.execute(
55
+ const response = await PlatformAPIClient.execute(
36
56
  this.config,
37
57
  "get",
38
58
  `/service/platform/inventory/v1.0/company/${this.config.companyId}/jobs`,
@@ -40,15 +60,33 @@ class Inventory {
40
60
  undefined,
41
61
  xHeaders
42
62
  );
63
+
64
+ const {
65
+ error: res_error,
66
+ } = InventoryModel.ResponseEnvelopeListJobConfigRawDTO().validate(
67
+ response,
68
+ { abortEarly: false, allowUnknown: false }
69
+ );
70
+
71
+ if (res_error) {
72
+ Logger({
73
+ level: "WARN",
74
+ message: "Response Validation Warnnings for getJobsByCompany",
75
+ });
76
+ Logger({ level: "WARN", message: res_error });
77
+ }
78
+
79
+ return response;
43
80
  }
44
81
 
45
82
  /**
46
83
  * @param {Object} arg - Arg object.
47
84
  * @param {JobConfigDTO} arg.body
85
+ * @returns {Promise<ResponseEnvelopeString>} - Success response
48
86
  * @summary: Updates An Existing Job Config
49
87
  * @description: REST Endpoint that updates a job config
50
88
  */
51
- updateJob({ body } = {}) {
89
+ async updateJob({ body } = {}) {
52
90
  const { error } = InventoryValidator.updateJob().validate(
53
91
  {
54
92
  body,
@@ -59,11 +97,26 @@ class Inventory {
59
97
  return Promise.reject(new FDKClientValidationError(error));
60
98
  }
61
99
 
100
+ // Showing warrnings if extra unknown parameters are found
101
+ const { error: warrning } = InventoryValidator.updateJob().validate(
102
+ {
103
+ body,
104
+ },
105
+ { abortEarly: false, allowUnknown: false }
106
+ );
107
+ if (warrning) {
108
+ Logger({
109
+ level: "WARN",
110
+ message: "Parameter Validation warrnings for updateJob",
111
+ });
112
+ Logger({ level: "WARN", message: warrning });
113
+ }
114
+
62
115
  const query_params = {};
63
116
 
64
117
  const xHeaders = {};
65
118
 
66
- return PlatformAPIClient.execute(
119
+ const response = await PlatformAPIClient.execute(
67
120
  this.config,
68
121
  "put",
69
122
  `/service/platform/inventory/v1.0/company/${this.config.companyId}/jobs`,
@@ -71,15 +124,33 @@ class Inventory {
71
124
  body,
72
125
  xHeaders
73
126
  );
127
+
128
+ const {
129
+ error: res_error,
130
+ } = InventoryModel.ResponseEnvelopeString().validate(response, {
131
+ abortEarly: false,
132
+ allowUnknown: false,
133
+ });
134
+
135
+ if (res_error) {
136
+ Logger({
137
+ level: "WARN",
138
+ message: "Response Validation Warnnings for updateJob",
139
+ });
140
+ Logger({ level: "WARN", message: res_error });
141
+ }
142
+
143
+ return response;
74
144
  }
75
145
 
76
146
  /**
77
147
  * @param {Object} arg - Arg object.
78
148
  * @param {JobConfigDTO} arg.body
149
+ * @returns {Promise<ResponseEnvelopeString>} - Success response
79
150
  * @summary: Creates A New Job Config
80
151
  * @description: REST Endpoint that creates a new job config
81
152
  */
82
- createJob({ body } = {}) {
153
+ async createJob({ body } = {}) {
83
154
  const { error } = InventoryValidator.createJob().validate(
84
155
  {
85
156
  body,
@@ -90,11 +161,26 @@ class Inventory {
90
161
  return Promise.reject(new FDKClientValidationError(error));
91
162
  }
92
163
 
164
+ // Showing warrnings if extra unknown parameters are found
165
+ const { error: warrning } = InventoryValidator.createJob().validate(
166
+ {
167
+ body,
168
+ },
169
+ { abortEarly: false, allowUnknown: false }
170
+ );
171
+ if (warrning) {
172
+ Logger({
173
+ level: "WARN",
174
+ message: "Parameter Validation warrnings for createJob",
175
+ });
176
+ Logger({ level: "WARN", message: warrning });
177
+ }
178
+
93
179
  const query_params = {};
94
180
 
95
181
  const xHeaders = {};
96
182
 
97
- return PlatformAPIClient.execute(
183
+ const response = await PlatformAPIClient.execute(
98
184
  this.config,
99
185
  "post",
100
186
  `/service/platform/inventory/v1.0/company/${this.config.companyId}/jobs`,
@@ -102,15 +188,33 @@ class Inventory {
102
188
  body,
103
189
  xHeaders
104
190
  );
191
+
192
+ const {
193
+ error: res_error,
194
+ } = InventoryModel.ResponseEnvelopeString().validate(response, {
195
+ abortEarly: false,
196
+ allowUnknown: false,
197
+ });
198
+
199
+ if (res_error) {
200
+ Logger({
201
+ level: "WARN",
202
+ message: "Response Validation Warnnings for createJob",
203
+ });
204
+ Logger({ level: "WARN", message: res_error });
205
+ }
206
+
207
+ return response;
105
208
  }
106
209
 
107
210
  /**
108
211
  * @param {Object} arg - Arg object.
109
212
  * @param {SuppressStorePayload} arg.body
213
+ * @returns {Promise<ResponseEnvelopeKafkaResponse>} - Success response
110
214
  * @summary: Get Slingshot Configuration Of A Company
111
215
  * @description: REST Endpoint that returns all configuration detail of a company
112
216
  */
113
- suppressStores({ body } = {}) {
217
+ async suppressStores({ body } = {}) {
114
218
  const { error } = InventoryValidator.suppressStores().validate(
115
219
  {
116
220
  body,
@@ -121,11 +225,26 @@ class Inventory {
121
225
  return Promise.reject(new FDKClientValidationError(error));
122
226
  }
123
227
 
228
+ // Showing warrnings if extra unknown parameters are found
229
+ const { error: warrning } = InventoryValidator.suppressStores().validate(
230
+ {
231
+ body,
232
+ },
233
+ { abortEarly: false, allowUnknown: false }
234
+ );
235
+ if (warrning) {
236
+ Logger({
237
+ level: "WARN",
238
+ message: "Parameter Validation warrnings for suppressStores",
239
+ });
240
+ Logger({ level: "WARN", message: warrning });
241
+ }
242
+
124
243
  const query_params = {};
125
244
 
126
245
  const xHeaders = {};
127
246
 
128
- return PlatformAPIClient.execute(
247
+ const response = await PlatformAPIClient.execute(
129
248
  this.config,
130
249
  "post",
131
250
  `/service/platform/inventory/v1.0/company/${this.config.companyId}/kafka/suppressStore`,
@@ -133,14 +252,33 @@ class Inventory {
133
252
  body,
134
253
  xHeaders
135
254
  );
255
+
256
+ const {
257
+ error: res_error,
258
+ } = InventoryModel.ResponseEnvelopeKafkaResponse().validate(response, {
259
+ abortEarly: false,
260
+ allowUnknown: false,
261
+ });
262
+
263
+ if (res_error) {
264
+ Logger({
265
+ level: "WARN",
266
+ message: "Response Validation Warnnings for suppressStores",
267
+ });
268
+ Logger({ level: "WARN", message: res_error });
269
+ }
270
+
271
+ return response;
136
272
  }
137
273
 
138
274
  /**
139
275
  * @param {Object} arg - Arg object.
276
+ * @returns {Promise<ResponseEnvelopeListSlingshotConfigurationDetail>} -
277
+ * Success response
140
278
  * @summary: Get Slingshot Configuration Of A Company
141
279
  * @description: REST Endpoint that returns all configuration detail of a company
142
280
  */
143
- getConfigByCompany({} = {}) {
281
+ async getConfigByCompany({} = {}) {
144
282
  const { error } = InventoryValidator.getConfigByCompany().validate(
145
283
  {},
146
284
  { abortEarly: false, allowUnknown: true }
@@ -149,11 +287,26 @@ class Inventory {
149
287
  return Promise.reject(new FDKClientValidationError(error));
150
288
  }
151
289
 
290
+ // Showing warrnings if extra unknown parameters are found
291
+ const {
292
+ error: warrning,
293
+ } = InventoryValidator.getConfigByCompany().validate(
294
+ {},
295
+ { abortEarly: false, allowUnknown: false }
296
+ );
297
+ if (warrning) {
298
+ Logger({
299
+ level: "WARN",
300
+ message: "Parameter Validation warrnings for getConfigByCompany",
301
+ });
302
+ Logger({ level: "WARN", message: warrning });
303
+ }
304
+
152
305
  const query_params = {};
153
306
 
154
307
  const xHeaders = {};
155
308
 
156
- return PlatformAPIClient.execute(
309
+ const response = await PlatformAPIClient.execute(
157
310
  this.config,
158
311
  "get",
159
312
  `/service/platform/inventory/v1.0/company/${this.config.companyId}/slingshot`,
@@ -161,15 +314,33 @@ class Inventory {
161
314
  undefined,
162
315
  xHeaders
163
316
  );
317
+
318
+ const {
319
+ error: res_error,
320
+ } = InventoryModel.ResponseEnvelopeListSlingshotConfigurationDetail().validate(
321
+ response,
322
+ { abortEarly: false, allowUnknown: false }
323
+ );
324
+
325
+ if (res_error) {
326
+ Logger({
327
+ level: "WARN",
328
+ message: "Response Validation Warnnings for getConfigByCompany",
329
+ });
330
+ Logger({ level: "WARN", message: res_error });
331
+ }
332
+
333
+ return response;
164
334
  }
165
335
 
166
336
  /**
167
337
  * @param {Object} arg - Arg object.
168
338
  * @param {number} arg.jobId - Job Id
339
+ * @returns {Promise<ResponseEnvelopeListJobStepsDTO>} - Success response
169
340
  * @summary: Get Job Code Steps
170
341
  * @description: REST Endpoint that returns Inventory Job Steps
171
342
  */
172
- getJobSteps({ jobId } = {}) {
343
+ async getJobSteps({ jobId } = {}) {
173
344
  const { error } = InventoryValidator.getJobSteps().validate(
174
345
  {
175
346
  jobId,
@@ -180,11 +351,26 @@ class Inventory {
180
351
  return Promise.reject(new FDKClientValidationError(error));
181
352
  }
182
353
 
354
+ // Showing warrnings if extra unknown parameters are found
355
+ const { error: warrning } = InventoryValidator.getJobSteps().validate(
356
+ {
357
+ jobId,
358
+ },
359
+ { abortEarly: false, allowUnknown: false }
360
+ );
361
+ if (warrning) {
362
+ Logger({
363
+ level: "WARN",
364
+ message: "Parameter Validation warrnings for getJobSteps",
365
+ });
366
+ Logger({ level: "WARN", message: warrning });
367
+ }
368
+
183
369
  const query_params = {};
184
370
 
185
371
  const xHeaders = {};
186
372
 
187
- return PlatformAPIClient.execute(
373
+ const response = await PlatformAPIClient.execute(
188
374
  this.config,
189
375
  "get",
190
376
  `/service/platform/inventory/v1.0/company/${this.config.companyId}/jobs/steps/${jobId}`,
@@ -192,6 +378,23 @@ class Inventory {
192
378
  undefined,
193
379
  xHeaders
194
380
  );
381
+
382
+ const {
383
+ error: res_error,
384
+ } = InventoryModel.ResponseEnvelopeListJobStepsDTO().validate(response, {
385
+ abortEarly: false,
386
+ allowUnknown: false,
387
+ });
388
+
389
+ if (res_error) {
390
+ Logger({
391
+ level: "WARN",
392
+ message: "Response Validation Warnnings for getJobSteps",
393
+ });
394
+ Logger({ level: "WARN", message: res_error });
395
+ }
396
+
397
+ return response;
195
398
  }
196
399
 
197
400
  /**
@@ -199,10 +402,15 @@ class Inventory {
199
402
  * @param {string} arg.integrationId - Integration Id
200
403
  * @param {number} [arg.pageNo] - Page Number
201
404
  * @param {number} [arg.pageSize] - Page Size
405
+ * @returns {Promise<ResponseEnvelopeListJobConfigDTO>} - Success response
202
406
  * @summary: Get Job Configs By Company And Integration
203
407
  * @description: REST Endpoint that returns all job configs by company And integration
204
408
  */
205
- getJobByCompanyAndIntegration({ integrationId, pageNo, pageSize } = {}) {
409
+ async getJobByCompanyAndIntegration({
410
+ integrationId,
411
+ pageNo,
412
+ pageSize,
413
+ } = {}) {
206
414
  const {
207
415
  error,
208
416
  } = InventoryValidator.getJobByCompanyAndIntegration().validate(
@@ -217,13 +425,33 @@ class Inventory {
217
425
  return Promise.reject(new FDKClientValidationError(error));
218
426
  }
219
427
 
428
+ // Showing warrnings if extra unknown parameters are found
429
+ const {
430
+ error: warrning,
431
+ } = InventoryValidator.getJobByCompanyAndIntegration().validate(
432
+ {
433
+ integrationId,
434
+ pageNo,
435
+ pageSize,
436
+ },
437
+ { abortEarly: false, allowUnknown: false }
438
+ );
439
+ if (warrning) {
440
+ Logger({
441
+ level: "WARN",
442
+ message:
443
+ "Parameter Validation warrnings for getJobByCompanyAndIntegration",
444
+ });
445
+ Logger({ level: "WARN", message: warrning });
446
+ }
447
+
220
448
  const query_params = {};
221
449
  query_params["page_no"] = pageNo;
222
450
  query_params["page_size"] = pageSize;
223
451
 
224
452
  const xHeaders = {};
225
453
 
226
- return PlatformAPIClient.execute(
454
+ const response = await PlatformAPIClient.execute(
227
455
  this.config,
228
456
  "get",
229
457
  `/service/platform/inventory/v1.0/company/${this.config.companyId}/jobs/integration/${integrationId}`,
@@ -231,15 +459,34 @@ class Inventory {
231
459
  undefined,
232
460
  xHeaders
233
461
  );
462
+
463
+ const {
464
+ error: res_error,
465
+ } = InventoryModel.ResponseEnvelopeListJobConfigDTO().validate(response, {
466
+ abortEarly: false,
467
+ allowUnknown: false,
468
+ });
469
+
470
+ if (res_error) {
471
+ Logger({
472
+ level: "WARN",
473
+ message:
474
+ "Response Validation Warnnings for getJobByCompanyAndIntegration",
475
+ });
476
+ Logger({ level: "WARN", message: res_error });
477
+ }
478
+
479
+ return response;
234
480
  }
235
481
 
236
482
  /**
237
483
  * @param {Object} arg - Arg object.
238
484
  * @param {string} arg.integrationId - IntegrationId
485
+ * @returns {Promise<ResponseEnvelopeString>} - Success response
239
486
  * @summary: Disable Job Config
240
487
  * @description: REST Endpoint that disables Inventory Job Config
241
488
  */
242
- disable({ integrationId } = {}) {
489
+ async disable({ integrationId } = {}) {
243
490
  const { error } = InventoryValidator.disable().validate(
244
491
  {
245
492
  integrationId,
@@ -250,11 +497,26 @@ class Inventory {
250
497
  return Promise.reject(new FDKClientValidationError(error));
251
498
  }
252
499
 
500
+ // Showing warrnings if extra unknown parameters are found
501
+ const { error: warrning } = InventoryValidator.disable().validate(
502
+ {
503
+ integrationId,
504
+ },
505
+ { abortEarly: false, allowUnknown: false }
506
+ );
507
+ if (warrning) {
508
+ Logger({
509
+ level: "WARN",
510
+ message: "Parameter Validation warrnings for disable",
511
+ });
512
+ Logger({ level: "WARN", message: warrning });
513
+ }
514
+
253
515
  const query_params = {};
254
516
 
255
517
  const xHeaders = {};
256
518
 
257
- return PlatformAPIClient.execute(
519
+ const response = await PlatformAPIClient.execute(
258
520
  this.config,
259
521
  "get",
260
522
  `/service/platform/inventory/v1.0/company/${this.config.companyId}/jobs/disable/integration/${integrationId}`,
@@ -262,14 +524,32 @@ class Inventory {
262
524
  undefined,
263
525
  xHeaders
264
526
  );
527
+
528
+ const {
529
+ error: res_error,
530
+ } = InventoryModel.ResponseEnvelopeString().validate(response, {
531
+ abortEarly: false,
532
+ allowUnknown: false,
533
+ });
534
+
535
+ if (res_error) {
536
+ Logger({
537
+ level: "WARN",
538
+ message: "Response Validation Warnnings for disable",
539
+ });
540
+ Logger({ level: "WARN", message: res_error });
541
+ }
542
+
543
+ return response;
265
544
  }
266
545
 
267
546
  /**
268
547
  * @param {Object} arg - Arg object.
548
+ * @returns {Promise<ResponseEnvelopeJobConfigDTO>} - Success response
269
549
  * @summary: Get Job Configs Defaults
270
550
  * @description: REST Endpoint that returns default fields job configs by company And integration
271
551
  */
272
- getJobConfigDefaults({} = {}) {
552
+ async getJobConfigDefaults({} = {}) {
273
553
  const { error } = InventoryValidator.getJobConfigDefaults().validate(
274
554
  {},
275
555
  { abortEarly: false, allowUnknown: true }
@@ -278,11 +558,26 @@ class Inventory {
278
558
  return Promise.reject(new FDKClientValidationError(error));
279
559
  }
280
560
 
561
+ // Showing warrnings if extra unknown parameters are found
562
+ const {
563
+ error: warrning,
564
+ } = InventoryValidator.getJobConfigDefaults().validate(
565
+ {},
566
+ { abortEarly: false, allowUnknown: false }
567
+ );
568
+ if (warrning) {
569
+ Logger({
570
+ level: "WARN",
571
+ message: "Parameter Validation warrnings for getJobConfigDefaults",
572
+ });
573
+ Logger({ level: "WARN", message: warrning });
574
+ }
575
+
281
576
  const query_params = {};
282
577
 
283
578
  const xHeaders = {};
284
579
 
285
- return PlatformAPIClient.execute(
580
+ const response = await PlatformAPIClient.execute(
286
581
  this.config,
287
582
  "get",
288
583
  `/service/platform/inventory/v1.0/company/${this.config.companyId}/jobs/defaults`,
@@ -290,15 +585,33 @@ class Inventory {
290
585
  undefined,
291
586
  xHeaders
292
587
  );
588
+
589
+ const {
590
+ error: res_error,
591
+ } = InventoryModel.ResponseEnvelopeJobConfigDTO().validate(response, {
592
+ abortEarly: false,
593
+ allowUnknown: false,
594
+ });
595
+
596
+ if (res_error) {
597
+ Logger({
598
+ level: "WARN",
599
+ message: "Response Validation Warnnings for getJobConfigDefaults",
600
+ });
601
+ Logger({ level: "WARN", message: res_error });
602
+ }
603
+
604
+ return response;
293
605
  }
294
606
 
295
607
  /**
296
608
  * @param {Object} arg - Arg object.
297
609
  * @param {string} arg.code - Job Code
610
+ * @returns {Promise<ResponseEnvelopeJobConfigDTO>} - Success response
298
611
  * @summary: Get Job Config By Code
299
612
  * @description: REST Endpoint that returns job config by code
300
613
  */
301
- getJobByCode({ code } = {}) {
614
+ async getJobByCode({ code } = {}) {
302
615
  const { error } = InventoryValidator.getJobByCode().validate(
303
616
  {
304
617
  code,
@@ -309,11 +622,26 @@ class Inventory {
309
622
  return Promise.reject(new FDKClientValidationError(error));
310
623
  }
311
624
 
625
+ // Showing warrnings if extra unknown parameters are found
626
+ const { error: warrning } = InventoryValidator.getJobByCode().validate(
627
+ {
628
+ code,
629
+ },
630
+ { abortEarly: false, allowUnknown: false }
631
+ );
632
+ if (warrning) {
633
+ Logger({
634
+ level: "WARN",
635
+ message: "Parameter Validation warrnings for getJobByCode",
636
+ });
637
+ Logger({ level: "WARN", message: warrning });
638
+ }
639
+
312
640
  const query_params = {};
313
641
 
314
642
  const xHeaders = {};
315
643
 
316
- return PlatformAPIClient.execute(
644
+ const response = await PlatformAPIClient.execute(
317
645
  this.config,
318
646
  "get",
319
647
  `/service/platform/inventory/v1.0/company/${this.config.companyId}/jobs/code/${code}`,
@@ -321,6 +649,23 @@ class Inventory {
321
649
  undefined,
322
650
  xHeaders
323
651
  );
652
+
653
+ const {
654
+ error: res_error,
655
+ } = InventoryModel.ResponseEnvelopeJobConfigDTO().validate(response, {
656
+ abortEarly: false,
657
+ allowUnknown: false,
658
+ });
659
+
660
+ if (res_error) {
661
+ Logger({
662
+ level: "WARN",
663
+ message: "Response Validation Warnnings for getJobByCode",
664
+ });
665
+ Logger({ level: "WARN", message: res_error });
666
+ }
667
+
668
+ return response;
324
669
  }
325
670
 
326
671
  /**
@@ -330,10 +675,11 @@ class Inventory {
330
675
  * @param {number} [arg.pageSize] - Page Size
331
676
  * @param {string} [arg.status] - Status
332
677
  * @param {string} [arg.date] - From Date
678
+ * @returns {Promise<ResponseEnvelopeJobMetricsDto>} - Success response
333
679
  * @summary: Get Job Metrics
334
680
  * @description: REST Endpoint that returns Inventory Run History For A Job Code
335
681
  */
336
- getJobCodeMetrics({ code, pageNo, pageSize, status, date } = {}) {
682
+ async getJobCodeMetrics({ code, pageNo, pageSize, status, date } = {}) {
337
683
  const { error } = InventoryValidator.getJobCodeMetrics().validate(
338
684
  {
339
685
  code,
@@ -348,6 +694,25 @@ class Inventory {
348
694
  return Promise.reject(new FDKClientValidationError(error));
349
695
  }
350
696
 
697
+ // Showing warrnings if extra unknown parameters are found
698
+ const { error: warrning } = InventoryValidator.getJobCodeMetrics().validate(
699
+ {
700
+ code,
701
+ pageNo,
702
+ pageSize,
703
+ status,
704
+ date,
705
+ },
706
+ { abortEarly: false, allowUnknown: false }
707
+ );
708
+ if (warrning) {
709
+ Logger({
710
+ level: "WARN",
711
+ message: "Parameter Validation warrnings for getJobCodeMetrics",
712
+ });
713
+ Logger({ level: "WARN", message: warrning });
714
+ }
715
+
351
716
  const query_params = {};
352
717
  query_params["page_no"] = pageNo;
353
718
  query_params["page_size"] = pageSize;
@@ -356,7 +721,7 @@ class Inventory {
356
721
 
357
722
  const xHeaders = {};
358
723
 
359
- return PlatformAPIClient.execute(
724
+ const response = await PlatformAPIClient.execute(
360
725
  this.config,
361
726
  "get",
362
727
  `/service/platform/inventory/v1.0/company/${this.config.companyId}/jobs/code/${code}/metrics`,
@@ -364,6 +729,23 @@ class Inventory {
364
729
  undefined,
365
730
  xHeaders
366
731
  );
732
+
733
+ const {
734
+ error: res_error,
735
+ } = InventoryModel.ResponseEnvelopeJobMetricsDto().validate(response, {
736
+ abortEarly: false,
737
+ allowUnknown: false,
738
+ });
739
+
740
+ if (res_error) {
741
+ Logger({
742
+ level: "WARN",
743
+ message: "Response Validation Warnnings for getJobCodeMetrics",
744
+ });
745
+ Logger({ level: "WARN", message: res_error });
746
+ }
747
+
748
+ return response;
367
749
  }
368
750
 
369
751
  /**
@@ -371,10 +753,15 @@ class Inventory {
371
753
  * @param {string} arg.integrationId - Integration Id
372
754
  * @param {number} [arg.pageNo] - Page Number
373
755
  * @param {number} [arg.pageSize] - Page Size
756
+ * @returns {Promise<ResponseEnvelopeListJobConfigListDTO>} - Success response
374
757
  * @summary: Get Job Codes By Company And Integration
375
758
  * @description: REST Endpoint that returns all job codes by company And integration
376
759
  */
377
- getJobCodesByCompanyAndIntegration({ integrationId, pageNo, pageSize } = {}) {
760
+ async getJobCodesByCompanyAndIntegration({
761
+ integrationId,
762
+ pageNo,
763
+ pageSize,
764
+ } = {}) {
378
765
  const {
379
766
  error,
380
767
  } = InventoryValidator.getJobCodesByCompanyAndIntegration().validate(
@@ -389,13 +776,33 @@ class Inventory {
389
776
  return Promise.reject(new FDKClientValidationError(error));
390
777
  }
391
778
 
779
+ // Showing warrnings if extra unknown parameters are found
780
+ const {
781
+ error: warrning,
782
+ } = InventoryValidator.getJobCodesByCompanyAndIntegration().validate(
783
+ {
784
+ integrationId,
785
+ pageNo,
786
+ pageSize,
787
+ },
788
+ { abortEarly: false, allowUnknown: false }
789
+ );
790
+ if (warrning) {
791
+ Logger({
792
+ level: "WARN",
793
+ message:
794
+ "Parameter Validation warrnings for getJobCodesByCompanyAndIntegration",
795
+ });
796
+ Logger({ level: "WARN", message: warrning });
797
+ }
798
+
392
799
  const query_params = {};
393
800
  query_params["page_no"] = pageNo;
394
801
  query_params["page_size"] = pageSize;
395
802
 
396
803
  const xHeaders = {};
397
804
 
398
- return PlatformAPIClient.execute(
805
+ const response = await PlatformAPIClient.execute(
399
806
  this.config,
400
807
  "get",
401
808
  `/service/platform/inventory/v1.0/company/${this.config.companyId}/jobs/code/integration/${integrationId}`,
@@ -403,6 +810,24 @@ class Inventory {
403
810
  undefined,
404
811
  xHeaders
405
812
  );
813
+
814
+ const {
815
+ error: res_error,
816
+ } = InventoryModel.ResponseEnvelopeListJobConfigListDTO().validate(
817
+ response,
818
+ { abortEarly: false, allowUnknown: false }
819
+ );
820
+
821
+ if (res_error) {
822
+ Logger({
823
+ level: "WARN",
824
+ message:
825
+ "Response Validation Warnnings for getJobCodesByCompanyAndIntegration",
826
+ });
827
+ Logger({ level: "WARN", message: res_error });
828
+ }
829
+
830
+ return response;
406
831
  }
407
832
  }
408
833