@gofynd/fdk-client-javascript 1.4.15-beta.6 → 1.4.15-beta.8

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 (68) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/sdk/application/Cart/CartApplicationClient.d.ts +5 -5
  4. package/sdk/application/Cart/CartApplicationClient.js +26 -252
  5. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +16 -16
  6. package/sdk/application/Catalog/CatalogApplicationClient.js +90 -339
  7. package/sdk/application/Common/CommonApplicationClient.js +1 -16
  8. package/sdk/application/Communication/CommunicationApplicationClient.js +1 -24
  9. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +2 -2
  10. package/sdk/application/Configuration/ConfigurationApplicationClient.js +11 -134
  11. package/sdk/application/Content/ContentApplicationClient.d.ts +8 -8
  12. package/sdk/application/Content/ContentApplicationClient.js +44 -206
  13. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +5 -3
  14. package/sdk/application/FileStorage/FileStorageApplicationClient.js +14 -30
  15. package/sdk/application/Lead/LeadApplicationClient.d.ts +4 -4
  16. package/sdk/application/Lead/LeadApplicationClient.js +21 -52
  17. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +5 -5
  18. package/sdk/application/Logistic/LogisticApplicationClient.js +32 -128
  19. package/sdk/application/Order/OrderApplicationClient.d.ts +10 -10
  20. package/sdk/application/Order/OrderApplicationClient.js +63 -142
  21. package/sdk/application/Payment/PaymentApplicationClient.d.ts +1 -1
  22. package/sdk/application/Payment/PaymentApplicationClient.js +6 -418
  23. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +1 -1
  24. package/sdk/application/Rewards/RewardsApplicationClient.js +6 -59
  25. package/sdk/application/Share/ShareApplicationClient.d.ts +4 -4
  26. package/sdk/application/Share/ShareApplicationClient.js +21 -75
  27. package/sdk/application/Theme/ThemeApplicationClient.d.ts +3 -3
  28. package/sdk/application/Theme/ThemeApplicationClient.js +19 -47
  29. package/sdk/application/User/UserApplicationClient.js +1 -407
  30. package/sdk/application/Webhook/WebhookApplicationClient.js +1 -8
  31. package/sdk/common/Utility.d.ts +1 -1
  32. package/sdk/common/Utility.js +10 -7
  33. package/sdk/common/Validator.d.ts +1 -0
  34. package/sdk/common/Validator.js +20 -0
  35. package/sdk/common/utils.d.ts +0 -1
  36. package/sdk/common/utils.js +0 -14
  37. package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +2 -0
  38. package/sdk/partner/FileStorage/FileStoragePartnerModel.js +2 -0
  39. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +7 -0
  40. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +3 -0
  41. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +3 -1
  42. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +3 -0
  43. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +3 -1
  44. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +3 -0
  45. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +16 -1
  46. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +20 -0
  47. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +0 -10
  48. package/sdk/platform/Order/OrderPlatformApplicationClient.js +0 -92
  49. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -28
  50. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +0 -18
  51. package/sdk/platform/Order/OrderPlatformClient.d.ts +10 -0
  52. package/sdk/platform/Order/OrderPlatformClient.js +99 -0
  53. package/sdk/platform/Order/OrderPlatformValidator.d.ts +33 -1
  54. package/sdk/platform/Order/OrderPlatformValidator.js +20 -0
  55. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +0 -10
  56. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +0 -118
  57. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +1 -53
  58. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +0 -29
  59. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +10 -0
  60. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +119 -0
  61. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +58 -1
  62. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +30 -0
  63. package/sdk/public/Configuration/ConfigurationPublicClient.js +1 -16
  64. package/sdk/public/Content/ContentPublicClient.d.ts +1 -1
  65. package/sdk/public/Content/ContentPublicClient.js +6 -11
  66. package/sdk/public/Partner/PartnerPublicClient.d.ts +1 -1
  67. package/sdk/public/Partner/PartnerPublicClient.js +6 -11
  68. package/sdk/public/Webhook/WebhookPublicClient.js +1 -40
