@gofynd/fdk-client-javascript 0.1.36 → 0.1.37

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 (36) hide show
  1. package/documentation/application/CART.md +291 -285
  2. package/documentation/application/CATALOG.md +411 -411
  3. package/documentation/application/LOGISTIC.md +423 -101
  4. package/documentation/application/ORDER.md +287 -287
  5. package/documentation/application/POSCART.md +319 -313
  6. package/documentation/application/README.md +1 -1
  7. package/documentation/platform/AUDITTRAIL.md +2 -2
  8. package/documentation/platform/CART.md +488 -488
  9. package/documentation/platform/CATALOG.md +1656 -1439
  10. package/documentation/platform/COMPANYPROFILE.md +250 -229
  11. package/documentation/platform/ORDER.md +1183 -1183
  12. package/package.json +2 -2
  13. package/sdk/application/ApplicationAPIClient.js +3 -0
  14. package/sdk/application/ApplicationClient.d.ts +1 -0
  15. package/sdk/application/ApplicationClient.js +11 -1
  16. package/sdk/application/ApplicationConfig.d.ts +1 -0
  17. package/sdk/application/ApplicationConfig.js +1 -0
  18. package/sdk/application/ApplicationModels.d.ts +83 -78
  19. package/sdk/application/ApplicationModels.js +1445 -1354
  20. package/sdk/application/client/LogisticApplicationClient.d.ts +32 -21
  21. package/sdk/application/client/LogisticApplicationClient.js +62 -27
  22. package/sdk/application/models/LogisticValidator.d.ts +2 -1
  23. package/sdk/application/models/LogisticValidator.js +11 -6
  24. package/sdk/common/AxiosHelper.js +1 -1
  25. package/sdk/platform/PlatformApplicationClient.d.ts +5328 -5185
  26. package/sdk/platform/PlatformApplicationClient.js +2877 -2795
  27. package/sdk/platform/PlatformApplicationModels.d.ts +5 -5
  28. package/sdk/platform/PlatformApplicationModels.js +3707 -3571
  29. package/sdk/platform/PlatformClient.d.ts +2577 -2509
  30. package/sdk/platform/PlatformClient.js +2770 -2688
  31. package/sdk/platform/PlatformModels.d.ts +146 -139
  32. package/sdk/platform/PlatformModels.js +3718 -3582
  33. package/sdk/platform/client/CatalogPlatformClient.d.ts +21 -12
  34. package/sdk/platform/client/CatalogPlatformClient.js +48 -17
  35. package/sdk/platform/models/CatalogValidator.d.ts +2 -1
  36. package/sdk/platform/models/CatalogValidator.js +11 -5
@@ -360,12 +360,12 @@ declare class Catalog {
360
360
  }): Promise<any>;
361
361
  /**
362
362
  * @param {Object} arg - Arg object.
363
- * @param {ProductCreateUpdate} arg.body
363
+ * @param {ProductCreateUpdateSchemaV2} arg.body
364
364
  * @summary: Create a product.
365
365
  * @description: This API allows to create product.
366
366
  */
367
367
  createProduct({ body }?: {
368
- body: ProductCreateUpdate;
368
+ body: ProductCreateUpdateSchemaV2;
369
369
  }): Promise<any>;
370
370
  /**
371
371
  * @param {Object} arg - Arg object.
@@ -428,34 +428,43 @@ declare class Catalog {
428
428
  /**
429
429
  * @param {Object} arg - Arg object.
430
430
  * @param {number} arg.itemId - Id of the product to be updated.
431
- * @param {ProductCreateUpdate} arg.body
431
+ * @summary: Delete a product.
432
+ * @description: This API allows to delete product.
433
+ */
434
+ deleteProduct({ itemId }?: {
435
+ itemId: number;
436
+ }): Promise<any>;
437
+ /**
438
+ * @param {Object} arg - Arg object.
439
+ * @param {number} arg.itemId - Id of the product to be updated.
440
+ * @param {ProductCreateUpdateSchemaV2} arg.body
432
441
  * @summary: Edit a product.
433
442
  * @description: This API allows to edit product.
434
443
  */
