@gofynd/fdk-client-javascript 1.0.1 → 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 (134) hide show
  1. package/documentation/application/CART.md +251 -251
  2. package/documentation/application/CATALOG.md +414 -414
  3. package/documentation/application/CONTENT.md +15 -1
  4. package/documentation/application/ORDER.md +290 -290
  5. package/documentation/application/PAYMENT.md +255 -255
  6. package/documentation/application/POSCART.md +297 -297
  7. package/documentation/platform/CART.md +499 -499
  8. package/documentation/platform/CATALOG.md +3088 -2702
  9. package/documentation/platform/COMPANYPROFILE.md +201 -201
  10. package/documentation/platform/CONTENT.md +123 -1
  11. package/documentation/platform/ORDER.md +1233 -1158
  12. package/documentation/platform/PARTNER.md +7 -7
  13. package/documentation/platform/PAYMENT.md +83 -83
  14. package/package.json +1 -1
  15. package/sdk/application/ApplicationConfig.js +1 -1
  16. package/sdk/application/Cart/CartApplicationClient.js +619 -108
  17. package/sdk/application/Cart/CartApplicationModel.d.ts +7 -7
  18. package/sdk/application/Cart/CartApplicationModel.js +335 -335
  19. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +1 -1
  20. package/sdk/application/Catalog/CatalogApplicationClient.js +730 -134
  21. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +21 -21
  22. package/sdk/application/Catalog/CatalogApplicationModel.js +547 -547
  23. package/sdk/application/Common/CommonApplicationClient.js +48 -8
  24. package/sdk/application/Communication/CommunicationApplicationClient.js +75 -14
  25. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +1 -1
  26. package/sdk/application/Configuration/ConfigurationApplicationClient.js +392 -66
  27. package/sdk/application/Content/ContentApplicationClient.js +444 -76
  28. package/sdk/application/Content/ContentApplicationModel.d.ts +1 -0
  29. package/sdk/application/Content/ContentApplicationModel.js +11 -1
  30. package/sdk/application/FileStorage/FileStorageApplicationClient.js +74 -12
  31. package/sdk/application/Lead/LeadApplicationClient.js +164 -30
  32. package/sdk/application/Logistic/LogisticApplicationClient.js +98 -16
  33. package/sdk/application/Order/OrderApplicationClient.d.ts +1 -1
  34. package/sdk/application/Order/OrderApplicationClient.js +287 -54
  35. package/sdk/application/Order/OrderApplicationModel.d.ts +19 -19
  36. package/sdk/application/Order/OrderApplicationModel.js +357 -357
  37. package/sdk/application/Payment/PaymentApplicationClient.js +961 -186
  38. package/sdk/application/Payment/PaymentApplicationModel.d.ts +3 -3
  39. package/sdk/application/Payment/PaymentApplicationModel.js +352 -352
  40. package/sdk/application/PosCart/PosCartApplicationClient.js +645 -114
  41. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +15 -15
  42. package/sdk/application/PosCart/PosCartApplicationModel.js +389 -389
  43. package/sdk/application/Rewards/RewardsApplicationClient.js +168 -28
  44. package/sdk/application/Share/ShareApplicationClient.js +157 -32
  45. package/sdk/application/Theme/ThemeApplicationClient.js +94 -16
  46. package/sdk/application/User/UserApplicationClient.js +806 -148
  47. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +16 -8
  48. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +191 -34
  49. package/sdk/platform/Analytics/AnalyticsPlatformClient.d.ts +8 -4
  50. package/sdk/platform/Analytics/AnalyticsPlatformClient.js +103 -16
  51. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +8 -4
  52. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +103 -16
  53. package/sdk/platform/Billing/BillingPlatformClient.d.ts +24 -12
  54. package/sdk/platform/Billing/BillingPlatformClient.js +299 -54
  55. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +34 -17
  56. package/sdk/platform/Cart/CartPlatformApplicationClient.js +409 -72
  57. package/sdk/platform/Cart/CartPlatformModel.d.ts +35 -35
  58. package/sdk/platform/Cart/CartPlatformModel.js +617 -617
  59. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +167 -114
  60. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1562 -453
  61. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +8 -8
  62. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +39 -39
  63. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +314 -196
  64. package/sdk/platform/Catalog/CatalogPlatformClient.js +2459 -718
  65. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +103 -94
  66. package/sdk/platform/Catalog/CatalogPlatformModel.js +2063 -1797
  67. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +17 -15
  68. package/sdk/platform/Catalog/CatalogPlatformValidator.js +95 -76
  69. package/sdk/platform/Common/CommonPlatformClient.d.ts +4 -2
  70. package/sdk/platform/Common/CommonPlatformClient.js +51 -8
  71. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +80 -40
  72. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +1000 -168
  73. package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +2 -1
  74. package/sdk/platform/Communication/CommunicationPlatformClient.js +28 -4
  75. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +27 -14
  76. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +335 -54
  77. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +10 -10
  78. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +278 -278
  79. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +56 -28
  80. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +702 -118
  81. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +36 -18
  82. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +457 -82
  83. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +148 -67
  84. package/sdk/platform/Content/ContentPlatformApplicationClient.js +1724 -284
  85. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +1 -0
  86. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +7 -0
  87. package/sdk/platform/Content/ContentPlatformModel.d.ts +4 -0
  88. package/sdk/platform/Content/ContentPlatformModel.js +43 -1
  89. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +21 -10
  90. package/sdk/platform/Discount/DiscountPlatformClient.js +270 -44
  91. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +8 -4
  92. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +102 -16
  93. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +12 -6
  94. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +150 -24
  95. package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +27 -14
  96. package/sdk/platform/Inventory/InventoryPlatformClient.js +316 -52
  97. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +26 -13
  98. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +311 -52
  99. package/sdk/platform/Lead/LeadPlatformClient.d.ts +22 -11
  100. package/sdk/platform/Lead/LeadPlatformClient.js +266 -44
  101. package/sdk/platform/OAuthClient.js +8 -8
  102. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +6 -3
  103. package/sdk/platform/Order/OrderPlatformApplicationClient.js +78 -14
  104. package/sdk/platform/Order/OrderPlatformClient.d.ts +95 -43
  105. package/sdk/platform/Order/OrderPlatformClient.js +1062 -180
  106. package/sdk/platform/Order/OrderPlatformModel.d.ts +64 -60
  107. package/sdk/platform/Order/OrderPlatformModel.js +1481 -1425
  108. package/sdk/platform/Order/OrderPlatformValidator.js +5 -0
  109. package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -2
  110. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +52 -8
  111. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -1
  112. package/sdk/platform/Partner/PartnerPlatformModel.js +8 -8
  113. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +22 -11
  114. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +287 -56
  115. package/sdk/platform/Payment/PaymentPlatformClient.d.ts +21 -11
  116. package/sdk/platform/Payment/PaymentPlatformClient.js +263 -48
  117. package/sdk/platform/Payment/PaymentPlatformModel.js +122 -122
  118. package/sdk/platform/PlatformApplicationClient.d.ts +2959 -2787
  119. package/sdk/platform/PlatformApplicationClient.js +3420 -3212
  120. package/sdk/platform/PlatformClient.d.ts +2959 -2787
  121. package/sdk/platform/PlatformClient.js +3420 -3212
  122. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +26 -13
  123. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +308 -54
  124. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +8 -4
  125. package/sdk/platform/Share/SharePlatformApplicationClient.js +94 -16
  126. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +47 -23
  127. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +571 -96
  128. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +24 -12
  129. package/sdk/platform/User/UserPlatformApplicationClient.js +296 -48
  130. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +12 -6
  131. package/sdk/platform/Webhook/WebhookPlatformClient.js +157 -30
  132. package/sdk/public/Configuration/ConfigurationPublicClient.js +51 -8
  133. package/sdk/public/Inventory/InventoryPublicClient.js +149 -26
  134. package/sdk/public/Webhook/WebhookPublicClient.js +51 -10