@@ -6,6 +6,7 @@ const {
6
6
  const ApplicationAPIClient = require("../ApplicationAPIClient");
7
7
  const constructUrl = require("../constructUrl");
8
8
  const Paginator = require("../../common/Paginator");
9
+ const { validateRequiredParams } = require("../../common/Validator");
9
10
 
10
11
  class Webhook {
11
12
  constructor(_conf) {
@@ -42,14 +43,6 @@ class Webhook {
42
43
  { body, requestHeaders } = { requestHeaders: {} },
43
44
  { responseHeaders } = { responseHeaders: false }
44
45
  ) {
45
- let invalidInput = [];
46
- if (invalidInput.length) {
47
- const error = new Error();
48
- error.message = "Missing required field";
49
- error.details = invalidInput;
50
- return Promise.reject(new FDKClientValidationError(error));
51
- }
52
-
53
46
  const query_params = {};
54
47
 
55
48
  const xHeaders = {};
@@ -1,4 +1,4 @@
1
- export function convertActionToUrl(action: any): any;
1
+ export function convertActionToUrl(action: any, locale: any): any;
2
2
  export function convertUrlToAction(url: any): {
3
3
  type: string;
4
4
  page: {
@@ -5,9 +5,12 @@ function convertUrlToAction(url) {
5
5
  if (url) {
6
6
  const path = utils.trimChar(url);
7
7
  const query = utils.getQuery(path);
8
- const pathname = utils.validURL(path)
9
- ? new URL(path).pathname
10
- : path.split("?")[0];
8
+ let pathname;
9
+ try {
10
+ pathname = new URL(path).pathname;
11
+ } catch (e) {
12
+ pathname = path.split("?")[0];
13
+ }
11
14
  const allNavigations = Object.assign({}, Constant.NAVIGATORS);
12
15
  const typeLink = {};
13
16
  for (nav in allNavigations) {
@@ -65,7 +68,7 @@ function convertUrlToAction(url) {
65
68
  }
66
69
  }
67
70
 
68
- function convertActionToUrl(action) {
71
+ function convertActionToUrl(action, locale) {
69
72
  if (action && action.page && action.page.type) {
70
73
  switch (action.type) {
71
74
  case utils.NAV_TYPE.PAGE: {
@@ -83,16 +86,16 @@ function convertActionToUrl(action) {
83
86
  item.link +=
84
87
  "/?" + utils.transformRequestOptions(action.page.query);
85
88
  }
86
- return item.link;
89
+ return locale ? `/${locale}${item.link}` : item.link;
87
90
  }
88
- return "";
91
+ return locale ? `/${locale}` : "";
89
92
  }
90
93
  case utils.NAV_TYPE.POPUP: {
91
94
  break;
92
95
  }
93
96
  }
94
97
  } else {
95
- return "";
98
+ return locale ? `/${locale}` : "";
96
99
  }
97
100
  }
98
101
 
@@ -0,0 +1 @@
1
+ export function validateRequiredParams(params: any, requiredParams: any): any[];
@@ -0,0 +1,20 @@
1
+ function validateRequiredParams(params, requiredParams) {
2
+ const errors = [];
3
+ requiredParams.forEach((key) => {
4
+ const value = params[key];
5
+
6
+ // Reject missing or empty values (except for boolean false)
7
+ if (
8
+ value === undefined ||
9
+ value === null ||
10
+ (typeof value !== "boolean" && value === "")
11
+ ) {
12
+ errors.push(`Missing or empty required parameter: ${key}`);
13
+ }
14
+ });
15
+ return errors;
16
+ }
17
+
18
+ module.exports = {
19
+ validateRequiredParams,
20
+ };
@@ -7,7 +7,6 @@ export function findBestMatchingLink(allLinks?: any[], pathname?: string): {
7
7
  value: string;
8
8
  params: {};
9
9
  };
10
- export function validURL(str: any): boolean;
11
10
  export function convertStringToBase64(string: any): string;
12
11
  export function isBrowser(): boolean;
13
12
  export function isNode(): boolean;
@@ -94,19 +94,6 @@ const trimChar = (string = "", charToRemove = "/") => {
94
94
  return string;
95
95
  };
96
96
 
97
- function validURL(str) {
98
- var pattern = new RegExp(
99
- "^(https?:\\/\\/)?" + // protocol
100
- "((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|" + // domain name
101
- "((\\d{1,3}\\.){3}\\d{1,3}))" + // OR ip (v4) address
102
- "(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*" + // port and path
103
- "(\\?[;&a-z\\d%_.~+=-]*)?" + // query string
104
- "(\\#[-a-z\\d_]*)?$",
105
- "i"
106
- ); // fragment locator
107
- return !!pattern.test(str);
108
- }
109
-
110
97
  const findBestMatchingLink = (allLinks = [], pathname = "/") => {
111
98
  let bestMatch = { value: "", params: {} };
112
99
  pathname = trimChar(pathname); // -> product/test-product-tag/reviews
@@ -221,7 +208,6 @@ module.exports = {
221
208
  trimChar,
222
209
  generateUrlWithParams,
223
210
  findBestMatchingLink,
224
- validURL,
225
211
  convertStringToBase64,
226
212
  isBrowser,
227
213
  isNode,
@@ -30,6 +30,7 @@ export = FileStoragePartnerModel;
30
30
  * @property {number} size
31
31
  * @property {string[]} [tags]
32
32
  * @property {Object} [params]
33
+ * @property {string} [enc_key]
33
34
  */
34
35
  /**
35
36
  * @typedef CreatedBy
@@ -96,6 +97,7 @@ type StartRequest = {
96
97
  size: number;
97
98
  tags?: string[];
98
99
  params?: any;
100
+ enc_key?: string;
99
101
  };
100
102
  /** @returns {CreatedBy} */
101
103
  declare function CreatedBy(): CreatedBy;
@@ -34,6 +34,7 @@ const Joi = require("joi");
34
34
  * @property {number} size
35
35
  * @property {string[]} [tags]
36
36
  * @property {Object} [params]
37
+ * @property {string} [enc_key]
37
38
  */
38
39
 
39
40
  /**
@@ -106,6 +107,7 @@ class FileStoragePartnerModel {
106
107
  size: Joi.number().required(),
107
108
  tags: Joi.array().items(Joi.string().allow("")),
108
109
  params: Joi.object().pattern(/\S/, Joi.any()),
110
+ enc_key: Joi.string().allow(""),
109
111
  });
110
112
  }
111
113
 
@@ -53,6 +53,8 @@ export = ConfigurationPlatformModel;
53
53
  * @property {number} [company_id]
54
54
  * @property {boolean} [enable_zone_overlapping] - Power product listing with
55
55
  * overlapping zones
56
+ * @property {boolean} [sort_popular_first] - Give preference to popularity over
57
+ * score in product listing sort
56
58
  */
57
59
  /**
58
60
  * @typedef InventoryBrand
@@ -1441,6 +1443,11 @@ type AppInventoryConfig = {
1441
1443
  * overlapping zones
1442
1444
  */
1443
1445
  enable_zone_overlapping?: boolean;
1446
+ /**
1447
+ * - Give preference to popularity over
1448
+ * score in product listing sort
1449
+ */
1450
+ sort_popular_first?: boolean;
1444
1451
  };
1445
1452
  /** @returns {InventoryBrand} */
1446
1453
  declare function InventoryBrand(): InventoryBrand;
@@ -56,6 +56,8 @@ const Joi = require("joi");
56
56
  * @property {number} [company_id]
57
57
  * @property {boolean} [enable_zone_overlapping] - Power product listing with
58
58
  * overlapping zones
59
+ * @property {boolean} [sort_popular_first] - Give preference to popularity over
60
+ * score in product listing sort
59
61
  */
60
62
 
61
63
  /**
@@ -1560,6 +1562,7 @@ class ConfigurationPlatformModel {
1560
1562
  company_store: Joi.array().items(Joi.any()),
1561
1563
  company_id: Joi.number(),
1562
1564
  enable_zone_overlapping: Joi.boolean(),
1565
+ sort_popular_first: Joi.boolean(),
1563
1566
  });
1564
1567
  }
1565
1568
 
@@ -152,14 +152,16 @@ declare class FileStorage {
152
152
  * @param {string} namespace
153
153
  * @param {number} size
154
154
  * @param {number} tags
155
+ * @param {string} enc_key
155
156
  */
156
- upload({ data, file_name, content_type, namespace, size, tags, }?: {
157
+ upload({ data, file_name, content_type, namespace, size, tags, enc_key, }?: {
157
158
  data: any;
158
159
  file_name: any;
159
160
  content_type: any;
160
161
  namespace: any;
161
162
  size: any;
162
163
  tags: any;
164
+ enc_key: any;
163
165
  }): Promise<any>;
164
166
  }
165
167
  import FileStoragePlatformApplicationValidator = require("./FileStoragePlatformApplicationValidator");
@@ -1045,6 +1045,7 @@ class FileStorage {
1045
1045
  * @param {string} namespace
1046
1046
  * @param {number} size
1047
1047
  * @param {number} tags
1048
+ * @param {string} enc_key
1048
1049
  */
1049
1050
  FileStorage.prototype.upload = function ({
1050
1051
  data,
@@ -1053,6 +1054,7 @@ FileStorage.prototype.upload = function ({
1053
1054
  namespace,
1054
1055
  size,
1055
1056
  tags,
1057
+ enc_key,
1056
1058
  } = {}) {
1057
1059
  return new Promise(async (resolve, reject) => {
1058
1060
  try {
@@ -1063,6 +1065,7 @@ FileStorage.prototype.upload = function ({
1063
1065
  content_type,
1064
1066
  size: size,
1065
1067
  tags: tags,
1068
+ enc_key: enc_key,
1066
1069
  },
1067
1070
  });
1068
1071
  if (dataObj.upload && dataObj.upload.url) {
@@ -69,14 +69,16 @@ declare class FileStorage {
69
69
  * @param {string} namespace
70
70
  * @param {number} size
71
71
  * @param {number} tags
72
+ * @param {string} enc_key
72
73
  */
73
- upload({ data, file_name, content_type, namespace, size, tags, }?: {
74
+ upload({ data, file_name, content_type, namespace, size, tags, enc_key, }?: {
74
75
  data: any;
75
76
  file_name: any;
76
77
  content_type: any;
77
78
  namespace: any;
78
79
  size: any;
79
80
  tags: any;
81
+ enc_key: any;
80
82
  }): Promise<any>;
81
83
  }
82
84
  import FileStoragePlatformValidator = require("./FileStoragePlatformValidator");
@@ -510,6 +510,7 @@ class FileStorage {
510
510
  * @param {string} namespace
511
511
  * @param {number} size
512
512
  * @param {number} tags
513
+ * @param {string} enc_key
513
514
  */
514
515
  FileStorage.prototype.upload = function ({
515
516
  data,
@@ -518,6 +519,7 @@ FileStorage.prototype.upload = function ({
518
519
  namespace,
519
520
  size,
520
521
  tags,
522
+ enc_key,
521
523
  } = {}) {
522
524
  return new Promise(async (resolve, reject) => {
523
525
  try {
@@ -528,6 +530,7 @@ FileStorage.prototype.upload = function ({
528
530
  content_type,
529
531
  size: size,
530
532
  tags: tags,
533
+ enc_key: enc_key,
531
534
  },
532
535
  });
533
536
  if (dataObj.upload && dataObj.upload.url) {
@@ -43,6 +43,7 @@ export = FileStoragePlatformModel;
43
43
  * @property {number} size
44
44
  * @property {string[]} [tags]
45
45
  * @property {Object} [params]
46
+ * @property {string} [enc_key]
46
47
  */
47
48
  /**
48
49
  * @typedef CreatedBy
@@ -85,10 +86,16 @@ export = FileStoragePlatformModel;
85
86
  * @typedef SignUrlResponse
86
87
  * @property {Urls[]} urls
87
88
  */
89
+ /**
90
+ * @typedef EncryptionMapping
91
+ * @property {string} [enc_url]
92
+ * @property {string} [value]
93
+ */
88
94
  /**
89
95
  * @typedef SignUrlRequest
90
96
  * @property {number} expiry
91
97
  * @property {string[]} urls
98
+ * @property {EncryptionMapping[]} [enc_url_mapping]
92
99
  */
93
100
  /**
94
101
  * @typedef InvoiceTypesDataResponse
@@ -570,7 +577,7 @@ export = FileStoragePlatformModel;
570
577
  declare class FileStoragePlatformModel {
571
578
  }
572
579
  declare namespace FileStoragePlatformModel {
573
- export { ProxyResponse, FailedResponse, CDN, Upload, StartResponse, Params, StartRequest, CreatedBy, CompleteResponse, DestinationNamespace, CopyFiles, Urls, SignUrlResponse, SignUrlRequest, InvoiceTypesDataResponse, InvoiceTypesResponse, ConversionRate, DeliveryPartnerDetail, Image, PaymentData, InvoiceDetail, CompanyDetail, StoreDetail, CustomerBillingDetail, CustomerShippingDetail, ReturnDetail, Brand, Cgst, Sgst, Igst, Tax, ItemsProductTable, ProductTable, Taxes, TaxTable, RegisteredCompanyDetail, Kwargs, ShipmentIdBarcodeGenerator, SignedQrcodeGenerator, KwargsUpiQrcode, UpiQrcodeGenerator, DigitalsignatureGenerator, KwargsAwbNumber, AwbNumberLabelBarcodeGenerator, AwbNumberBarcodeGenerator, MetaProperty, Meta, DummyTemplateDataPayload, DummyTemplateData, DummyTemplateDataItems, PdfConfig, PdfConfigSuccessData, PdfConfigSuccess, PdfConfigSaveSuccessData, PdfConfigSaveSuccess, PdfDefaultTemplateSuccess, Document, PaymentReceiptRequestBody, PaymentReceiptOrderDetails, PaymentReceiptCustomerDetails, PaymentReceiptPayments, PaymentReceiptFormat, PaymentReceiptService, PaymentReceiptTaxes, PaymentReceiptPayload, PaymentReceiptMeta, ExtensionSlug };
580
+ export { ProxyResponse, FailedResponse, CDN, Upload, StartResponse, Params, StartRequest, CreatedBy, CompleteResponse, DestinationNamespace, CopyFiles, Urls, SignUrlResponse, EncryptionMapping, SignUrlRequest, InvoiceTypesDataResponse, InvoiceTypesResponse, ConversionRate, DeliveryPartnerDetail, Image, PaymentData, InvoiceDetail, CompanyDetail, StoreDetail, CustomerBillingDetail, CustomerShippingDetail, ReturnDetail, Brand, Cgst, Sgst, Igst, Tax, ItemsProductTable, ProductTable, Taxes, TaxTable, RegisteredCompanyDetail, Kwargs, ShipmentIdBarcodeGenerator, SignedQrcodeGenerator, KwargsUpiQrcode, UpiQrcodeGenerator, DigitalsignatureGenerator, KwargsAwbNumber, AwbNumberLabelBarcodeGenerator, AwbNumberBarcodeGenerator, MetaProperty, Meta, DummyTemplateDataPayload, DummyTemplateData, DummyTemplateDataItems, PdfConfig, PdfConfigSuccessData, PdfConfigSuccess, PdfConfigSaveSuccessData, PdfConfigSaveSuccess, PdfDefaultTemplateSuccess, Document, PaymentReceiptRequestBody, PaymentReceiptOrderDetails, PaymentReceiptCustomerDetails, PaymentReceiptPayments, PaymentReceiptFormat, PaymentReceiptService, PaymentReceiptTaxes, PaymentReceiptPayload, PaymentReceiptMeta, ExtensionSlug };
574
581
  }
575
582
  /** @returns {ProxyResponse} */
576
583
  declare function ProxyResponse(): ProxyResponse;
@@ -626,6 +633,7 @@ type StartRequest = {
626
633
  size: number;
627
634
  tags?: string[];
628
635
  params?: any;
636
+ enc_key?: string;
629
637
  };
630
638
  /** @returns {CreatedBy} */
631
639
  declare function CreatedBy(): CreatedBy;
@@ -674,11 +682,18 @@ declare function SignUrlResponse(): SignUrlResponse;
674
682
  type SignUrlResponse = {
675
683
  urls: Urls[];
676
684
  };
685
+ /** @returns {EncryptionMapping} */
686
+ declare function EncryptionMapping(): EncryptionMapping;
687
+ type EncryptionMapping = {
688
+ enc_url?: string;
689
+ value?: string;
690
+ };
677
691
  /** @returns {SignUrlRequest} */
678
692
  declare function SignUrlRequest(): SignUrlRequest;
679
693
  type SignUrlRequest = {
680
694
  expiry: number;
681
695
  urls: string[];
696
+ enc_url_mapping?: EncryptionMapping[];
682
697
  };
683
698
  /** @returns {InvoiceTypesDataResponse} */
684
699
  declare function InvoiceTypesDataResponse(): InvoiceTypesDataResponse;
@@ -50,6 +50,7 @@ const Joi = require("joi");
50
50
  * @property {number} size
51
51
  * @property {string[]} [tags]
52
52
  * @property {Object} [params]
53
+ * @property {string} [enc_key]
53
54
  */
54
55
 
55
56
  /**
@@ -99,10 +100,17 @@ const Joi = require("joi");
99
100
  * @property {Urls[]} urls
100
101
  */
101
102
 
103
+ /**
104
+ * @typedef EncryptionMapping
105
+ * @property {string} [enc_url]
106
+ * @property {string} [value]
107
+ */
108
+
102
109
  /**
103
110
  * @typedef SignUrlRequest
104
111
  * @property {number} expiry
105
112
  * @property {string[]} urls
113
+ * @property {EncryptionMapping[]} [enc_url_mapping]
106
114
  */
107
115
 
108
116
  /**
@@ -699,6 +707,7 @@ class FileStoragePlatformModel {
699
707
  size: Joi.number().required(),
700
708
  tags: Joi.array().items(Joi.string().allow("")),
701
709
  params: Joi.object().pattern(/\S/, Joi.any()),
710
+ enc_key: Joi.string().allow(""),
702
711
  });
703
712
  }
704
713
 
@@ -761,11 +770,22 @@ class FileStoragePlatformModel {
761
770
  });
762
771
  }
763
772
 
773
+ /** @returns {EncryptionMapping} */
774
+ static EncryptionMapping() {
775
+ return Joi.object({
776
+ enc_url: Joi.string().allow(""),
777
+ value: Joi.string().allow(""),
778
+ });
779
+ }
780
+
764
781
  /** @returns {SignUrlRequest} */
765
782
  static SignUrlRequest() {
766
783
  return Joi.object({
767
784
  expiry: Joi.number().required(),
768
785
  urls: Joi.array().items(Joi.string().allow("")).required(),
786
+ enc_url_mapping: Joi.array().items(
787
+ FileStoragePlatformModel.EncryptionMapping()
788
+ ),
769
789
  });
770
790
  }
771
791
 
@@ -3,16 +3,6 @@ declare class Order {
3
3
  constructor(config: any, applicationId: any);
4
4
  config: any;
5
5
  applicationId: any;
6
- /**
7
- * @param {OrderPlatformApplicationValidator.FailedOrderLogsParam} arg - Arg object
8
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
9
- * @param {import("../PlatformAPIClient").Options} - Options
10
- * @returns {Promise<OrderPlatformModel.FailedOrderLogs>} - Success response
11
- * @name failedOrderLogs
12
- * @summary: List failed order logs
13
- * @description: Get failed order logs listing for filters based on order Id, user contact number, user email Id and sales channel Id. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/failedOrderLogs/).
14
- */
15
- failedOrderLogs({ pageNo, pageSize, searchType, searchValue, requestHeaders }?: OrderPlatformApplicationValidator.FailedOrderLogsParam, { responseHeaders }?: object): Promise<OrderPlatformModel.FailedOrderLogs>;
16
6
  /**
17
7
  * @param {OrderPlatformApplicationValidator.GetApplicationShipmentsParam} arg
18
8
  * - Arg object
@@ -15,98 +15,6 @@ class Order {
15
15
  this.applicationId = applicationId;
16
16
  }
17
17
 
18
- /**
19
- * @param {OrderPlatformApplicationValidator.FailedOrderLogsParam} arg - Arg object
20
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
21
- * @param {import("../PlatformAPIClient").Options} - Options
22
- * @returns {Promise<OrderPlatformModel.FailedOrderLogs>} - Success response
23
- * @name failedOrderLogs
24
- * @summary: List failed order logs
25
- * @description: Get failed order logs listing for filters based on order Id, user contact number, user email Id and sales channel Id. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/failedOrderLogs/).
26
- */
27
- async failedOrderLogs(
28
- { pageNo, pageSize, searchType, searchValue, requestHeaders } = {
29
- requestHeaders: {},
30
- },
31
- { responseHeaders } = { responseHeaders: false }
32
- ) {
33
- const {
34
- error,
35
- } = OrderPlatformApplicationValidator.failedOrderLogs().validate(
36
- {
37
- pageNo,
38
- pageSize,
39
- searchType,
40
- searchValue,
41
- },
42
- { abortEarly: false, allowUnknown: true }
43
- );
44
- if (error) {
45
- return Promise.reject(new FDKClientValidationError(error));
46
- }
47
-
48
- // Showing warrnings if extra unknown parameters are found
49
- const {
50
- error: warrning,
51
- } = OrderPlatformApplicationValidator.failedOrderLogs().validate(
52
- {
53
- pageNo,
54
- pageSize,
55
- searchType,
56
- searchValue,
57
- },
58
- { abortEarly: false, allowUnknown: false }
59
- );
60
- if (warrning) {
61
- Logger({
62
- level: "WARN",
63
- message: `Parameter Validation warrnings for platform > Order > failedOrderLogs \n ${warrning}`,
64
- });
65
- }
66
-
67
- const query_params = {};
68
- query_params["application_id"] = applicationId;
69
- query_params["page_no"] = pageNo;
70
- query_params["page_size"] = pageSize;
71
- query_params["search_type"] = searchType;
72
- query_params["search_value"] = searchValue;
73
-
74
- const response = await PlatformAPIClient.execute(
75
- this.config,
76
- "get",
77
- `/service/platform/order-manage/v1.0/company/${this.config.companyId}/orders/failed`,
78
- query_params,
79
- undefined,
80
- requestHeaders,
81
- { responseHeaders }
82
- );
83
-
84
- let responseData = response;
85
- if (responseHeaders) {
86
- responseData = response[0];
87
- }
88
-
89
- const {
90
- error: res_error,
91
- } = OrderPlatformModel.FailedOrderLogs().validate(responseData, {
92
- abortEarly: false,
93
- allowUnknown: true,
94
- });
95
-
96
- if (res_error) {
97
- if (this.config.options.strictResponseCheck === true) {
98
- return Promise.reject(new FDKResponseValidationError(res_error));
99
- } else {
100
- Logger({
101
- level: "WARN",
102
- message: `Response Validation Warnings for platform > Order > failedOrderLogs \n ${res_error}`,
103
- });
104
- }
105
- }
106
-
107
- return response;
108
- }
109
-
110
18
  /**
111
19
  * @param {OrderPlatformApplicationValidator.GetApplicationShipmentsParam} arg
112
20
  * - Arg object
@@ -1,11 +1,4 @@
1
1
  export = OrderPlatformApplicationValidator;
2
- /**
3
- * @typedef FailedOrderLogsParam
4
- * @property {number} [pageNo] - Page Number
5
- * @property {number} [pageSize] - Page Size
6
- * @property {string} [searchType] - Search type for filter
7
- * @property {string} [searchValue] - Search value for filter
8
- */
9
2
  /**
10
3
  * @typedef GetApplicationShipmentsParam
11
4
  * @property {string} [lane]
@@ -39,8 +32,6 @@ export = OrderPlatformApplicationValidator;
39
32
  * @property {string} shipmentId - Shipment Id
40
33
  */
41
34
  declare class OrderPlatformApplicationValidator {
42
- /** @returns {FailedOrderLogsParam} */
43
- static failedOrderLogs(): FailedOrderLogsParam;
44
35
  /** @returns {GetApplicationShipmentsParam} */
45
36
  static getApplicationShipments(): GetApplicationShipmentsParam;
46
37
  /** @returns {GetPlatformShipmentReasonsParam} */
@@ -51,26 +42,8 @@ declare class OrderPlatformApplicationValidator {
51
42
  static trackShipmentPlatform(): TrackShipmentPlatformParam;
52
43
  }
53
44
  declare namespace OrderPlatformApplicationValidator {
54
- export { FailedOrderLogsParam, GetApplicationShipmentsParam, GetPlatformShipmentReasonsParam, GetShipmentBagReasonsParam, TrackShipmentPlatformParam };
45
+ export { GetApplicationShipmentsParam, GetPlatformShipmentReasonsParam, GetShipmentBagReasonsParam, TrackShipmentPlatformParam };
55
46
  }
56
- type FailedOrderLogsParam = {
57
- /**
58
- * - Page Number
59
- */
60
- pageNo?: number;
61
- /**
62
- * - Page Size
63
- */
64
- pageSize?: number;
65
- /**
66
- * - Search type for filter
67
- */
68
- searchType?: string;
69
- /**
70
- * - Search value for filter
71
- */
72
- searchValue?: string;
73
- };
74
47
  type GetApplicationShipmentsParam = {
75
48
  lane?: string;
76
49
  searchType?: string;
@@ -2,14 +2,6 @@ const Joi = require("joi");
2
2
 
3
3
  const OrderPlatformModel = require("./OrderPlatformModel");
4
4
 
5
- /**
6
- * @typedef FailedOrderLogsParam
7
- * @property {number} [pageNo] - Page Number
8
- * @property {number} [pageSize] - Page Size
9
- * @property {string} [searchType] - Search type for filter
10
- * @property {string} [searchValue] - Search value for filter
11
- */
12
-
13
5
  /**
14
6
  * @typedef GetApplicationShipmentsParam
15
7
  * @property {string} [lane]
@@ -47,16 +39,6 @@ const OrderPlatformModel = require("./OrderPlatformModel");
47
39
  */
48
40
 
49
41
  class OrderPlatformApplicationValidator {
50
- /** @returns {FailedOrderLogsParam} */
51
- static failedOrderLogs() {
52
- return Joi.object({
53
- pageNo: Joi.number(),
54
- pageSize: Joi.number(),
55
- searchType: Joi.string().allow(""),
56
- searchValue: Joi.string().allow(""),
57
- }).required();
58
- }
59
-
60
42
  /** @returns {GetApplicationShipmentsParam} */
61
43
  static getApplicationShipments() {
62
44
  return Joi.object({
@@ -114,6 +114,16 @@ declare class Order {
114
114
  * @description: Get the exact error trace from the log Id provided in the failed order list API response - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/failedOrderLogDetails/).
115
115
  */
116
116
  failedOrderLogDetails({ logId, requestHeaders }?: OrderPlatformValidator.FailedOrderLogDetailsParam, { responseHeaders }?: object): Promise<OrderPlatformModel.FailedOrderLogDetails>;
117
+ /**
118
+ * @param {OrderPlatformValidator.FailedOrderLogsParam} arg - Arg object
119
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
120
+ * @param {import("../PlatformAPIClient").Options} - Options
121
+ * @returns {Promise<OrderPlatformModel.FailedOrderLogs>} - Success response
122
+ * @name failedOrderLogs
123
+ * @summary: List failed order logs
124
+ * @description: Get failed order logs listing for filters based on order Id, user contact number, user email Id and sales channel Id. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/failedOrderLogs/).
125
+ */
126
+ failedOrderLogs({ applicationId, pageNo, pageSize, searchType, searchValue, requestHeaders, }?: OrderPlatformValidator.FailedOrderLogsParam, { responseHeaders }?: object): Promise<OrderPlatformModel.FailedOrderLogs>;
117
127
  /**
118
128
  * @param {OrderPlatformValidator.FetchRefundModeConfigParam} arg - Arg object
119
129
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`