@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 FileStorageValidator = require("./FileStoragePlatformValidator");
5
+ const FileStorageModel = require("./FileStoragePlatformModel");
6
+ const { Logger } = require("./../../common/Logger");
7
+
5
8
  class FileStorage {
6
9
  constructor(config) {
7
10
  this.config = config;
@@ -11,6 +14,7 @@ class FileStorage {
11
14
  * @param {Object} arg - Arg object.
12
15
  * @param {string} arg.namespace - Bucket name
13
16
  * @param {StartRequest} arg.body
17
+ * @returns {Promise<StartResponse>} - Success response
14
18
  * @summary: This operation initiates upload and returns storage link which is valid for 30 Minutes. You can use that storage link to make subsequent upload request with file buffer or blob.
15
19
  * @description: Uploads an arbitrarily sized buffer or blob.
16
20
  *
@@ -31,7 +35,7 @@ class FileStorage {
31
35
  * After successfully upload, call `completeUpload` api to complete the upload process.
32
36
  * This operation will return the url for the uploaded file.
33
37
  */
34
- startUpload({ namespace, body } = {}) {
38
+ async startUpload({ namespace, body } = {}) {
35
39
  const { error } = FileStorageValidator.startUpload().validate(
36
40
  {
37
41
  namespace,
@@ -43,11 +47,27 @@ class FileStorage {
43
47
  return Promise.reject(new FDKClientValidationError(error));
44
48
  }
45
49
 
50
+ // Showing warrnings if extra unknown parameters are found
51
+ const { error: warrning } = FileStorageValidator.startUpload().validate(
52
+ {
53
+ namespace,
54
+ body,
55
+ },
56
+ { abortEarly: false, allowUnknown: false }
57
+ );
58
+ if (warrning) {
59
+ Logger({
60
+ level: "WARN",
61
+ message: "Parameter Validation warrnings for startUpload",
62
+ });
63
+ Logger({ level: "WARN", message: warrning });
64
+ }
65
+
46
66
  const query_params = {};
47
67
 
48
68
  const xHeaders = {};
49
69
 
50
- return PlatformAPIClient.execute(
70
+ const response = await PlatformAPIClient.execute(
51
71
  this.config,
52
72
  "post",
53
73
  `/service/platform/assets/v1.0/company/${this.config.companyId}/namespaces/${namespace}/upload/start/`,
@@ -55,12 +75,30 @@ class FileStorage {
55
75
  body,
56
76
  xHeaders
57
77
  );
78
+
79
+ const {
80
+ error: res_error,
81
+ } = FileStorageModel.StartResponse().validate(response, {
82
+ abortEarly: false,
83
+ allowUnknown: false,
84
+ });
85
+
86
+ if (res_error) {
87
+ Logger({
88
+ level: "WARN",
89
+ message: "Response Validation Warnnings for startUpload",
90
+ });
91
+ Logger({ level: "WARN", message: res_error });
92
+ }
93
+
94
+ return response;
58
95
  }
59
96
 
60
97
  /**
61
98
  * @param {Object} arg - Arg object.
62
99
  * @param {string} arg.namespace - Bucket name
63
100
  * @param {StartResponse} arg.body
101
+ * @returns {Promise<CompleteResponse>} - Success response
64
102
  * @summary: This will complete the upload process. After successfully uploading file, you can call this operation to complete the upload process.
65
103
  * @description: Uploads an arbitrarily sized buffer or blob.
66
104
  *
@@ -81,7 +119,7 @@ class FileStorage {
81
119
  * After successfully upload, call `completeUpload` api to complete the upload process.
82
120
  * This operation will return the url for the uploaded file.
83
121
  */
84
- completeUpload({ namespace, body } = {}) {
122
+ async completeUpload({ namespace, body } = {}) {
85
123
  const { error } = FileStorageValidator.completeUpload().validate(
86
124
  {
87
125
  namespace,
@@ -93,11 +131,27 @@ class FileStorage {
93
131
  return Promise.reject(new FDKClientValidationError(error));
94
132
  }
95
133
 
134
+ // Showing warrnings if extra unknown parameters are found
135
+ const { error: warrning } = FileStorageValidator.completeUpload().validate(
136
+ {
137
+ namespace,
138
+ body,
139
+ },
140
+ { abortEarly: false, allowUnknown: false }
141
+ );
142
+ if (warrning) {
143
+ Logger({
144
+ level: "WARN",
145
+ message: "Parameter Validation warrnings for completeUpload",
146
+ });
147
+ Logger({ level: "WARN", message: warrning });
148
+ }
149
+
96
150
  const query_params = {};
97
151
 
98
152
  const xHeaders = {};
99
153
 
100
- return PlatformAPIClient.execute(
154
+ const response = await PlatformAPIClient.execute(
101
155
  this.config,
102
156
  "post",
103
157
  `/service/platform/assets/v1.0/company/${this.config.companyId}/namespaces/${namespace}/upload/complete/`,
@@ -105,15 +159,33 @@ class FileStorage {
105
159
  body,
106
160
  xHeaders
107
161
  );
162
+
163
+ const {
164
+ error: res_error,
165
+ } = FileStorageModel.CompleteResponse().validate(response, {
166
+ abortEarly: false,
167
+ allowUnknown: false,
168
+ });
169
+
170
+ if (res_error) {
171
+ Logger({
172
+ level: "WARN",
173
+ message: "Response Validation Warnnings for completeUpload",
174
+ });
175
+ Logger({ level: "WARN", message: res_error });
176
+ }
177
+
178
+ return response;
108
179
  }
109
180
 
110
181
  /**
111
182
  * @param {Object} arg - Arg object.
112
183
  * @param {SignUrlRequest} arg.body
184
+ * @returns {Promise<SignUrlResponse>} - Success response
113
185
  * @summary: Gives signed urls to access private files
114
186
  * @description: Describe here
115
187
  */
116
- getSignUrls({ body } = {}) {
188
+ async getSignUrls({ body } = {}) {
117
189
  const { error } = FileStorageValidator.getSignUrls().validate(
118
190
  {
119
191
  body,
@@ -124,11 +196,26 @@ class FileStorage {
124
196
  return Promise.reject(new FDKClientValidationError(error));
125
197
  }
126
198
 
199
+ // Showing warrnings if extra unknown parameters are found
200
+ const { error: warrning } = FileStorageValidator.getSignUrls().validate(
201
+ {
202
+ body,
203
+ },
204
+ { abortEarly: false, allowUnknown: false }
205
+ );
206
+ if (warrning) {
207
+ Logger({
208
+ level: "WARN",
209
+ message: "Parameter Validation warrnings for getSignUrls",
210
+ });
211
+ Logger({ level: "WARN", message: warrning });
212
+ }
213
+
127
214
  const query_params = {};
128
215
 
129
216
  const xHeaders = {};
130
217
 
131
- return PlatformAPIClient.execute(
218
+ const response = await PlatformAPIClient.execute(
132
219
  this.config,
133
220
  "post",
134
221
  `/service/platform/assets/v1.0/company/${this.config.companyId}/sign-urls/`,
@@ -136,16 +223,34 @@ class FileStorage {
136
223
  body,
137
224
  xHeaders
138
225
  );
226
+
227
+ const {
228
+ error: res_error,
229
+ } = FileStorageModel.SignUrlResponse().validate(response, {
230
+ abortEarly: false,
231
+ allowUnknown: false,
232
+ });
233
+
234
+ if (res_error) {
235
+ Logger({
236
+ level: "WARN",
237
+ message: "Response Validation Warnnings for getSignUrls",
238
+ });
239
+ Logger({ level: "WARN", message: res_error });
240
+ }
241
+
242
+ return response;
139
243
  }
140
244
 
141
245
  /**
142
246
  * @param {Object} arg - Arg object.
143
247
  * @param {boolean} [arg.sync] - Sync
144
248
  * @param {BulkRequest} arg.body
249
+ * @returns {Promise<BulkUploadResponse>} - Success response
145
250
  * @summary: Copy Files
146
251
  * @description: Copy Files
147
252
  */
148
- copyFiles({ body, sync } = {}) {
253
+ async copyFiles({ body, sync } = {}) {
149
254
  const { error } = FileStorageValidator.copyFiles().validate(
150
255
  {
151
256
  body,
@@ -157,12 +262,28 @@ class FileStorage {
157
262
  return Promise.reject(new FDKClientValidationError(error));
158
263
  }
159
264
 
265
+ // Showing warrnings if extra unknown parameters are found
266
+ const { error: warrning } = FileStorageValidator.copyFiles().validate(
267
+ {
268
+ body,
269
+ sync,
270
+ },
271
+ { abortEarly: false, allowUnknown: false }
272
+ );
273
+ if (warrning) {
274
+ Logger({
275
+ level: "WARN",
276
+ message: "Parameter Validation warrnings for copyFiles",
277
+ });
278
+ Logger({ level: "WARN", message: warrning });
279
+ }
280
+
160
281
  const query_params = {};
161
282
  query_params["sync"] = sync;
162
283
 
163
284
  const xHeaders = {};
164
285
 
165
- return PlatformAPIClient.execute(
286
+ const response = await PlatformAPIClient.execute(
166
287
  this.config,
167
288
  "post",
168
289
  `/service/platform/assets/v1.0/company/${this.config.companyId}/uploads/copy/`,
@@ -170,16 +291,34 @@ class FileStorage {
170
291
  body,
171
292
  xHeaders
172
293
  );
294
+
295
+ const {
296
+ error: res_error,
297
+ } = FileStorageModel.BulkUploadResponse().validate(response, {
298
+ abortEarly: false,
299
+ allowUnknown: false,
300
+ });
301
+
302
+ if (res_error) {
303
+ Logger({
304
+ level: "WARN",
305
+ message: "Response Validation Warnnings for copyFiles",
306
+ });
307
+ Logger({ level: "WARN", message: res_error });
308
+ }
309
+
310
+ return response;
173
311
  }
174
312
 
175
313
  /**
176
314
  * @param {Object} arg - Arg object.
177
315
  * @param {string} arg.namespace - Bucket name
178
316
  * @param {number} [arg.pageNo] - Page no
317
+ * @returns {Promise<BrowseResponse>} - Success response
179
318
  * @summary: Browse Files
180
319
  * @description: Browse Files
181
320
  */
182
- browse({ namespace, pageNo } = {}) {
321
+ async browse({ namespace, pageNo } = {}) {
183
322
  const { error } = FileStorageValidator.browse().validate(
184
323
  {
185
324
  namespace,
@@ -191,12 +330,28 @@ class FileStorage {
191
330
  return Promise.reject(new FDKClientValidationError(error));
192
331
  }
193
332
 
333
+ // Showing warrnings if extra unknown parameters are found
334
+ const { error: warrning } = FileStorageValidator.browse().validate(
335
+ {
336
+ namespace,
337
+ pageNo,
338
+ },
339
+ { abortEarly: false, allowUnknown: false }
340
+ );
341
+ if (warrning) {
342
+ Logger({
343
+ level: "WARN",
344
+ message: "Parameter Validation warrnings for browse",
345
+ });
346
+ Logger({ level: "WARN", message: warrning });
347
+ }
348
+
194
349
  const query_params = {};
195
350
  query_params["page_no"] = pageNo;
196
351
 
197
352
  const xHeaders = {};
198
353
 
199
- return PlatformAPIClient.execute(
354
+ const response = await PlatformAPIClient.execute(
200
355
  this.config,
201
356
  "get",
202
357
  `/service/platform/assets/v1.0/company/${this.config.companyId}/namespaces/${namespace}/browse/`,
@@ -204,6 +359,23 @@ class FileStorage {
204
359
  undefined,
205
360
  xHeaders
206
361
  );
362
+
363
+ const {
364
+ error: res_error,
365
+ } = FileStorageModel.BrowseResponse().validate(response, {
366
+ abortEarly: false,
367
+ allowUnknown: false,
368
+ });
369
+
370
+ if (res_error) {
371
+ Logger({
372
+ level: "WARN",
373
+ message: "Response Validation Warnnings for browse",
374
+ });
375
+ Logger({ level: "WARN", message: res_error });
376
+ }
377
+
378
+ return response;
207
379
  }
208
380
 
209
381
  /**
@@ -235,10 +407,11 @@ class FileStorage {
235
407
  /**
236
408
  * @param {Object} arg - Arg object.
237
409
  * @param {string} arg.url - Url
410
+ * @returns {Promise<string>} - Success response
238
411
  * @summary: Proxy
239
412
  * @description: Proxy
240
413
  */
241
- proxy({ url } = {}) {
414
+ async proxy({ url } = {}) {
242
415
  const { error } = FileStorageValidator.proxy().validate(
243
416
  {
244
417
  url,
@@ -249,12 +422,27 @@ class FileStorage {
249
422
  return Promise.reject(new FDKClientValidationError(error));
250
423
  }
251
424
 
425
+ // Showing warrnings if extra unknown parameters are found
426
+ const { error: warrning } = FileStorageValidator.proxy().validate(
427
+ {
428
+ url,
429
+ },
430
+ { abortEarly: false, allowUnknown: false }
431
+ );
432
+ if (warrning) {
433
+ Logger({
434
+ level: "WARN",
435
+ message: "Parameter Validation warrnings for proxy",
436
+ });
437
+ Logger({ level: "WARN", message: warrning });
438
+ }
439
+
252
440
  const query_params = {};
253
441
  query_params["url"] = url;
254
442
 
255
443
  const xHeaders = {};
256
444
 
257
- return PlatformAPIClient.execute(
445
+ const response = await PlatformAPIClient.execute(
258
446
  this.config,
259
447
  "post",
260
448
  `/service/platform/assets/v1.0/company/${this.config.companyId}/proxy/`,
@@ -262,6 +450,20 @@ class FileStorage {
262
450
  undefined,
263
451
  xHeaders
264
452
  );
453
+
454
+ const { error: res_error } = Joi.string()
455
+ .allow("")
456
+ .validate(response, { abortEarly: false, allowUnknown: false });
457
+
458
+ if (res_error) {
459
+ Logger({
460
+ level: "WARN",
461
+ message: "Response Validation Warnnings for proxy",
462
+ });
463
+ Logger({ level: "WARN", message: res_error });
464
+ }
465
+
466
+ return response;
265
467
  }
266
468
  }
267
469
 
@@ -6,92 +6,103 @@ declare class Inventory {
6
6
  * @param {Object} arg - Arg object.
7
7
  * @param {number} [arg.pageNo] - Page Number
8
8
  * @param {number} [arg.pageSize] - Page Size
9
+ * @returns {Promise<ResponseEnvelopeListJobConfigRawDTO>} - Success response
9
10
  * @summary: Get Job Configs For A Company
10
11
  * @description: REST Endpoint that returns all job configs for a company
11
12
  */
12
13
  getJobsByCompany({ pageNo, pageSize }?: {
13
14
  pageNo?: number;
14
15
  pageSize?: number;
15
- }): Promise<any>;
16
+ }): Promise<ResponseEnvelopeListJobConfigRawDTO>;
16
17
  /**
17
18
  * @param {Object} arg - Arg object.
18
19
  * @param {JobConfigDTO} arg.body
20
+ * @returns {Promise<ResponseEnvelopeString>} - Success response
19
21
  * @summary: Updates An Existing Job Config
20
22
  * @description: REST Endpoint that updates a job config
21
23
  */
22
24
  updateJob({ body }?: {
23
25
  body: JobConfigDTO;
24
- }): Promise<any>;
26
+ }): Promise<ResponseEnvelopeString>;
25
27
  /**
26
28
  * @param {Object} arg - Arg object.
27
29
  * @param {JobConfigDTO} arg.body
30
+ * @returns {Promise<ResponseEnvelopeString>} - Success response
28
31
  * @summary: Creates A New Job Config
29
32
  * @description: REST Endpoint that creates a new job config
30
33
  */
31
34
  createJob({ body }?: {
32
35
  body: JobConfigDTO;
33
- }): Promise<any>;
36
+ }): Promise<ResponseEnvelopeString>;
34
37
  /**
35
38
  * @param {Object} arg - Arg object.
36
39
  * @param {SuppressStorePayload} arg.body
40
+ * @returns {Promise<ResponseEnvelopeKafkaResponse>} - Success response
37
41
  * @summary: Get Slingshot Configuration Of A Company
38
42
  * @description: REST Endpoint that returns all configuration detail of a company
39
43
  */
40
44
  suppressStores({ body }?: {
41
45
  body: SuppressStorePayload;
42
- }): Promise<any>;
46
+ }): Promise<ResponseEnvelopeKafkaResponse>;
43
47
  /**
44
48
  * @param {Object} arg - Arg object.
49
+ * @returns {Promise<ResponseEnvelopeListSlingshotConfigurationDetail>} -
50
+ * Success response
45
51
  * @summary: Get Slingshot Configuration Of A Company
46
52
  * @description: REST Endpoint that returns all configuration detail of a company
47
53
  */
48
- getConfigByCompany({}?: any): Promise<any>;
54
+ getConfigByCompany({}?: any): Promise<ResponseEnvelopeListSlingshotConfigurationDetail>;
49
55
  /**
50
56
  * @param {Object} arg - Arg object.
51
57
  * @param {number} arg.jobId - Job Id
58
+ * @returns {Promise<ResponseEnvelopeListJobStepsDTO>} - Success response
52
59
  * @summary: Get Job Code Steps
53
60
  * @description: REST Endpoint that returns Inventory Job Steps
54
61
  */
55
62
  getJobSteps({ jobId }?: {
56
63
  jobId: number;
57
- }): Promise<any>;
64
+ }): Promise<ResponseEnvelopeListJobStepsDTO>;
58
65
  /**
59
66
  * @param {Object} arg - Arg object.
60
67
  * @param {string} arg.integrationId - Integration Id
61
68
  * @param {number} [arg.pageNo] - Page Number
62
69
  * @param {number} [arg.pageSize] - Page Size
70
+ * @returns {Promise<ResponseEnvelopeListJobConfigDTO>} - Success response
63
71
  * @summary: Get Job Configs By Company And Integration
64
72
  * @description: REST Endpoint that returns all job configs by company And integration
65
73
  */
66
- getJobByCompanyAndIntegration({ integrationId, pageNo, pageSize }?: {
74
+ getJobByCompanyAndIntegration({ integrationId, pageNo, pageSize, }?: {
67
75
  integrationId: string;
68
76
  pageNo?: number;
69
77
  pageSize?: number;
70
- }): Promise<any>;
78
+ }): Promise<ResponseEnvelopeListJobConfigDTO>;
71
79
  /**
72
80
  * @param {Object} arg - Arg object.
73
81
  * @param {string} arg.integrationId - IntegrationId
82
+ * @returns {Promise<ResponseEnvelopeString>} - Success response
74
83
  * @summary: Disable Job Config
75
84
  * @description: REST Endpoint that disables Inventory Job Config
76
85
  */
77
86
  disable({ integrationId }?: {
78
87
  integrationId: string;
79
- }): Promise<any>;
88
+ }): Promise<ResponseEnvelopeString>;
80
89
  /**
81
90
  * @param {Object} arg - Arg object.
91
+ * @returns {Promise<ResponseEnvelopeJobConfigDTO>} - Success response
82
92
  * @summary: Get Job Configs Defaults
83
93
  * @description: REST Endpoint that returns default fields job configs by company And integration
84
94
  */
85
- getJobConfigDefaults({}?: any): Promise<any>;
95
+ getJobConfigDefaults({}?: any): Promise<ResponseEnvelopeJobConfigDTO>;
86
96
  /**
87
97
  * @param {Object} arg - Arg object.
88
98
  * @param {string} arg.code - Job Code
99
+ * @returns {Promise<ResponseEnvelopeJobConfigDTO>} - Success response
89
100
  * @summary: Get Job Config By Code
90
101
  * @description: REST Endpoint that returns job config by code
91
102
  */
92
103
  getJobByCode({ code }?: {
93
104
  code: string;
94
- }): Promise<any>;
105
+ }): Promise<ResponseEnvelopeJobConfigDTO>;
95
106
  /**
96
107
  * @param {Object} arg - Arg object.
97
108
  * @param {string} arg.code - Code
@@ -99,6 +110,7 @@ declare class Inventory {
99
110
  * @param {number} [arg.pageSize] - Page Size
100
111
  * @param {string} [arg.status] - Status
101
112
  * @param {string} [arg.date] - From Date
113
+ * @returns {Promise<ResponseEnvelopeJobMetricsDto>} - Success response
102
114
  * @summary: Get Job Metrics
103
115
  * @description: REST Endpoint that returns Inventory Run History For A Job Code
104
116
  */
@@ -108,18 +120,19 @@ declare class Inventory {
108
120
  pageSize?: number;
109
121
  status?: string;
110
122
  date?: string;
111
- }): Promise<any>;
123
+ }): Promise<ResponseEnvelopeJobMetricsDto>;
112
124
  /**
113
125
  * @param {Object} arg - Arg object.
114
126
  * @param {string} arg.integrationId - Integration Id
115
127
  * @param {number} [arg.pageNo] - Page Number
116
128
  * @param {number} [arg.pageSize] - Page Size
129
+ * @returns {Promise<ResponseEnvelopeListJobConfigListDTO>} - Success response
117
130
  * @summary: Get Job Codes By Company And Integration
118
131
  * @description: REST Endpoint that returns all job codes by company And integration
119
132
  */
120
- getJobCodesByCompanyAndIntegration({ integrationId, pageNo, pageSize }?: {
133
+ getJobCodesByCompanyAndIntegration({ integrationId, pageNo, pageSize, }?: {
121
134
  integrationId: string;
122
135
  pageNo?: number;
123
136
  pageSize?: number;
124
- }): Promise<any>;
137
+ }): Promise<ResponseEnvelopeListJobConfigListDTO>;
125
138
  }