435
444
  editProduct({ itemId, body }?: {
436
445
  itemId: number;
437
- body: ProductCreateUpdate;
446
+ body: ProductCreateUpdateSchemaV2;
438
447
  }): Promise<any>;
439
448
  /**
440
449
  * @param {Object} arg - Arg object.
441
- * @param {string} [arg.itemCode] - Item code of the product.
442
450
  * @param {number} arg.itemId - Item Id of the product.
443
451
  * @param {number} [arg.brandUid] - Brand Id of the product.
452
+ * @param {string} [arg.itemCode] - Item code of the product.
444
453
  * @summary: Get a single product.
445
454
  * @description: This API helps to get data associated to a particular product.
446
455
  */
447
- getProduct({ itemId, itemCode, brandUid }?: {
448
- itemCode?: string;
456
+ getProduct({ itemId, brandUid, itemCode }?: {
449
457
  itemId: number;
450
458
  brandUid?: number;
459
+ itemCode?: string;
451
460
  }): Promise<any>;
452
461
  /**
453
462
  * @param {Object} arg - Arg object.
454
463
  * @param {number} arg.itemId - Id of the product to be updated.
455
- * @summary: Delete a product.
456
- * @description: This API allows to delete product.
464
+ * @summary: All Sizes for a given Product
465
+ * @description: This API allows to get All Sizes for a given Product.
457
466
  */
458
- deleteProduct({ itemId }?: {
467
+ allSizes({ itemId }?: {
459
468
  itemId: number;
460
469
  }): Promise<any>;
461
470
  /**
@@ -569,13 +578,13 @@ declare class Catalog {
569
578
  * @param {Object} arg - Arg object.
570
579
  * @param {number} arg.itemId - Item Id of the product associated with size
571
580
  * to be deleted.
572
- * @param {number} arg.size - Size to be deleted.
581
+ * @param {string} arg.size - Size to be deleted.
573
582
  * @summary: Delete a Size associated with product.
574
583
  * @description: This API allows to delete size associated with product.
575
584
  */
576
585
  deleteSize({ itemId, size }?: {
577
586
  itemId: number;
578
- size: number;
587
+ size: string;
579
588
  }): Promise<any>;
580
589
  /**
581
590
  * @param {Object} arg - Arg object.
@@ -1124,7 +1124,7 @@ class Catalog {
1124
1124
 
1125
1125
  /**
1126
1126
  * @param {Object} arg - Arg object.
1127
- * @param {ProductCreateUpdate} arg.body
1127
+ * @param {ProductCreateUpdateSchemaV2} arg.body
1128
1128
  * @summary: Create a product.
1129
1129
  * @description: This API allows to create product.
1130
1130
  */
@@ -1146,7 +1146,7 @@ class Catalog {
1146
1146
  return PlatformAPIClient.execute(
1147
1147
  this.config,
1148
1148
  "post",
1149
- `/service/platform/catalog/v1.0/company/${this.config.companyId}/products/`,
1149
+ `/service/platform/catalog/v2.0/company/${this.config.companyId}/products/`,
1150
1150
  query_params,
1151
1151
  body,
1152
1152
  xHeaders
@@ -1216,7 +1216,7 @@ class Catalog {
1216
1216
  return PlatformAPIClient.execute(
1217
1217
  this.config,
1218
1218
  "get",
1219
- `/service/platform/catalog/v1.0/company/${this.config.companyId}/products/`,
1219
+ `/service/platform/catalog/v2.0/company/${this.config.companyId}/products/`,
1220
1220
  query_params,
1221
1221
  undefined,
1222
1222
  xHeaders
@@ -1303,7 +1303,38 @@ class Catalog {
1303
1303
  /**
1304
1304
  * @param {Object} arg - Arg object.
1305
1305
  * @param {number} arg.itemId - Id of the product to be updated.
1306
- * @param {ProductCreateUpdate} arg.body
1306
+ * @summary: Delete a product.
1307
+ * @description: This API allows to delete product.
1308
+ */
1309
+ deleteProduct({ itemId } = {}) {
1310
+ const { error } = CatalogValidator.deleteProduct().validate(
1311
+ {
1312
+ itemId,
1313
+ },
1314
+ { abortEarly: false, allowUnknown: true }
1315
+ );
1316
+ if (error) {
1317
+ return Promise.reject(new FDKClientValidationError(error));
1318
+ }
1319
+
1320
+ const query_params = {};
1321
+
1322
+ const xHeaders = {};
1323
+
1324
+ return PlatformAPIClient.execute(
1325
+ this.config,
1326
+ "delete",
1327
+ `/service/platform/catalog/v2.0/company/${this.config.companyId}/products/${itemId}/`,
1328
+ query_params,
1329
+ undefined,
1330
+ xHeaders
1331
+ );
1332
+ }
1333
+
1334
+ /**
1335
+ * @param {Object} arg - Arg object.
1336
+ * @param {number} arg.itemId - Id of the product to be updated.
1337
+ * @param {ProductCreateUpdateSchemaV2} arg.body
1307
1338
  * @summary: Edit a product.
1308
1339
  * @description: This API allows to edit product.
1309
1340
  */
@@ -1326,7 +1357,7 @@ class Catalog {
1326
1357
  return PlatformAPIClient.execute(
1327
1358
  this.config,
1328
1359
  "put",
1329
- `/service/platform/catalog/v1.0/company/${this.config.companyId}/products/${itemId}/`,
1360
+ `/service/platform/catalog/v2.0/company/${this.config.companyId}/products/${itemId}/`,
1330
1361
  query_params,
1331
1362
  body,
1332
1363
  xHeaders
@@ -1335,18 +1366,18 @@ class Catalog {
1335
1366
 
1336
1367
  /**
1337
1368
  * @param {Object} arg - Arg object.
1338
- * @param {string} [arg.itemCode] - Item code of the product.
1339
1369
  * @param {number} arg.itemId - Item Id of the product.
1340
1370
  * @param {number} [arg.brandUid] - Brand Id of the product.
1371
+ * @param {string} [arg.itemCode] - Item code of the product.
1341
1372
  * @summary: Get a single product.
1342
1373
  * @description: This API helps to get data associated to a particular product.
1343
1374
  */
1344
- getProduct({ itemId, itemCode, brandUid } = {}) {
1375
+ getProduct({ itemId, brandUid, itemCode } = {}) {
1345
1376
  const { error } = CatalogValidator.getProduct().validate(
1346
1377
  {
1347
1378
  itemId,
1348
- itemCode,
1349
1379
  brandUid,
1380
+ itemCode,
1350
1381
  },
1351
1382
  { abortEarly: false, allowUnknown: true }
1352
1383
  );
@@ -1355,15 +1386,15 @@ class Catalog {
1355
1386
  }
1356
1387
 
1357
1388
  const query_params = {};
1358
- query_params["item_code"] = itemCode;
1359
1389
  query_params["brand_uid"] = brandUid;
1390
+ query_params["item_code"] = itemCode;
1360
1391
 
1361
1392
  const xHeaders = {};
1362
1393
 
1363
1394
  return PlatformAPIClient.execute(
1364
1395
  this.config,
1365
1396
  "get",
1366
- `/service/platform/catalog/v1.0/company/${this.config.companyId}/products/${itemId}/`,
1397
+ `/service/platform/catalog/v2.0/company/${this.config.companyId}/products/${itemId}/`,
1367
1398
  query_params,
1368
1399
  undefined,
1369
1400
  xHeaders
@@ -1373,11 +1404,11 @@ class Catalog {
1373
1404
  /**
1374
1405
  * @param {Object} arg - Arg object.
1375
1406
  * @param {number} arg.itemId - Id of the product to be updated.
1376
- * @summary: Delete a product.
1377
- * @description: This API allows to delete product.
1407
+ * @summary: All Sizes for a given Product
1408
+ * @description: This API allows to get All Sizes for a given Product.
1378
1409
  */
1379
- deleteProduct({ itemId } = {}) {
1380
- const { error } = CatalogValidator.deleteProduct().validate(
1410
+ allSizes({ itemId } = {}) {
1411
+ const { error } = CatalogValidator.allSizes().validate(
1381
1412
  {
1382
1413
  itemId,
1383
1414
  },
@@ -1393,8 +1424,8 @@ class Catalog {
1393
1424
 
1394
1425
  return PlatformAPIClient.execute(
1395
1426
  this.config,
1396
- "delete",
1397
- `/service/platform/catalog/v1.0/company/${this.config.companyId}/products/${itemId}/`,
1427
+ "get",
1428
+ `/service/platform/catalog/v2.0/company/${this.config.companyId}/products/${itemId}/all_sizes`,
1398
1429
  query_params,
1399
1430
  undefined,
1400
1431
  xHeaders
@@ -1742,7 +1773,7 @@ class Catalog {
1742
1773
  * @param {Object} arg - Arg object.
1743
1774
  * @param {number} arg.itemId - Item Id of the product associated with size
1744
1775
  * to be deleted.
1745
- * @param {number} arg.size - Size to be deleted.
1776
+ * @param {string} arg.size - Size to be deleted.
1746
1777
  * @summary: Delete a Size associated with product.
1747
1778
  * @description: This API allows to delete size associated with product.
1748
1779
  */
@@ -37,9 +37,10 @@ declare class CatalogValidator {
37
37
  static getProducts(): any;
38
38
  static getVariantsOfProducts(): any;
39
39
  static getProductAttributes(): any;
40
+ static deleteProduct(): any;
40
41
  static editProduct(): any;
41
42
  static getProduct(): any;
42
- static deleteProduct(): any;
43
+ static allSizes(): any;
43
44
  static getProductValidation(): any;
44
45
  static getProductSize(): any;
45
46
  static createBulkProductUploadJob(): any;
@@ -216,7 +216,7 @@ class CatalogValidator {
216
216
 
217
217
  static createProduct() {
218
218
  return Joi.object({
219
- body: Validator.ProductCreateUpdate().required(),
219
+ body: Validator.ProductCreateUpdateSchemaV2().required(),
220
220
  }).required();
221
221
  }
222
222
 
@@ -250,22 +250,28 @@ class CatalogValidator {
250
250
  }).required();
251
251
  }
252
252
 
253
+ static deleteProduct() {
254
+ return Joi.object({
255
+ itemId: Joi.number().required(),
256
+ }).required();
257
+ }
258
+
253
259
  static editProduct() {
254
260
  return Joi.object({
255
261
  itemId: Joi.number().required(),
256
- body: Validator.ProductCreateUpdate().required(),
262
+ body: Validator.ProductCreateUpdateSchemaV2().required(),
257
263
  }).required();
258
264
  }
259
265
 
260
266
  static getProduct() {
261
267
  return Joi.object({
262
- itemCode: Joi.string().allow(""),
263
268
  itemId: Joi.number().required(),
264
269
  brandUid: Joi.number(),
270
+ itemCode: Joi.string().allow(""),
265
271
  }).required();
266
272
  }
267
273
 
268
- static deleteProduct() {
274
+ static allSizes() {
269
275
  return Joi.object({
270
276
  itemId: Joi.number().required(),
271
277
  }).required();
@@ -339,7 +345,7 @@ class CatalogValidator {
339
345
  static deleteSize() {
340
346
  return Joi.object({
341
347
  itemId: Joi.number().required(),
342
- size: Joi.number().required(),
348
+ size: Joi.string().allow("").required(),
343
349
  }).required();
344
350
  }
345
351