@gofynd/fdk-client-javascript 1.4.15-beta.2 → 1.4.15-beta.4

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 (118) hide show
  1. package/README.md +2 -2
  2. package/application.d.ts +1 -2
  3. package/application.js +2 -3
  4. package/index.d.ts +1 -2
  5. package/index.js +7 -1
  6. package/package.json +2 -3
  7. package/sdk/application/ApplicationClient.js +0 -18
  8. package/sdk/application/Cart/CartApplicationClient.d.ts +55 -90
  9. package/sdk/application/Cart/CartApplicationClient.js +27 -1203
  10. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +80 -142
  11. package/sdk/application/Catalog/CatalogApplicationClient.js +40 -1344
  12. package/sdk/application/Common/CommonApplicationClient.d.ts +4 -8
  13. package/sdk/application/Common/CommonApplicationClient.js +2 -92
  14. package/sdk/application/Communication/CommunicationApplicationClient.d.ts +6 -19
  15. package/sdk/application/Communication/CommunicationApplicationClient.js +3 -148
  16. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +32 -73
  17. package/sdk/application/Configuration/ConfigurationApplicationClient.js +16 -727
  18. package/sdk/application/Content/ContentApplicationClient.d.ts +46 -78
  19. package/sdk/application/Content/ContentApplicationClient.js +23 -941
  20. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +6 -11
  21. package/sdk/application/FileStorage/FileStorageApplicationClient.js +4 -134
  22. package/sdk/application/Lead/LeadApplicationClient.d.ts +10 -18
  23. package/sdk/application/Lead/LeadApplicationClient.js +5 -217
  24. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +22 -39
  25. package/sdk/application/Logistic/LogisticApplicationClient.js +11 -496
  26. package/sdk/application/Order/OrderApplicationClient.d.ts +22 -42
  27. package/sdk/application/Order/OrderApplicationClient.js +11 -505
  28. package/sdk/application/Payment/PaymentApplicationClient.d.ts +92 -212
  29. package/sdk/application/Payment/PaymentApplicationClient.js +46 -2106
  30. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +14 -28
  31. package/sdk/application/Rewards/RewardsApplicationClient.js +7 -311
  32. package/sdk/application/Share/ShareApplicationClient.d.ts +14 -24
  33. package/sdk/application/Share/ShareApplicationClient.js +7 -309
  34. package/sdk/application/Theme/ThemeApplicationClient.d.ts +8 -14
  35. package/sdk/application/Theme/ThemeApplicationClient.js +4 -174
  36. package/sdk/application/User/UserApplicationClient.d.ts +85 -136
  37. package/sdk/application/User/UserApplicationClient.js +42 -1818
  38. package/sdk/application/Webhook/WebhookApplicationClient.d.ts +2 -5
  39. package/sdk/application/Webhook/WebhookApplicationClient.js +1 -50
  40. package/sdk/application/index.d.ts +0 -18
  41. package/sdk/application/index.js +0 -33
  42. package/sdk/partner/OAuthClient.js +1 -0
  43. package/sdk/platform/Cart/CartPlatformModel.d.ts +7 -0
  44. package/sdk/platform/Cart/CartPlatformModel.js +3 -0
  45. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +0 -7
  46. package/sdk/platform/Catalog/CatalogPlatformModel.js +0 -3
  47. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +7 -0
  48. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +3 -0
  49. package/sdk/public/Configuration/ConfigurationPublicClient.js +4 -2
  50. package/sdk/public/Content/ContentPublicClient.js +4 -2
  51. package/sdk/public/Partner/PartnerPublicClient.js +4 -2
  52. package/sdk/public/Webhook/WebhookPublicClient.js +4 -2
  53. package/sdk/application/Cart/CartApplicationModel.d.ts +0 -3994
  54. package/sdk/application/Cart/CartApplicationModel.js +0 -2497
  55. package/sdk/application/Cart/CartApplicationValidator.d.ts +0 -769
  56. package/sdk/application/Cart/CartApplicationValidator.js +0 -530
  57. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +0 -3857
  58. package/sdk/application/Catalog/CatalogApplicationModel.js +0 -2629
  59. package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +0 -791
  60. package/sdk/application/Catalog/CatalogApplicationValidator.js +0 -551
  61. package/sdk/application/Common/CommonApplicationModel.d.ts +0 -449
  62. package/sdk/application/Common/CommonApplicationModel.js +0 -308
  63. package/sdk/application/Common/CommonApplicationValidator.d.ts +0 -46
  64. package/sdk/application/Common/CommonApplicationValidator.js +0 -38
  65. package/sdk/application/Communication/CommunicationApplicationModel.d.ts +0 -293
  66. package/sdk/application/Communication/CommunicationApplicationModel.js +0 -201
  67. package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +0 -29
  68. package/sdk/application/Communication/CommunicationApplicationValidator.js +0 -38
  69. package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +0 -2556
  70. package/sdk/application/Configuration/ConfigurationApplicationModel.js +0 -1887
  71. package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +0 -179
  72. package/sdk/application/Configuration/ConfigurationApplicationValidator.js +0 -176
  73. package/sdk/application/Content/ContentApplicationModel.d.ts +0 -2133
  74. package/sdk/application/Content/ContentApplicationModel.js +0 -1589
  75. package/sdk/application/Content/ContentApplicationValidator.d.ts +0 -284
  76. package/sdk/application/Content/ContentApplicationValidator.js +0 -264
  77. package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +0 -272
  78. package/sdk/application/FileStorage/FileStorageApplicationModel.js +0 -190
  79. package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +0 -56
  80. package/sdk/application/FileStorage/FileStorageApplicationValidator.js +0 -53
  81. package/sdk/application/Lead/LeadApplicationModel.d.ts +0 -590
  82. package/sdk/application/Lead/LeadApplicationModel.js +0 -480
  83. package/sdk/application/Lead/LeadApplicationValidator.d.ts +0 -68
  84. package/sdk/application/Lead/LeadApplicationValidator.js +0 -71
  85. package/sdk/application/Logistic/LogisticApplicationModel.d.ts +0 -1675
  86. package/sdk/application/Logistic/LogisticApplicationModel.js +0 -1121
  87. package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +0 -254
  88. package/sdk/application/Logistic/LogisticApplicationValidator.js +0 -190
  89. package/sdk/application/Order/OrderApplicationModel.d.ts +0 -2296
  90. package/sdk/application/Order/OrderApplicationModel.js +0 -1471
  91. package/sdk/application/Order/OrderApplicationValidator.d.ts +0 -265
  92. package/sdk/application/Order/OrderApplicationValidator.js +0 -197
  93. package/sdk/application/Payment/PaymentApplicationModel.d.ts +0 -4058
  94. package/sdk/application/Payment/PaymentApplicationModel.js +0 -2630
  95. package/sdk/application/Payment/PaymentApplicationValidator.d.ts +0 -576
  96. package/sdk/application/Payment/PaymentApplicationValidator.js +0 -594
  97. package/sdk/application/Rewards/RewardsApplicationModel.d.ts +0 -365
  98. package/sdk/application/Rewards/RewardsApplicationModel.js +0 -396
  99. package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +0 -73
  100. package/sdk/application/Rewards/RewardsApplicationValidator.js +0 -84
  101. package/sdk/application/Share/ShareApplicationModel.d.ts +0 -339
  102. package/sdk/application/Share/ShareApplicationModel.js +0 -234
  103. package/sdk/application/Share/ShareApplicationValidator.d.ts +0 -90
  104. package/sdk/application/Share/ShareApplicationValidator.js +0 -91
  105. package/sdk/application/Theme/ThemeApplicationModel.d.ts +0 -1713
  106. package/sdk/application/Theme/ThemeApplicationModel.js +0 -1426
  107. package/sdk/application/Theme/ThemeApplicationValidator.d.ts +0 -66
  108. package/sdk/application/Theme/ThemeApplicationValidator.js +0 -58
  109. package/sdk/application/User/UserApplicationModel.d.ts +0 -1943
  110. package/sdk/application/User/UserApplicationModel.js +0 -1382
  111. package/sdk/application/User/UserApplicationValidator.d.ts +0 -560
  112. package/sdk/application/User/UserApplicationValidator.js +0 -573
  113. package/sdk/application/Webhook/WebhookApplicationModel.d.ts +0 -52
  114. package/sdk/application/Webhook/WebhookApplicationModel.js +0 -46
  115. package/sdk/application/Webhook/WebhookApplicationValidator.d.ts +0 -16
  116. package/sdk/application/Webhook/WebhookApplicationValidator.js +0 -19
  117. package/sdk/common/Clickstream.d.ts +0 -1
  118. package/sdk/common/Clickstream.js +0 -464