@@ -1,11 +1,11 @@
1
1
  export = CatalogValidator;
2
2
  declare class CatalogValidator {
3
- static getProductBundle(): any;
4
3
  static createProductBundle(): any;
4
+ static getProductBundle(): any;
5
5
  static getProductBundleDetail(): any;
6
6
  static updateProductBundle(): any;
7
- static getSizeGuides(): any;
8
7
  static createSizeGuide(): any;
8
+ static getSizeGuides(): any;
9
9
  static getSizeGuide(): any;
10
10
  static updateSizeGuide(): any;
11
11
  static getSellerInsights(): any;
@@ -17,8 +17,8 @@ declare class CatalogValidator {
17
17
  static getStoreDetail(): any;
18
18
  static getGenderAttribute(): any;
19
19
  static listProductTemplateCategories(): any;
20
- static listDepartmentsData(): any;
21
20
  static createDepartments(): any;
21
+ static listDepartmentsData(): any;
22
22
  static getDepartmentData(): any;
23
23
  static updateDepartment(): any;
24
24
  static listProductTemplate(): any;
@@ -28,13 +28,15 @@ declare class CatalogValidator {
28
28
  static validateProductTemplateSchema(): any;
29
29
  static listHSNCodes(): any;
30
30
  static listProductTemplateExportDetails(): any;
31
+ static createProductExportJob(): any;
32
+ static getProductExportJobs(): any;
31
33
  static listTemplateBrandTypeValues(): any;
32
- static listCategories(): any;
33
34
  static createCategories(): any;
35
+ static listCategories(): any;
34
36
  static getCategoryData(): any;
35
37
  static updateCategory(): any;
36
- static getProducts(): any;
37
38
  static createProduct(): any;
39
+ static getProducts(): any;
38
40
  static getVariantsOfProducts(): any;
39
41
  static getProductAttributes(): any;
40
42
  static getProduct(): any;
@@ -43,32 +45,32 @@ declare class CatalogValidator {
43
45
  static allSizes(): any;
44
46
  static getProductValidation(): any;
45
47
  static getProductSize(): any;
46
- static getProductBulkUploadHistory(): any;
47
48
  static createBulkProductUploadJob(): any;
49
+ static getProductBulkUploadHistory(): any;
48
50
  static uploadBulkProducts(): any;
49
- static deleteProductBulkJob(): any;
50
51
  static createProductsInBulk(): any;
52
+ static deleteProductBulkJob(): any;
51
53
  static getProductTags(): any;
52
- static getProductAssetsInBulk(): any;
53
54
  static createProductAssetsInBulk(): any;
55
+ static getProductAssetsInBulk(): any;
54
56
  static deleteSize(): any;
55
- static getInventoryBySize(): any;
56
57
  static addInventory(): any;
58
+ static getInventoryBySize(): any;
57
59
  static getInventoryBySizeIdentifier(): any;
58
60
  static getInventories(): any;
59
61
  static deleteInventory(): any;
60
- static getInventoryBulkUploadHistory(): any;
61
62
  static createBulkInventoryJob(): any;
62
- static deleteBulkInventoryJob(): any;
63
+ static getInventoryBulkUploadHistory(): any;
63
64
  static createBulkInventory(): any;
64
- static getInventoryExport(): any;
65
+ static deleteBulkInventoryJob(): any;
65
66
  static createInventoryExportJob(): any;
67
+ static getInventoryExport(): any;
68
+ static createInventoryExport(): any;
69
+ static listInventoryExport(): any;
66
70
  static exportInventoryConfig(): any;
67
- static deleteRealtimeInventory(): any;
68
71
  static updateRealtimeInventory(): any;
72
+ static deleteRealtimeInventory(): any;
69
73
  static updateInventories(): any;
70
- static getAllHsnCodes(): any;
71
- static createHsnCode(): any;
72
74
  static getHsnCode(): any;
73
75
  static updateHsnCode(): any;
74
76
  static bulkHsnCode(): any;
@@ -2,16 +2,16 @@ const Joi = require("joi");
2
2
 
3
3
  const CatalogModel = require("./CatalogPlatformModel");
4
4
  class CatalogValidator {
5
- static getProductBundle() {
5
+ static createProductBundle() {
6
6
  return Joi.object({
7
- q: Joi.string().allow(""),
8
- slug: Joi.array().items(Joi.string().allow("")),
7
+ body: CatalogModel.ProductBundleRequest().required(),
9
8
  }).required();
10
9
  }
11
10
 
12
- static createProductBundle() {
11
+ static getProductBundle() {
13
12
  return Joi.object({
14
- body: CatalogModel.ProductBundleRequest().required(),
13
+ q: Joi.string().allow(""),
14
+ slug: Joi.array().items(Joi.string().allow("")),
15
15
  }).required();
16
16
  }
17
17
 
@@ -28,6 +28,12 @@ class CatalogValidator {
28
28
  }).required();
29
29
  }
30
30
 
31
+ static createSizeGuide() {
32
+ return Joi.object({
33
+ body: CatalogModel.ValidateSizeGuide().required(),
34
+ }).required();
35
+ }
36
+
31
37
  static getSizeGuides() {
32
38
  return Joi.object({
33
39
  active: Joi.boolean(),
@@ -38,12 +44,6 @@ class CatalogValidator {
38
44
  }).required();
39
45
  }
40
46
 
41
- static createSizeGuide() {
42
- return Joi.object({
43
- body: CatalogModel.ValidateSizeGuide().required(),
44
- }).required();
45
- }
46
-
47
47
  static getSizeGuide() {
48
48
  return Joi.object({
49
49
  id: Joi.string().allow("").required(),
@@ -113,9 +113,16 @@ class CatalogValidator {
113
113
  }).required();
114
114
  }
115
115
 
116
+ static createDepartments() {
117
+ return Joi.object({
118
+ body: CatalogModel.DepartmentCreateUpdate().required(),
119
+ }).required();
120
+ }
121
+
116
122
  static listDepartmentsData() {
117
123
  return Joi.object({
118
124
  pageNo: Joi.number(),
125
+ itemType: Joi.string().allow(""),
119
126
  pageSize: Joi.number(),
120
127
  name: Joi.string().allow(""),
121
128
  search: Joi.string().allow(""),
@@ -123,12 +130,6 @@ class CatalogValidator {
123
130
  }).required();
124
131
  }
125
132
 
126
- static createDepartments() {
127
- return Joi.object({
128
- body: CatalogModel.DepartmentCreateUpdate().required(),
129
- }).required();
130
- }
131
-
132
133
  static getDepartmentData() {
133
134
  return Joi.object({
134
135
  uid: Joi.string().allow("").required(),
@@ -180,9 +181,32 @@ class CatalogValidator {
180
181
  return Joi.object({}).required();
181
182
  }
182
183
 
184
+ static createProductExportJob() {
185
+ return Joi.object({
186
+ body: CatalogModel.ProductTemplateDownloadsExport().required(),
187
+ }).required();
188
+ }
189
+
190
+ static getProductExportJobs() {
191
+ return Joi.object({
192
+ status: Joi.string().allow(""),
193
+ fromDate: Joi.string().allow(""),
194
+ toDate: Joi.string().allow(""),
195
+ q: Joi.string().allow(""),
196
+ }).required();
197
+ }
198
+
183
199
  static listTemplateBrandTypeValues() {
184
200
  return Joi.object({
185
201
  filter: Joi.string().allow("").required(),
202
+ templateTag: Joi.string().allow(""),
203
+ itemType: Joi.string().allow(""),
204
+ }).required();
205
+ }
206
+
207
+ static createCategories() {
208
+ return Joi.object({
209
+ body: CatalogModel.CategoryRequestBody().required(),
186
210
  }).required();
187
211
  }
188
212
 
@@ -196,12 +220,6 @@ class CatalogValidator {
196
220
  }).required();
197
221
  }
198
222
 
199
- static createCategories() {
200
- return Joi.object({
201
- body: CatalogModel.CategoryRequestBody().required(),
202
- }).required();
203
- }
204
-
205
223
  static getCategoryData() {
206
224
  return Joi.object({
207
225
  uid: Joi.string().allow("").required(),
@@ -215,6 +233,12 @@ class CatalogValidator {
215
233
  }).required();
216
234
  }
217
235
 
236
+ static createProduct() {
237
+ return Joi.object({
238
+ body: CatalogModel.ProductCreateUpdateSchemaV2().required(),
239
+ }).required();
240
+ }
241
+
218
242
  static getProducts() {
219
243
  return Joi.object({
220
244
  brandIds: Joi.array().items(Joi.number()),
@@ -229,12 +253,6 @@ class CatalogValidator {
229
253
  }).required();
230
254
  }
231
255
 
232
- static createProduct() {
233
- return Joi.object({
234
- body: CatalogModel.ProductCreateUpdateSchemaV2().required(),
235
- }).required();
236
- }
237
-
238
256
  static getVariantsOfProducts() {
239
257
  return Joi.object({
240
258
  itemId: Joi.number().required(),
@@ -291,17 +309,17 @@ class CatalogValidator {
291
309
  }).required();
292
310
  }
293
311
 
294
- static getProductBulkUploadHistory() {
312
+ static createBulkProductUploadJob() {
295
313
  return Joi.object({
296
- search: Joi.string().allow(""),
297
- pageNo: Joi.number(),
298
- pageSize: Joi.number(),
314
+ body: CatalogModel.BulkJob().required(),
299
315
  }).required();
300
316
  }
301
317
 
302
- static createBulkProductUploadJob() {
318
+ static getProductBulkUploadHistory() {
303
319
  return Joi.object({
304
- body: CatalogModel.BulkJob().required(),
320
+ search: Joi.string().allow(""),
321
+ pageNo: Joi.number(),
322
+ pageSize: Joi.number(),
305
323
  }).required();
306
324
  }
307
325
 
@@ -313,16 +331,16 @@ class CatalogValidator {
313
331
  }).required();
314
332
  }
315
333
 
316
- static deleteProductBulkJob() {
334
+ static createProductsInBulk() {
317
335
  return Joi.object({
318
- batchId: Joi.number().required(),
336
+ batchId: Joi.string().allow("").required(),
337
+ body: CatalogModel.BulkProductRequest().required(),
319
338
  }).required();
320
339
  }
321
340
 
322
- static createProductsInBulk() {
341
+ static deleteProductBulkJob() {
323
342
  return Joi.object({
324
- batchId: Joi.string().allow("").required(),
325
- body: CatalogModel.BulkProductRequest().required(),
343
+ batchId: Joi.number().required(),
326
344
  }).required();
327
345
  }
328
346
 
@@ -330,6 +348,12 @@ class CatalogValidator {
330
348
  return Joi.object({}).required();
331
349
  }
332
350
 
351
+ static createProductAssetsInBulk() {
352
+ return Joi.object({
353
+ body: CatalogModel.ProductBulkAssets().required(),
354
+ }).required();
355
+ }
356
+
333
357
  static getProductAssetsInBulk() {
334
358
  return Joi.object({
335
359
  pageNo: Joi.number(),
@@ -337,22 +361,24 @@ class CatalogValidator {
337
361
  }).required();
338
362
  }
339
363
 
340
- static createProductAssetsInBulk() {
364
+ static deleteSize() {
341
365
  return Joi.object({
342
- body: CatalogModel.ProductBulkAssets().required(),
366
+ itemId: Joi.number().required(),
367
+ size: Joi.string().allow("").required(),
343
368
  }).required();
344
369
  }
345
370
 
346
- static deleteSize() {
371
+ static addInventory() {
347
372
  return Joi.object({
348
373
  itemId: Joi.number().required(),
349
374
  size: Joi.string().allow("").required(),
375
+ body: CatalogModel.InventoryRequest().required(),
350
376
  }).required();
351
377
  }
352
378
 
353
379
  static getInventoryBySize() {
354
380
  return Joi.object({
355
- itemId: Joi.string().allow("").required(),
381
+ itemId: Joi.number().required(),
356
382
  size: Joi.string().allow("").required(),
357
383
  pageNo: Joi.number(),
358
384
  pageSize: Joi.number(),
@@ -361,17 +387,9 @@ class CatalogValidator {
361
387
  }).required();
362
388
  }
363
389
 
364
- static addInventory() {
365
- return Joi.object({
366
- itemId: Joi.number().required(),
367
- size: Joi.string().allow("").required(),
368
- body: CatalogModel.InventoryRequest().required(),
369
- }).required();
370
- }
371
-
372
390
  static getInventoryBySizeIdentifier() {
373
391
  return Joi.object({
374
- itemId: Joi.string().allow("").required(),
392
+ itemId: Joi.number().required(),
375
393
  sizeIdentifier: Joi.string().allow("").required(),
376
394
  pageNo: Joi.number(),
377
395
  pageSize: Joi.number(),
@@ -401,6 +419,12 @@ class CatalogValidator {
401
419
  }).required();
402
420
  }
403
421
 
422
+ static createBulkInventoryJob() {
423
+ return Joi.object({
424
+ body: CatalogModel.BulkJob().required(),
425
+ }).required();
426
+ }
427
+
404
428
  static getInventoryBulkUploadHistory() {
405
429
  return Joi.object({
406
430
  pageNo: Joi.number(),
@@ -408,9 +432,10 @@ class CatalogValidator {
408
432
  }).required();
409
433
  }
410
434
 
411
- static createBulkInventoryJob() {
435
+ static createBulkInventory() {
412
436
  return Joi.object({
413
- body: CatalogModel.BulkJob().required(),
437
+ batchId: Joi.string().allow("").required(),
438
+ body: CatalogModel.InventoryBulkRequest().required(),
414
439
  }).required();
415
440
  }
416
441
 
@@ -420,10 +445,9 @@ class CatalogValidator {
420
445
  }).required();
421
446
  }
422
447
 
423
- static createBulkInventory() {
448
+ static createInventoryExportJob() {
424
449
  return Joi.object({
425
- batchId: Joi.string().allow("").required(),
426
- body: CatalogModel.InventoryBulkRequest().required(),
450
+ body: CatalogModel.InventoryExportRequest().required(),
427
451
  }).required();
428
452
  }
429
453
 
@@ -431,9 +455,18 @@ class CatalogValidator {
431
455
  return Joi.object({}).required();
432
456
  }
433
457
 
434
- static createInventoryExportJob() {
458
+ static createInventoryExport() {
435
459
  return Joi.object({
436
- body: CatalogModel.InventoryExportRequest().required(),
460
+ body: CatalogModel.InventoryCreateRequest().required(),
461
+ }).required();
462
+ }
463
+
464
+ static listInventoryExport() {
465
+ return Joi.object({
466
+ status: Joi.string().allow(""),
467
+ fromDate: Joi.string().allow(""),
468
+ toDate: Joi.string().allow(""),
469
+ q: Joi.string().allow(""),
437
470
  }).required();
438
471
  }
439
472
 
@@ -443,7 +476,7 @@ class CatalogValidator {
443
476
  }).required();
444
477
  }
445
478
 
446
- static deleteRealtimeInventory() {
479
+ static updateRealtimeInventory() {
447
480
  return Joi.object({
448
481
  itemId: Joi.number().required(),
449
482
  sellerIdentifier: Joi.string().allow("").required(),
@@ -451,7 +484,7 @@ class CatalogValidator {
451
484
  }).required();
452
485
  }
453
486
 
454
- static updateRealtimeInventory() {
487
+ static deleteRealtimeInventory() {
455
488
  return Joi.object({
456
489
  itemId: Joi.number().required(),
457
490
  sellerIdentifier: Joi.string().allow("").required(),
@@ -465,20 +498,6 @@ class CatalogValidator {
465
498
  }).required();
466
499
  }
467
500
 
468
- static getAllHsnCodes() {
469
- return Joi.object({
470
- pageNo: Joi.number(),
471
- pageSize: Joi.number(),
472
- q: Joi.string().allow(""),
473
- }).required();
474
- }
475
-
476
- static createHsnCode() {
477
- return Joi.object({
478
- body: CatalogModel.HsnUpsert().required(),
479
- }).required();
480
- }
481
-
482
501
  static getHsnCode() {
483
502
  return Joi.object({
484
503
  id: Joi.string().allow("").required(),
@@ -6,13 +6,14 @@ declare class Common {
6
6
  * @param {Object} arg - Arg object.
7
7
  * @param {string} [arg.authorization] -
8
8
  * @param {string} [arg.query] - Provide application name
9
+ * @returns {Promise<ApplicationResponse>} - Success response
9
10
  * @summary: Search Application
10
11
  * @description: Provide application name or domain url
11
12
  */
12
13
  searchApplication({ authorization, query }?: {
13
14
  authorization?: string;
14
15
  query?: string;
15
- }): Promise<any>;
16
+ }): Promise<ApplicationResponse>;
16
17
  /**
17
18
  * @param {Object} arg - Arg object.
18
19
  * @param {string} [arg.locationType] - Provide location type to query on.
@@ -20,11 +21,12 @@ declare class Common {
20
21
  * @param {string} [arg.id] - Field is optional when location_type is
21
22
  * country. If querying for state, provide id of country. If querying for
22
23
  * city, provide id of state.
24
+ * @returns {Promise<Locations>} - Success response
23
25
  * @summary: Get countries, states, cities
24
26
  * @description:
25
27
  */
26
28
  getLocations({ locationType, id }?: {
27
29
  locationType?: string;
28
30
  id?: string;
29
- }): Promise<any>;
31
+ }): Promise<Locations>;
30
32
  }
@@ -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 CommonValidator = require("./CommonPlatformValidator");
5
+ const CommonModel = require("./CommonPlatformModel");
6
+ const { Logger } = require("./../../common/Logger");
7
+
5
8
  class Common {
6
9
  constructor(config) {
7
10
  this.config = config;
@@ -11,10 +14,11 @@ class Common {
11
14
  * @param {Object} arg - Arg object.
12
15
  * @param {string} [arg.authorization] -
13
16
  * @param {string} [arg.query] - Provide application name
17
+ * @returns {Promise<ApplicationResponse>} - Success response
14
18
  * @summary: Search Application
15
19
  * @description: Provide application name or domain url
16
20
  */
17
- searchApplication({ authorization, query } = {}) {
21
+ async searchApplication({ authorization, query } = {}) {
18
22
  const { error } = CommonValidator.searchApplication().validate(
19
23
  {
20
24
  authorization,
@@ -35,8 +39,11 @@ class Common {
35
39
  { abortEarly: false, allowUnknown: false }
36
40
  );
37
41
  if (warrning) {
38
- console.log("Parameter Validation warrnings for searchApplication");
39
- console.log(warrning);
42
+ Logger({
43
+ level: "WARN",
44
+ message: "Parameter Validation warrnings for searchApplication",
45
+ });
46
+ Logger({ level: "WARN", message: warrning });
40
47
  }
41
48
 
42
49
  const query_params = {};
@@ -45,7 +52,7 @@ class Common {
45
52
  const xHeaders = {};
46
53
  xHeaders["authorization"] = authorization;
47
54
 
48
- return PlatformAPIClient.execute(
55
+ const response = await PlatformAPIClient.execute(
49
56
  this.config,
50
57
  "get",
51
58
  `/service/common/configuration/v1.0/application/search-application`,
@@ -53,6 +60,23 @@ class Common {
53
60
  undefined,
54
61
  xHeaders
55
62
  );
63
+
64
+ const {
65
+ error: res_error,
66
+ } = CommonModel.ApplicationResponse().validate(response, {
67
+ abortEarly: false,
68
+ allowUnknown: false,
69
+ });
70
+
71
+ if (res_error) {
72
+ Logger({
73
+ level: "WARN",
74
+ message: "Response Validation Warnnings for searchApplication",
75
+ });
76
+ Logger({ level: "WARN", message: res_error });
77
+ }
78
+
79
+ return response;
56
80
  }
57
81
 
58
82
  /**
@@ -62,10 +86,11 @@ class Common {
62
86
  * @param {string} [arg.id] - Field is optional when location_type is
63
87
  * country. If querying for state, provide id of country. If querying for
64
88
  * city, provide id of state.
89
+ * @returns {Promise<Locations>} - Success response
65
90
  * @summary: Get countries, states, cities
66
91
  * @description:
67
92
  */
68
- getLocations({ locationType, id } = {}) {
93
+ async getLocations({ locationType, id } = {}) {
69
94
  const { error } = CommonValidator.getLocations().validate(
70
95
  {
71
96
  locationType,
@@ -86,8 +111,11 @@ class Common {
86
111
  { abortEarly: false, allowUnknown: false }
87
112
  );
88
113
  if (warrning) {
89
- console.log("Parameter Validation warrnings for getLocations");
90
- console.log(warrning);
114
+ Logger({
115
+ level: "WARN",
116
+ message: "Parameter Validation warrnings for getLocations",
117
+ });
118
+ Logger({ level: "WARN", message: warrning });
91
119
  }
92
120
 
93
121
  const query_params = {};
@@ -96,7 +124,7 @@ class Common {
96
124
 
97
125
  const xHeaders = {};
98
126
 
99
- return PlatformAPIClient.execute(
127
+ const response = await PlatformAPIClient.execute(
100
128
  this.config,
101
129
  "get",
102
130
  `/service/common/configuration/v1.0/location`,
@@ -104,6 +132,21 @@ class Common {
104
132
  undefined,
105
133
  xHeaders
106
134
  );
135
+
136
+ const { error: res_error } = CommonModel.Locations().validate(response, {
137
+ abortEarly: false,
138
+ allowUnknown: false,
139
+ });
140
+
141
+ if (res_error) {
142
+ Logger({
143
+ level: "WARN",
144
+ message: "Response Validation Warnnings for getLocations",
145
+ });
146
+ Logger({ level: "WARN", message: res_error });
147
+ }
148
+
149
+ return response;
107
150
  }
108
151
  }
109
152