@@ -10,35 +10,32 @@ declare class FileStorage {
10
10
  _urls: {};
11
11
  updateUrls(urls: any): void;
12
12
  /**
13
- * @param {FileStorageApplicationValidator.CompleteUploadParam} arg - Arg object.
14
13
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
15
14
  * @param {import("../ApplicationAPIClient").Options} - Options
16
- * @returns {Promise<FileStorageApplicationModel.CompleteResponse>} - Success response
15
+ * @returns {Promise<CompleteResponse>} - Success response
17
16
  * @name completeUpload
18
17
  * @summary: Complete file upload
19
18
  * @description: Complete the file upload and store the file details such as name, size, content type, and namespace to maintain integrity within the system's database. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/filestorage/completeUpload/).
20
19
  */
21
- completeUpload({ namespace, body, requestHeaders }?: FileStorageApplicationValidator.CompleteUploadParam, { responseHeaders }?: object): Promise<FileStorageApplicationModel.CompleteResponse>;
20
+ completeUpload({ namespace, body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<CompleteResponse>;
22
21
  /**
23
- * @param {FileStorageApplicationValidator.SignUrlsParam} arg - Arg object.
24
22
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
25
23
  * @param {import("../ApplicationAPIClient").Options} - Options
26
- * @returns {Promise<FileStorageApplicationModel.SignUrlResponse>} - Success response
24
+ * @returns {Promise<SignUrlResponse>} - Success response
27
25
  * @name signUrls
28
26
  * @summary: Get signed URLs
29
27
  * @description: Generates secure, signed URLs that is valid for certain expiry time for accessing stored files. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/filestorage/signUrls/).
30
28
  */
31
- signUrls({ body, requestHeaders }?: FileStorageApplicationValidator.SignUrlsParam, { responseHeaders }?: object): Promise<FileStorageApplicationModel.SignUrlResponse>;
29
+ signUrls({ body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<SignUrlResponse>;
32
30
  /**
33
- * @param {FileStorageApplicationValidator.StartUploadParam} arg - Arg object.
34
31
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
35
32
  * @param {import("../ApplicationAPIClient").Options} - Options
36
- * @returns {Promise<FileStorageApplicationModel.StartResponse>} - Success response
33
+ * @returns {Promise<StartResponse>} - Success response
37
34
  * @name startUpload
38
35
  * @summary: Initiates file upload
39
36
  * @description: Starts the process of uploading a file to storage location, and returns a signed url in response. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/filestorage/startUpload/).
40
37
  */
41
- startUpload({ namespace, body, requestHeaders }?: FileStorageApplicationValidator.StartUploadParam, { responseHeaders }?: object): Promise<FileStorageApplicationModel.StartResponse>;
38
+ startUpload({ namespace, body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<StartResponse>;
42
39
  /**
43
40
  * @param data
44
41
  * @param {string} file_name
@@ -56,5 +53,3 @@ declare class FileStorage {
56
53
  tags: any;
57
54
  }): Promise<any>;
58
55
  }
59
- import FileStorageApplicationValidator = require("./FileStorageApplicationValidator");
60
- import FileStorageApplicationModel = require("./FileStorageApplicationModel");
@@ -1,14 +1,7 @@
1
1
  const ApplicationAPIClient = require("../ApplicationAPIClient");
2
- const {
3
- FDKClientValidationError,
4
- FDKResponseValidationError,
5
- } = require("../../common/FDKError");
6
2
  const constructUrl = require("../constructUrl");
7
3
  const Paginator = require("../../common/Paginator");
8
- const FileStorageApplicationValidator = require("./FileStorageApplicationValidator");
9
- const FileStorageApplicationModel = require("./FileStorageApplicationModel");
10
- const { Logger } = require("./../../common/Logger");
11
- const Joi = require("joi");
4
+
12
5
  const { fdkAxios } = require("../../common/AxiosHelper.js");
13
6
 
14
7
  class FileStorage {
@@ -38,10 +31,9 @@ class FileStorage {
38
31
  }
39
32
 
40
33
  /**
41
- * @param {FileStorageApplicationValidator.CompleteUploadParam} arg - Arg object.
42
34
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
43
35
  * @param {import("../ApplicationAPIClient").Options} - Options
44
- * @returns {Promise<FileStorageApplicationModel.CompleteResponse>} - Success response
36
+ * @returns {Promise<CompleteResponse>} - Success response
45
37
  * @name completeUpload
46
38
  * @summary: Complete file upload
47
39
  * @description: Complete the file upload and store the file details such as name, size, content type, and namespace to maintain integrity within the system's database. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/filestorage/completeUpload/).
@@ -50,28 +42,6 @@ class FileStorage {
50
42
  { namespace, body, requestHeaders } = { requestHeaders: {} },
51
43
  { responseHeaders } = { responseHeaders: false }
52
44
  ) {
53
- const { error } = FileStorageApplicationValidator.completeUpload().validate(
54
- { namespace, body },
55
- { abortEarly: false, allowUnknown: true }
56
- );
57
- if (error) {
58
- return Promise.reject(new FDKClientValidationError(error));
59
- }
60
-
61
- // Showing warrnings if extra unknown parameters are found
62
- const {
63
- error: warrning,
64
- } = FileStorageApplicationValidator.completeUpload().validate(
65
- { namespace, body },
66
- { abortEarly: false, allowUnknown: false }
67
- );
68
- if (warrning) {
69
- Logger({
70
- level: "WARN",
71
- message: `Parameter Validation warrnings for application > FileStorage > completeUpload \n ${warrning}`,
72
- });
73
- }
74
-
75
45
  const query_params = {};
76
46
 
77
47
  const xHeaders = {};
@@ -94,32 +64,13 @@ class FileStorage {
94
64
  responseData = response[0];
95
65
  }
96
66
 
97
- const {
98
- error: res_error,
99
- } = FileStorageApplicationModel.CompleteResponse().validate(responseData, {
100
- abortEarly: false,
101
- allowUnknown: true,
102
- });
103
-
104
- if (res_error) {
105
- if (this._conf.options.strictResponseCheck === true) {
106
- return Promise.reject(new FDKResponseValidationError(res_error));
107
- } else {
108
- Logger({
109
- level: "WARN",
110
- message: `Response Validation Warnings for application > FileStorage > completeUpload \n ${res_error}`,
111
- });
112
- }
113
- }
114
-
115
67
  return response;
116
68
  }
117
69
 
118
70
  /**
119
- * @param {FileStorageApplicationValidator.SignUrlsParam} arg - Arg object.
120
71
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
121
72
  * @param {import("../ApplicationAPIClient").Options} - Options
122
- * @returns {Promise<FileStorageApplicationModel.SignUrlResponse>} - Success response
73
+ * @returns {Promise<SignUrlResponse>} - Success response
123
74
  * @name signUrls
124
75
  * @summary: Get signed URLs
125
76
  * @description: Generates secure, signed URLs that is valid for certain expiry time for accessing stored files. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/filestorage/signUrls/).
@@ -128,28 +79,6 @@ class FileStorage {
128
79
  { body, requestHeaders } = { requestHeaders: {} },
129
80
  { responseHeaders } = { responseHeaders: false }
130
81
  ) {
131
- const { error } = FileStorageApplicationValidator.signUrls().validate(
132
- { body },
133
- { abortEarly: false, allowUnknown: true }
134
- );
135
- if (error) {
136
- return Promise.reject(new FDKClientValidationError(error));
137
- }
138
-
139
- // Showing warrnings if extra unknown parameters are found
140
- const {
141
- error: warrning,
142
- } = FileStorageApplicationValidator.signUrls().validate(
143
- { body },
144
- { abortEarly: false, allowUnknown: false }
145
- );
146
- if (warrning) {
147
- Logger({
148
- level: "WARN",
149
- message: `Parameter Validation warrnings for application > FileStorage > signUrls \n ${warrning}`,
150
- });
151
- }
152
-
153
82
  const query_params = {};
154
83
 
155
84
  const xHeaders = {};
@@ -172,32 +101,13 @@ class FileStorage {
172
101
  responseData = response[0];
173
102
  }
174
103
 
175
- const {
176
- error: res_error,
177
- } = FileStorageApplicationModel.SignUrlResponse().validate(responseData, {
178
- abortEarly: false,
179
- allowUnknown: true,
180
- });
181
-
182
- if (res_error) {
183
- if (this._conf.options.strictResponseCheck === true) {
184
- return Promise.reject(new FDKResponseValidationError(res_error));
185
- } else {
186
- Logger({
187
- level: "WARN",
188
- message: `Response Validation Warnings for application > FileStorage > signUrls \n ${res_error}`,
189
- });
190
- }
191
- }
192
-
193
104
  return response;
194
105
  }
195
106
 
196
107
  /**
197
- * @param {FileStorageApplicationValidator.StartUploadParam} arg - Arg object.
198
108
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
199
109
  * @param {import("../ApplicationAPIClient").Options} - Options
200
- * @returns {Promise<FileStorageApplicationModel.StartResponse>} - Success response
110
+ * @returns {Promise<StartResponse>} - Success response
201
111
  * @name startUpload
202
112
  * @summary: Initiates file upload
203
113
  * @description: Starts the process of uploading a file to storage location, and returns a signed url in response. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/filestorage/startUpload/).
@@ -206,28 +116,6 @@ class FileStorage {
206
116
  { namespace, body, requestHeaders } = { requestHeaders: {} },
207
117
  { responseHeaders } = { responseHeaders: false }
208
118
  ) {
209
- const { error } = FileStorageApplicationValidator.startUpload().validate(
210
- { namespace, body },
211
- { abortEarly: false, allowUnknown: true }
212
- );
213
- if (error) {
214
- return Promise.reject(new FDKClientValidationError(error));
215
- }
216
-
217
- // Showing warrnings if extra unknown parameters are found
218
- const {
219
- error: warrning,
220
- } = FileStorageApplicationValidator.startUpload().validate(
221
- { namespace, body },
222
- { abortEarly: false, allowUnknown: false }
223
- );
224
- if (warrning) {
225
- Logger({
226
- level: "WARN",
227
- message: `Parameter Validation warrnings for application > FileStorage > startUpload \n ${warrning}`,
228
- });
229
- }
230
-
231
119
  const query_params = {};
232
120
 
233
121
  const xHeaders = {};
@@ -250,24 +138,6 @@ class FileStorage {
250
138
  responseData = response[0];
251
139
  }
252
140
 
253
- const {
254
- error: res_error,
255
- } = FileStorageApplicationModel.StartResponse().validate(responseData, {
256
- abortEarly: false,
257
- allowUnknown: true,
258
- });
259
-
260
- if (res_error) {
261
- if (this._conf.options.strictResponseCheck === true) {
262
- return Promise.reject(new FDKResponseValidationError(res_error));
263
- } else {
264
- Logger({
265
- level: "WARN",
266
- message: `Response Validation Warnings for application > FileStorage > startUpload \n ${res_error}`,
267
- });
268
- }
269
- }
270
-
271
141
  return response;
272
142
  }
273
143
  }
@@ -12,56 +12,48 @@ declare class Lead {
12
12
  _urls: {};
13
13
  updateUrls(urls: any): void;
14
14
  /**
15
- * @param {LeadApplicationValidator.CreateHistoryParam} arg - Arg object.
16
15
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
17
16
  * @param {import("../ApplicationAPIClient").Options} - Options
18
- * @returns {Promise<LeadApplicationModel.TicketHistory>} - Success response
17
+ * @returns {Promise<TicketHistory>} - Success response
19
18
  * @name createHistory
20
19
  * @summary: Log ticket history
21
20
  * @description: Create a history entry for a specific support ticket. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/lead/createHistory/).
22
21
  */
23
- createHistory({ id, body, requestHeaders }?: LeadApplicationValidator.CreateHistoryParam, { responseHeaders }?: object): Promise<LeadApplicationModel.TicketHistory>;
22
+ createHistory({ id, body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<TicketHistory>;
24
23
  /**
25
- * @param {LeadApplicationValidator.CreateTicketParam} arg - Arg object.
26
24
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
27
25
  * @param {import("../ApplicationAPIClient").Options} - Options
28
- * @returns {Promise<LeadApplicationModel.Ticket>} - Success response
26
+ * @returns {Promise<Ticket>} - Success response
29
27
  * @name createTicket
30
28
  * @summary: Creates a ticket
31
29
  * @description: Create a new customer support ticket for a user query. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/lead/createTicket/).
32
30
  */
33
- createTicket({ body, requestHeaders }?: LeadApplicationValidator.CreateTicketParam, { responseHeaders }?: object): Promise<LeadApplicationModel.Ticket>;
31
+ createTicket({ body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<Ticket>;
34
32
  /**
35
- * @param {LeadApplicationValidator.GetCustomFormParam} arg - Arg object.
36
33
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
37
34
  * @param {import("../ApplicationAPIClient").Options} - Options
38
- * @returns {Promise<LeadApplicationModel.CustomForm>} - Success response
35
+ * @returns {Promise<CustomForm>} - Success response
39
36
  * @name getCustomForm
40
37
  * @summary: Get custom form
41
38
  * @description: Get a customizable form template for data collection. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/lead/getCustomForm/).
42
39
  */
43
- getCustomForm({ slug, requestHeaders }?: LeadApplicationValidator.GetCustomFormParam, { responseHeaders }?: object): Promise<LeadApplicationModel.CustomForm>;
40
+ getCustomForm({ slug, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<CustomForm>;
44
41
  /**
45
- * @param {LeadApplicationValidator.GetTicketParam} arg - Arg object.
46
42
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
47
43
  * @param {import("../ApplicationAPIClient").Options} - Options
48
- * @returns {Promise<LeadApplicationModel.Ticket>} - Success response
44
+ * @returns {Promise<Ticket>} - Success response
49
45
  * @name getTicket
50
46
  * @summary: Get a support ticket
51
47
  * @description: Get details of a specific customer support ticket. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/lead/getTicket/).
52
48
  */
53
- getTicket({ id, requestHeaders }?: LeadApplicationValidator.GetTicketParam, { responseHeaders }?: object): Promise<LeadApplicationModel.Ticket>;
49
+ getTicket({ id, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<Ticket>;
54
50
  /**
55
- * @param {LeadApplicationValidator.SubmitCustomFormParam} arg - Arg object.
56
51
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
57
52
  * @param {import("../ApplicationAPIClient").Options} - Options
58
- * @returns {Promise<LeadApplicationModel.SubmitCustomFormResponse>} -
59
- * Success response
53
+ * @returns {Promise<SubmitCustomFormResponse>} - Success response
60
54
  * @name submitCustomForm
61
55
  * @summary: Submits form data
62
56
  * @description: Create user-entered data from a custom form for processing. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/lead/submitCustomForm/).
63
57
  */
64
- submitCustomForm({ slug, body, requestHeaders }?: LeadApplicationValidator.SubmitCustomFormParam, { responseHeaders }?: object): Promise<LeadApplicationModel.SubmitCustomFormResponse>;
58
+ submitCustomForm({ slug, body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<SubmitCustomFormResponse>;
65
59
  }
66
- import LeadApplicationValidator = require("./LeadApplicationValidator");
67
- import LeadApplicationModel = require("./LeadApplicationModel");
@@ -1,14 +1,6 @@
1
1
  const ApplicationAPIClient = require("../ApplicationAPIClient");
2
- const {
3
- FDKClientValidationError,
4
- FDKResponseValidationError,
5
- } = require("../../common/FDKError");
6
2
  const constructUrl = require("../constructUrl");
7
3
  const Paginator = require("../../common/Paginator");
8
- const LeadApplicationValidator = require("./LeadApplicationValidator");
9
- const LeadApplicationModel = require("./LeadApplicationModel");
10
- const { Logger } = require("./../../common/Logger");
11
- const Joi = require("joi");
12
4
 
13
5
  class Lead {
14
6
  constructor(_conf) {
@@ -37,10 +29,9 @@ class Lead {
37
29
  }
38
30
 
39
31
  /**
40
- * @param {LeadApplicationValidator.CreateHistoryParam} arg - Arg object.
41
32
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
42
33
  * @param {import("../ApplicationAPIClient").Options} - Options
43
- * @returns {Promise<LeadApplicationModel.TicketHistory>} - Success response
34
+ * @returns {Promise<TicketHistory>} - Success response
44
35
  * @name createHistory
45
36
  * @summary: Log ticket history
46
37
  * @description: Create a history entry for a specific support ticket. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/lead/createHistory/).
@@ -49,28 +40,6 @@ class Lead {
49
40
  { id, body, requestHeaders } = { requestHeaders: {} },
50
41
  { responseHeaders } = { responseHeaders: false }
51
42
  ) {
52
- const { error } = LeadApplicationValidator.createHistory().validate(
53
- { id, body },
54
- { abortEarly: false, allowUnknown: true }
55
- );
56
- if (error) {
57
- return Promise.reject(new FDKClientValidationError(error));
58
- }
59
-
60
- // Showing warrnings if extra unknown parameters are found
61
- const {
62
- error: warrning,
63
- } = LeadApplicationValidator.createHistory().validate(
64
- { id, body },
65
- { abortEarly: false, allowUnknown: false }
66
- );
67
- if (warrning) {
68
- Logger({
69
- level: "WARN",
70
- message: `Parameter Validation warrnings for application > Lead > createHistory \n ${warrning}`,
71
- });
72
- }
73
-
74
43
  const query_params = {};
75
44
 
76
45
  const xHeaders = {};
@@ -93,32 +62,13 @@ class Lead {
93
62
  responseData = response[0];
94
63
  }
95
64
 
96
- const {
97
- error: res_error,
98
- } = LeadApplicationModel.TicketHistory().validate(responseData, {
99
- abortEarly: false,
100
- allowUnknown: true,
101
- });
102
-
103
- if (res_error) {
104
- if (this._conf.options.strictResponseCheck === true) {
105
- return Promise.reject(new FDKResponseValidationError(res_error));
106
- } else {
107
- Logger({
108
- level: "WARN",
109
- message: `Response Validation Warnings for application > Lead > createHistory \n ${res_error}`,
110
- });
111
- }
112
- }
113
-
114
65
  return response;
115
66
  }
116
67
 
117
68
  /**
118
- * @param {LeadApplicationValidator.CreateTicketParam} arg - Arg object.
119
69
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
120
70
  * @param {import("../ApplicationAPIClient").Options} - Options
121
- * @returns {Promise<LeadApplicationModel.Ticket>} - Success response
71
+ * @returns {Promise<Ticket>} - Success response
122
72
  * @name createTicket
123
73
  * @summary: Creates a ticket
124
74
  * @description: Create a new customer support ticket for a user query. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/lead/createTicket/).
@@ -127,28 +77,6 @@ class Lead {
127
77
  { body, requestHeaders } = { requestHeaders: {} },
128
78
  { responseHeaders } = { responseHeaders: false }
129
79
  ) {
130
- const { error } = LeadApplicationValidator.createTicket().validate(
131
- { body },
132
- { abortEarly: false, allowUnknown: true }
133
- );
134
- if (error) {
135
- return Promise.reject(new FDKClientValidationError(error));
136
- }
137
-
138
- // Showing warrnings if extra unknown parameters are found
139
- const {
140
- error: warrning,
141
- } = LeadApplicationValidator.createTicket().validate(
142
- { body },
143
- { abortEarly: false, allowUnknown: false }
144
- );
145
- if (warrning) {
146
- Logger({
147
- level: "WARN",
148
- message: `Parameter Validation warrnings for application > Lead > createTicket \n ${warrning}`,
149
- });
150
- }
151
-
152
80
  const query_params = {};
153
81
 
154
82
  const xHeaders = {};
@@ -171,32 +99,13 @@ class Lead {
171
99
  responseData = response[0];
172
100
  }
173
101
 
174
- const {
175
- error: res_error,
176
- } = LeadApplicationModel.Ticket().validate(responseData, {
177
- abortEarly: false,
178
- allowUnknown: true,
179
- });
180
-
181
- if (res_error) {
182
- if (this._conf.options.strictResponseCheck === true) {
183
- return Promise.reject(new FDKResponseValidationError(res_error));
184
- } else {
185
- Logger({
186
- level: "WARN",
187
- message: `Response Validation Warnings for application > Lead > createTicket \n ${res_error}`,
188
- });
189
- }
190
- }
191
-
192
102
  return response;
193
103
  }
194
104
 
195
105
  /**
196
- * @param {LeadApplicationValidator.GetCustomFormParam} arg - Arg object.
197
106
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
198
107
  * @param {import("../ApplicationAPIClient").Options} - Options
199
- * @returns {Promise<LeadApplicationModel.CustomForm>} - Success response
108
+ * @returns {Promise<CustomForm>} - Success response
200
109
  * @name getCustomForm
201
110
  * @summary: Get custom form
202
111
  * @description: Get a customizable form template for data collection. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/lead/getCustomForm/).
@@ -205,28 +114,6 @@ class Lead {
205
114
  { slug, requestHeaders } = { requestHeaders: {} },
206
115
  { responseHeaders } = { responseHeaders: false }
207
116
  ) {
208
- const { error } = LeadApplicationValidator.getCustomForm().validate(
209
- { slug },
210
- { abortEarly: false, allowUnknown: true }
211
- );
212
- if (error) {
213
- return Promise.reject(new FDKClientValidationError(error));
214
- }
215
-
216
- // Showing warrnings if extra unknown parameters are found
217
- const {
218
- error: warrning,
219
- } = LeadApplicationValidator.getCustomForm().validate(
220
- { slug },
221
- { abortEarly: false, allowUnknown: false }
222
- );
223
- if (warrning) {
224
- Logger({
225
- level: "WARN",
226
- message: `Parameter Validation warrnings for application > Lead > getCustomForm \n ${warrning}`,
227
- });
228
- }
229
-
230
117
  const query_params = {};
231
118
 
232
119
  const xHeaders = {};
@@ -249,32 +136,13 @@ class Lead {
249
136
  responseData = response[0];
250
137
  }
251
138
 
252
- const {
253
- error: res_error,
254
- } = LeadApplicationModel.CustomForm().validate(responseData, {
255
- abortEarly: false,
256
- allowUnknown: true,
257
- });
258
-
259
- if (res_error) {
260
- if (this._conf.options.strictResponseCheck === true) {
261
- return Promise.reject(new FDKResponseValidationError(res_error));
262
- } else {
263
- Logger({
264
- level: "WARN",
265
- message: `Response Validation Warnings for application > Lead > getCustomForm \n ${res_error}`,
266
- });
267
- }
268
- }
269
-
270
139
  return response;
271
140
  }
272
141
 
273
142
  /**
274
- * @param {LeadApplicationValidator.GetTicketParam} arg - Arg object.
275
143
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
276
144
  * @param {import("../ApplicationAPIClient").Options} - Options
277
- * @returns {Promise<LeadApplicationModel.Ticket>} - Success response
145
+ * @returns {Promise<Ticket>} - Success response
278
146
  * @name getTicket
279
147
  * @summary: Get a support ticket
280
148
  * @description: Get details of a specific customer support ticket. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/lead/getTicket/).
@@ -283,26 +151,6 @@ class Lead {
283
151
  { id, requestHeaders } = { requestHeaders: {} },
284
152
  { responseHeaders } = { responseHeaders: false }
285
153
  ) {
286
- const { error } = LeadApplicationValidator.getTicket().validate(
287
- { id },
288
- { abortEarly: false, allowUnknown: true }
289
- );
290
- if (error) {
291
- return Promise.reject(new FDKClientValidationError(error));
292
- }
293
-
294
- // Showing warrnings if extra unknown parameters are found
295
- const { error: warrning } = LeadApplicationValidator.getTicket().validate(
296
- { id },
297
- { abortEarly: false, allowUnknown: false }
298
- );
299
- if (warrning) {
300
- Logger({
301
- level: "WARN",
302
- message: `Parameter Validation warrnings for application > Lead > getTicket \n ${warrning}`,
303
- });
304
- }
305
-
306
154
  const query_params = {};
307
155
 
308
156
  const xHeaders = {};
@@ -325,33 +173,13 @@ class Lead {
325
173
  responseData = response[0];
326
174
  }
327
175
 
328
- const {
329
- error: res_error,
330
- } = LeadApplicationModel.Ticket().validate(responseData, {
331
- abortEarly: false,
332
- allowUnknown: true,
333
- });
334
-
335
- if (res_error) {
336
- if (this._conf.options.strictResponseCheck === true) {
337
- return Promise.reject(new FDKResponseValidationError(res_error));
338
- } else {
339
- Logger({
340
- level: "WARN",
341
- message: `Response Validation Warnings for application > Lead > getTicket \n ${res_error}`,
342
- });
343
- }
344
- }
345
-
346
176
  return response;
347
177
  }
348
178
 
349
179
  /**
350
- * @param {LeadApplicationValidator.SubmitCustomFormParam} arg - Arg object.
351
180
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
352
181
  * @param {import("../ApplicationAPIClient").Options} - Options
353
- * @returns {Promise<LeadApplicationModel.SubmitCustomFormResponse>} -
354
- * Success response
182
+ * @returns {Promise<SubmitCustomFormResponse>} - Success response
355
183
  * @name submitCustomForm
356
184
  * @summary: Submits form data
357
185
  * @description: Create user-entered data from a custom form for processing. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/lead/submitCustomForm/).
@@ -360,28 +188,6 @@ class Lead {
360
188
  { slug, body, requestHeaders } = { requestHeaders: {} },
361
189
  { responseHeaders } = { responseHeaders: false }
362
190
  ) {
363
- const { error } = LeadApplicationValidator.submitCustomForm().validate(
364
- { slug, body },
365
- { abortEarly: false, allowUnknown: true }
366
- );
367
- if (error) {
368
- return Promise.reject(new FDKClientValidationError(error));
369
- }
370
-
371
- // Showing warrnings if extra unknown parameters are found
372
- const {
373
- error: warrning,
374
- } = LeadApplicationValidator.submitCustomForm().validate(
375
- { slug, body },
376
- { abortEarly: false, allowUnknown: false }
377
- );
378
- if (warrning) {
379
- Logger({
380
- level: "WARN",
381
- message: `Parameter Validation warrnings for application > Lead > submitCustomForm \n ${warrning}`,
382
- });
383
- }
384
-
385
191
  const query_params = {};
386
192
 
387
193
  const xHeaders = {};
@@ -404,24 +210,6 @@ class Lead {
404
210
  responseData = response[0];
405
211
  }
406
212
 
407
- const {
408
- error: res_error,
409
- } = LeadApplicationModel.SubmitCustomFormResponse().validate(responseData, {
410
- abortEarly: false,
411
- allowUnknown: true,
412
- });
413
-
414
- if (res_error) {
415
- if (this._conf.options.strictResponseCheck === true) {
416
- return Promise.reject(new FDKResponseValidationError(res_error));
417
- } else {
418
- Logger({
419
- level: "WARN",
420
- message: `Response Validation Warnings for application > Lead > submitCustomForm \n ${res_error}`,
421
- });
422
- }
423
- }
424
-
425
213
  return response;
426
214
  }
427
215
  }