@gofynd/fdk-client-javascript 1.4.8-beta.3 → 1.4.9

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 (189) hide show
  1. package/README.md +26 -1
  2. package/package.json +2 -2
  3. package/sdk/application/ApplicationClient.d.ts +8 -0
  4. package/sdk/application/ApplicationClient.js +14 -0
  5. package/sdk/application/Cart/CartApplicationClient.d.ts +20 -20
  6. package/sdk/application/Cart/CartApplicationClient.js +20 -20
  7. package/sdk/application/Cart/CartApplicationModel.d.ts +2446 -664
  8. package/sdk/application/Cart/CartApplicationModel.js +783 -552
  9. package/sdk/application/Cart/CartApplicationValidator.d.ts +268 -194
  10. package/sdk/application/Cart/CartApplicationValidator.js +100 -114
  11. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +53 -53
  12. package/sdk/application/Catalog/CatalogApplicationClient.js +53 -53
  13. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +2012 -503
  14. package/sdk/application/Catalog/CatalogApplicationModel.js +603 -453
  15. package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +64 -64
  16. package/sdk/application/Catalog/CatalogApplicationValidator.js +32 -32
  17. package/sdk/application/Common/CommonApplicationClient.d.ts +2 -2
  18. package/sdk/application/Common/CommonApplicationClient.js +2 -2
  19. package/sdk/application/Common/CommonApplicationModel.d.ts +170 -90
  20. package/sdk/application/Common/CommonApplicationModel.js +59 -58
  21. package/sdk/application/Common/CommonApplicationValidator.d.ts +8 -5
  22. package/sdk/application/Common/CommonApplicationValidator.js +3 -3
  23. package/sdk/application/Communication/CommunicationApplicationClient.d.ts +2 -2
  24. package/sdk/application/Communication/CommunicationApplicationClient.js +2 -2
  25. package/sdk/application/Communication/CommunicationApplicationModel.d.ts +170 -35
  26. package/sdk/application/Communication/CommunicationApplicationModel.js +54 -33
  27. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +15 -15
  28. package/sdk/application/Configuration/ConfigurationApplicationClient.js +15 -15
  29. package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +624 -443
  30. package/sdk/application/Configuration/ConfigurationApplicationModel.js +259 -248
  31. package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +32 -24
  32. package/sdk/application/Configuration/ConfigurationApplicationValidator.js +14 -13
  33. package/sdk/application/Content/ContentApplicationClient.d.ts +16 -16
  34. package/sdk/application/Content/ContentApplicationClient.js +16 -16
  35. package/sdk/application/Content/ContentApplicationModel.d.ts +1205 -282
  36. package/sdk/application/Content/ContentApplicationModel.js +341 -277
  37. package/sdk/application/Content/ContentApplicationValidator.d.ts +28 -17
  38. package/sdk/application/Content/ContentApplicationValidator.js +11 -10
  39. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +3 -3
  40. package/sdk/application/FileStorage/FileStorageApplicationClient.js +3 -3
  41. package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +146 -37
  42. package/sdk/application/FileStorage/FileStorageApplicationModel.js +38 -36
  43. package/sdk/application/Lead/LeadApplicationClient.d.ts +3 -3
  44. package/sdk/application/Lead/LeadApplicationClient.js +3 -3
  45. package/sdk/application/Lead/LeadApplicationModel.d.ts +195 -134
  46. package/sdk/application/Lead/LeadApplicationModel.js +110 -67
  47. package/sdk/application/Lead/LeadApplicationValidator.d.ts +8 -8
  48. package/sdk/application/Lead/LeadApplicationValidator.js +4 -4
  49. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +10 -10
  50. package/sdk/application/Logistic/LogisticApplicationClient.js +10 -10
  51. package/sdk/application/Logistic/LogisticApplicationModel.d.ts +1039 -221
  52. package/sdk/application/Logistic/LogisticApplicationModel.js +342 -199
  53. package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +76 -82
  54. package/sdk/application/Logistic/LogisticApplicationValidator.js +38 -41
  55. package/sdk/application/Order/OrderApplicationClient.d.ts +10 -10
  56. package/sdk/application/Order/OrderApplicationClient.js +10 -10
  57. package/sdk/application/Order/OrderApplicationModel.d.ts +1400 -325
  58. package/sdk/application/Order/OrderApplicationModel.js +391 -317
  59. package/sdk/application/Order/OrderApplicationValidator.d.ts +32 -30
  60. package/sdk/application/Order/OrderApplicationValidator.js +15 -14
  61. package/sdk/application/Payment/PaymentApplicationClient.d.ts +43 -43
  62. package/sdk/application/Payment/PaymentApplicationClient.js +43 -43
  63. package/sdk/application/Payment/PaymentApplicationModel.d.ts +1111 -1022
  64. package/sdk/application/Payment/PaymentApplicationModel.js +537 -521
  65. package/sdk/application/Payment/PaymentApplicationValidator.d.ts +82 -49
  66. package/sdk/application/Payment/PaymentApplicationValidator.js +30 -30
  67. package/sdk/application/Rewards/RewardsApplicationModel.d.ts +28 -7
  68. package/sdk/application/Rewards/RewardsApplicationModel.js +7 -7
  69. package/sdk/application/Share/ShareApplicationModel.d.ts +178 -38
  70. package/sdk/application/Share/ShareApplicationModel.js +53 -37
  71. package/sdk/application/Share/ShareApplicationValidator.d.ts +4 -2
  72. package/sdk/application/Share/ShareApplicationValidator.js +2 -1
  73. package/sdk/application/Theme/ThemeApplicationClient.d.ts +4 -4
  74. package/sdk/application/Theme/ThemeApplicationClient.js +14 -8
  75. package/sdk/application/Theme/ThemeApplicationModel.d.ts +528 -287
  76. package/sdk/application/Theme/ThemeApplicationModel.js +208 -172
  77. package/sdk/application/Theme/ThemeApplicationValidator.d.ts +17 -12
  78. package/sdk/application/Theme/ThemeApplicationValidator.js +8 -6
  79. package/sdk/application/User/UserApplicationClient.d.ts +36 -36
  80. package/sdk/application/User/UserApplicationClient.js +36 -36
  81. package/sdk/application/User/UserApplicationModel.d.ts +1062 -255
  82. package/sdk/application/User/UserApplicationModel.js +298 -244
  83. package/sdk/application/User/UserApplicationValidator.d.ts +80 -80
  84. package/sdk/application/User/UserApplicationValidator.js +40 -40
  85. package/sdk/application/Webhook/WebhookApplicationClient.d.ts +1 -1
  86. package/sdk/application/Webhook/WebhookApplicationClient.js +1 -1
  87. package/sdk/application/Webhook/WebhookApplicationModel.d.ts +20 -5
  88. package/sdk/application/Webhook/WebhookApplicationModel.js +5 -5
  89. package/sdk/common/Clickstream.js +95 -15
  90. package/sdk/common/Constant.d.ts +9 -0
  91. package/sdk/common/Constant.js +11 -0
  92. package/sdk/common/Utility.js +19 -0
  93. package/sdk/common/utils.js +8 -1
  94. package/sdk/partner/Lead/LeadPartnerModel.d.ts +28 -7
  95. package/sdk/partner/Lead/LeadPartnerModel.js +7 -7
  96. package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +28 -7
  97. package/sdk/partner/Logistics/LogisticsPartnerModel.js +7 -7
  98. package/sdk/partner/PartnerClient.d.ts +8 -0
  99. package/sdk/partner/PartnerClient.js +14 -0
  100. package/sdk/partner/Theme/ThemePartnerClient.d.ts +20 -0
  101. package/sdk/partner/Theme/ThemePartnerClient.js +158 -0
  102. package/sdk/partner/Theme/ThemePartnerModel.d.ts +45 -6
  103. package/sdk/partner/Theme/ThemePartnerModel.js +33 -4
  104. package/sdk/partner/Theme/ThemePartnerValidator.d.ts +2 -0
  105. package/sdk/partner/Theme/ThemePartnerValidator.js +14 -0
  106. package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +28 -7
  107. package/sdk/partner/Webhook/WebhookPartnerModel.js +7 -7
  108. package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +28 -7
  109. package/sdk/platform/Analytics/AnalyticsPlatformModel.js +7 -7
  110. package/sdk/platform/Billing/BillingPlatformClient.d.ts +6 -397
  111. package/sdk/platform/Billing/BillingPlatformClient.js +77 -3215
  112. package/sdk/platform/Billing/BillingPlatformModel.d.ts +621 -2021
  113. package/sdk/platform/Billing/BillingPlatformModel.js +353 -2405
  114. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +12 -451
  115. package/sdk/platform/Billing/BillingPlatformValidator.js +8 -483
  116. package/sdk/platform/Cart/CartPlatformModel.d.ts +28 -7
  117. package/sdk/platform/Cart/CartPlatformModel.js +8 -8
  118. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +12 -2
  119. package/sdk/platform/Catalog/CatalogPlatformClient.js +41 -1
  120. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +46 -12
  121. package/sdk/platform/Catalog/CatalogPlatformModel.js +14 -11
  122. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +40 -0
  123. package/sdk/platform/Catalog/CatalogPlatformValidator.js +17 -0
  124. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +28 -7
  125. package/sdk/platform/Communication/CommunicationPlatformModel.js +7 -7
  126. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +28 -7
  127. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +7 -7
  128. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +0 -97
  129. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +77 -782
  130. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +24 -701
  131. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +7 -539
  132. package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +1 -183
  133. package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +0 -134
  134. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +0 -10
  135. package/sdk/platform/Content/ContentPlatformApplicationClient.js +0 -79
  136. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +1 -15
  137. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +0 -13
  138. package/sdk/platform/Content/ContentPlatformModel.d.ts +58 -17
  139. package/sdk/platform/Content/ContentPlatformModel.js +28 -15
  140. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +28 -7
  141. package/sdk/platform/Discount/DiscountPlatformModel.js +7 -7
  142. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +127 -25
  143. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +37 -25
  144. package/sdk/platform/Finance/FinancePlatformClient.d.ts +28 -28
  145. package/sdk/platform/Finance/FinancePlatformClient.js +28 -28
  146. package/sdk/platform/Finance/FinancePlatformModel.d.ts +1583 -347
  147. package/sdk/platform/Finance/FinancePlatformModel.js +463 -351
  148. package/sdk/platform/Lead/LeadPlatformModel.d.ts +28 -7
  149. package/sdk/platform/Lead/LeadPlatformModel.js +7 -7
  150. package/sdk/platform/Order/OrderPlatformClient.d.ts +22 -0
  151. package/sdk/platform/Order/OrderPlatformClient.js +165 -0
  152. package/sdk/platform/Order/OrderPlatformModel.d.ts +613 -39
  153. package/sdk/platform/Order/OrderPlatformModel.js +359 -41
  154. package/sdk/platform/Order/OrderPlatformValidator.d.ts +32 -1
  155. package/sdk/platform/Order/OrderPlatformValidator.js +28 -0
  156. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +30 -9
  157. package/sdk/platform/Payment/PaymentPlatformModel.js +9 -9
  158. package/sdk/platform/PlatformClient.d.ts +8 -0
  159. package/sdk/platform/PlatformClient.js +14 -0
  160. package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +28 -7
  161. package/sdk/platform/Rewards/RewardsPlatformModel.js +7 -7
  162. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +12 -9
  163. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +12 -9
  164. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +120 -22
  165. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +76 -21
  166. package/sdk/platform/Share/SharePlatformModel.d.ts +28 -7
  167. package/sdk/platform/Share/SharePlatformModel.js +7 -7
  168. package/sdk/platform/Theme/ThemePlatformModel.d.ts +18 -5
  169. package/sdk/platform/Theme/ThemePlatformModel.js +7 -4
  170. package/sdk/platform/User/UserPlatformModel.d.ts +18 -18
  171. package/sdk/platform/User/UserPlatformModel.js +9 -9
  172. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +28 -7
  173. package/sdk/platform/Webhook/WebhookPlatformModel.js +7 -7
  174. package/sdk/public/PublicClient.d.ts +0 -4
  175. package/sdk/public/PublicClient.js +0 -8
  176. package/sdk/public/index.d.ts +0 -2
  177. package/sdk/public/index.js +0 -4
  178. package/sdk/public/Billing/BillingPublicClient.d.ts +0 -45
  179. package/sdk/public/Billing/BillingPublicClient.js +0 -269
  180. package/sdk/public/Billing/BillingPublicModel.d.ts +0 -434
  181. package/sdk/public/Billing/BillingPublicModel.js +0 -395
  182. package/sdk/public/Billing/BillingPublicValidator.d.ts +0 -34
  183. package/sdk/public/Billing/BillingPublicValidator.js +0 -38
  184. package/sdk/public/Inventory/InventoryPublicClient.d.ts +0 -87
  185. package/sdk/public/Inventory/InventoryPublicClient.js +0 -529
  186. package/sdk/public/Inventory/InventoryPublicModel.d.ts +0 -393
  187. package/sdk/public/Inventory/InventoryPublicModel.js +0 -448
  188. package/sdk/public/Inventory/InventoryPublicValidator.d.ts +0 -91
  189. package/sdk/public/Inventory/InventoryPublicValidator.js +0 -85
@@ -1,529 +0,0 @@
1
- const PublicAPIClient = require("../PublicAPIClient");
2
- const {
3
- FDKClientValidationError,
4
- FDKResponseValidationError,
5
- } = require("../../common/FDKError");
6
- const constructUrl = require("../constructUrl");
7
- const Paginator = require("../../common/Paginator");
8
- const InventoryPublicValidator = require("./InventoryPublicValidator");
9
- const InventoryPublicModel = require("./InventoryPublicModel");
10
- const { Logger } = require("./../../common/Logger");
11
- const Joi = require("joi");
12
-
13
- class Inventory {
14
- constructor(_conf) {
15
- this._conf = _conf;
16
- this._relativeUrls = {
17
- getApiKey: "/service/common/inventory/v1.0/company/slingshot/apikey",
18
- getConfigByApiKey: "/service/common/inventory/v1.0/company/slingshot",
19
- getJobByCode: "/service/common/inventory/v1.0/company/jobs/code/{code}",
20
- getJobCodesMetrics:
21
- "/service/common/inventory/v1.0/company/email/jobCode",
22
- getJobConfigByIntegrationType:
23
- "/service/common/inventory/v1.0/company/job/config",
24
- saveJobCodesMetrics:
25
- "/service/common/inventory/v1.0/company/email/jobCode",
26
- };
27
- this._urls = Object.entries(this._relativeUrls).reduce(
28
- (urls, [method, relativeUrl]) => {
29
- urls[method] = `${_conf.domain}${relativeUrl}`;
30
- return urls;
31
- },
32
- {}
33
- );
34
- }
35
-
36
- updateUrls(urls) {
37
- this._urls = {
38
- ...this._urls,
39
- ...urls,
40
- };
41
- }
42
-
43
- /**
44
- * @param {InventoryPublicValidator.GetApiKeyParam} arg - Arg object.
45
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
46
- * @param {import("../PublicAPIClient").Options} - Options
47
- * @returns {Promise<InventoryPublicModel.ResponseEnvelopeApikeyModel>} -
48
- * Success response
49
- * @name getApiKey
50
- * @summary: Get apikey for Company to call other Slingshot Configuration APIs
51
- * @description: REST Endpoint that returns apikey by username by password - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/public/inventory/getApiKey/).
52
- */
53
- async getApiKey(
54
- { userName, password, requestHeaders } = { requestHeaders: {} },
55
- { responseHeaders } = { responseHeaders: false }
56
- ) {
57
- const { error } = InventoryPublicValidator.getApiKey().validate(
58
- { userName, password },
59
- { abortEarly: false, allowUnknown: true }
60
- );
61
- if (error) {
62
- return Promise.reject(new FDKClientValidationError(error));
63
- }
64
-
65
- // Showing warrnings if extra unknown parameters are found
66
- const { error: warrning } = InventoryPublicValidator.getApiKey().validate(
67
- { userName, password },
68
- { abortEarly: false, allowUnknown: false }
69
- );
70
- if (warrning) {
71
- Logger({
72
- level: "WARN",
73
- message: `Parameter Validation warrnings for public > Inventory > getApiKey \n ${warrning}`,
74
- });
75
- }
76
-
77
- const query_params = {};
78
- query_params["user_name"] = userName;
79
- query_params["password"] = password;
80
-
81
- const xHeaders = {};
82
-
83
- const response = await PublicAPIClient.execute(
84
- this._conf,
85
- "get",
86
- constructUrl({
87
- url: this._urls["getApiKey"],
88
- params: {},
89
- }),
90
- query_params,
91
- undefined,
92
- { ...xHeaders, ...requestHeaders },
93
- { responseHeaders }
94
- );
95
-
96
- let responseData = response;
97
- if (responseHeaders) {
98
- responseData = response[0];
99
- }
100
-
101
- const {
102
- error: res_error,
103
- } = InventoryPublicModel.ResponseEnvelopeApikeyModel().validate(
104
- responseData,
105
- { abortEarly: false, allowUnknown: true }
106
- );
107
-
108
- if (res_error) {
109
- if (this._conf.options.strictResponseCheck === true) {
110
- return Promise.reject(new FDKResponseValidationError(res_error));
111
- } else {
112
- Logger({
113
- level: "WARN",
114
- message: `Response Validation Warnings for public > Inventory > getApiKey \n ${res_error}`,
115
- });
116
- }
117
- }
118
-
119
- return response;
120
- }
121
-
122
- /**
123
- * @param {InventoryPublicValidator.GetConfigByApiKeyParam} arg - Arg object.
124
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
125
- * @param {import("../PublicAPIClient").Options} - Options
126
- * @returns {Promise<InventoryPublicModel.ResponseEnvelopeSlingshotConfigurationDetail>}
127
- * - Success response
128
- *
129
- * @name getConfigByApiKey
130
- * @summary: Get Slingshot Configuration Of A Company using API key
131
- * @description: REST Endpoint that returns all configuration detail of a company - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/public/inventory/getConfigByApiKey/).
132
- */
133
- async getConfigByApiKey(
134
- { apikey, requestHeaders } = { requestHeaders: {} },
135
- { responseHeaders } = { responseHeaders: false }
136
- ) {
137
- const { error } = InventoryPublicValidator.getConfigByApiKey().validate(
138
- { apikey },
139
- { abortEarly: false, allowUnknown: true }
140
- );
141
- if (error) {
142
- return Promise.reject(new FDKClientValidationError(error));
143
- }
144
-
145
- // Showing warrnings if extra unknown parameters are found
146
- const {
147
- error: warrning,
148
- } = InventoryPublicValidator.getConfigByApiKey().validate(
149
- { apikey },
150
- { abortEarly: false, allowUnknown: false }
151
- );
152
- if (warrning) {
153
- Logger({
154
- level: "WARN",
155
- message: `Parameter Validation warrnings for public > Inventory > getConfigByApiKey \n ${warrning}`,
156
- });
157
- }
158
-
159
- const query_params = {};
160
- query_params["apikey"] = apikey;
161
-
162
- const xHeaders = {};
163
-
164
- const response = await PublicAPIClient.execute(
165
- this._conf,
166
- "get",
167
- constructUrl({
168
- url: this._urls["getConfigByApiKey"],
169
- params: {},
170
- }),
171
- query_params,
172
- undefined,
173
- { ...xHeaders, ...requestHeaders },
174
- { responseHeaders }
175
- );
176
-
177
- let responseData = response;
178
- if (responseHeaders) {
179
- responseData = response[0];
180
- }
181
-
182
- const {
183
- error: res_error,
184
- } = InventoryPublicModel.ResponseEnvelopeSlingshotConfigurationDetail().validate(
185
- responseData,
186
- { abortEarly: false, allowUnknown: true }
187
- );
188
-
189
- if (res_error) {
190
- if (this._conf.options.strictResponseCheck === true) {
191
- return Promise.reject(new FDKResponseValidationError(res_error));
192
- } else {
193
- Logger({
194
- level: "WARN",
195
- message: `Response Validation Warnings for public > Inventory > getConfigByApiKey \n ${res_error}`,
196
- });
197
- }
198
- }
199
-
200
- return response;
201
- }
202
-
203
- /**
204
- * @param {InventoryPublicValidator.GetJobByCodeParam} arg - Arg object.
205
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
206
- * @param {import("../PublicAPIClient").Options} - Options
207
- * @returns {Promise<InventoryPublicModel.ResponseEnvelopeJobConfigDTO>} -
208
- * Success response
209
- * @name getJobByCode
210
- * @summary: Get Job Config By Code
211
- * @description: REST Endpoint that returns job config by code - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/public/inventory/getJobByCode/).
212
- */
213
- async getJobByCode(
214
- { code, requestHeaders } = { requestHeaders: {} },
215
- { responseHeaders } = { responseHeaders: false }
216
- ) {
217
- const { error } = InventoryPublicValidator.getJobByCode().validate(
218
- { code },
219
- { abortEarly: false, allowUnknown: true }
220
- );
221
- if (error) {
222
- return Promise.reject(new FDKClientValidationError(error));
223
- }
224
-
225
- // Showing warrnings if extra unknown parameters are found
226
- const {
227
- error: warrning,
228
- } = InventoryPublicValidator.getJobByCode().validate(
229
- { code },
230
- { abortEarly: false, allowUnknown: false }
231
- );
232
- if (warrning) {
233
- Logger({
234
- level: "WARN",
235
- message: `Parameter Validation warrnings for public > Inventory > getJobByCode \n ${warrning}`,
236
- });
237
- }
238
-
239
- const query_params = {};
240
-
241
- const xHeaders = {};
242
-
243
- const response = await PublicAPIClient.execute(
244
- this._conf,
245
- "get",
246
- constructUrl({
247
- url: this._urls["getJobByCode"],
248
- params: { code },
249
- }),
250
- query_params,
251
- undefined,
252
- { ...xHeaders, ...requestHeaders },
253
- { responseHeaders }
254
- );
255
-
256
- let responseData = response;
257
- if (responseHeaders) {
258
- responseData = response[0];
259
- }
260
-
261
- const {
262
- error: res_error,
263
- } = InventoryPublicModel.ResponseEnvelopeJobConfigDTO().validate(
264
- responseData,
265
- { abortEarly: false, allowUnknown: true }
266
- );
267
-
268
- if (res_error) {
269
- if (this._conf.options.strictResponseCheck === true) {
270
- return Promise.reject(new FDKResponseValidationError(res_error));
271
- } else {
272
- Logger({
273
- level: "WARN",
274
- message: `Response Validation Warnings for public > Inventory > getJobByCode \n ${res_error}`,
275
- });
276
- }
277
- }
278
-
279
- return response;
280
- }
281
-
282
- /**
283
- * @param {InventoryPublicValidator.GetJobCodesMetricsParam} arg - Arg object.
284
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
285
- * @param {import("../PublicAPIClient").Options} - Options
286
- * @returns {Promise<InventoryPublicModel.ResponseEnvelopeObject>} - Success response
287
- * @name getJobCodesMetrics
288
- * @summary: Find all the JobCodes from Metrics Collection based on the field Values
289
- * @description: Endpoint to return all JobCodes present in Metrics Collection - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/public/inventory/getJobCodesMetrics/).
290
- */
291
- async getJobCodesMetrics(
292
- { dailyJob, jobCode, requestHeaders } = { requestHeaders: {} },
293
- { responseHeaders } = { responseHeaders: false }
294
- ) {
295
- const { error } = InventoryPublicValidator.getJobCodesMetrics().validate(
296
- { dailyJob, jobCode },
297
- { abortEarly: false, allowUnknown: true }
298
- );
299
- if (error) {
300
- return Promise.reject(new FDKClientValidationError(error));
301
- }
302
-
303
- // Showing warrnings if extra unknown parameters are found
304
- const {
305
- error: warrning,
306
- } = InventoryPublicValidator.getJobCodesMetrics().validate(
307
- { dailyJob, jobCode },
308
- { abortEarly: false, allowUnknown: false }
309
- );
310
- if (warrning) {
311
- Logger({
312
- level: "WARN",
313
- message: `Parameter Validation warrnings for public > Inventory > getJobCodesMetrics \n ${warrning}`,
314
- });
315
- }
316
-
317
- const query_params = {};
318
- query_params["daily_job"] = dailyJob;
319
- query_params["job_code"] = jobCode;
320
-
321
- const xHeaders = {};
322
-
323
- const response = await PublicAPIClient.execute(
324
- this._conf,
325
- "get",
326
- constructUrl({
327
- url: this._urls["getJobCodesMetrics"],
328
- params: {},
329
- }),
330
- query_params,
331
- undefined,
332
- { ...xHeaders, ...requestHeaders },
333
- { responseHeaders }
334
- );
335
-
336
- let responseData = response;
337
- if (responseHeaders) {
338
- responseData = response[0];
339
- }
340
-
341
- const {
342
- error: res_error,
343
- } = InventoryPublicModel.ResponseEnvelopeObject().validate(responseData, {
344
- abortEarly: false,
345
- allowUnknown: true,
346
- });
347
-
348
- if (res_error) {
349
- if (this._conf.options.strictResponseCheck === true) {
350
- return Promise.reject(new FDKResponseValidationError(res_error));
351
- } else {
352
- Logger({
353
- level: "WARN",
354
- message: `Response Validation Warnings for public > Inventory > getJobCodesMetrics \n ${res_error}`,
355
- });
356
- }
357
- }
358
-
359
- return response;
360
- }
361
-
362
- /**
363
- * @param {InventoryPublicValidator.GetJobConfigByIntegrationTypeParam} arg
364
- * - Arg object.
365
- *
366
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
367
- * @param {import("../PublicAPIClient").Options} - Options
368
- * @returns {Promise<InventoryPublicModel.ResponseEnvelopeListJobConfigDTO>}
369
- * - Success response
370
- *
371
- * @name getJobConfigByIntegrationType
372
- * @summary: Get Job Configs By Integration Type
373
- * @description: REST Endpoint that returns all job Configs by Integration Type - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/public/inventory/getJobConfigByIntegrationType/).
374
- */
375
- async getJobConfigByIntegrationType(
376
- { integrationType, disable, requestHeaders } = { requestHeaders: {} },
377
- { responseHeaders } = { responseHeaders: false }
378
- ) {
379
- const {
380
- error,
381
- } = InventoryPublicValidator.getJobConfigByIntegrationType().validate(
382
- { integrationType, disable },
383
- { abortEarly: false, allowUnknown: true }
384
- );
385
- if (error) {
386
- return Promise.reject(new FDKClientValidationError(error));
387
- }
388
-
389
- // Showing warrnings if extra unknown parameters are found
390
- const {
391
- error: warrning,
392
- } = InventoryPublicValidator.getJobConfigByIntegrationType().validate(
393
- { integrationType, disable },
394
- { abortEarly: false, allowUnknown: false }
395
- );
396
- if (warrning) {
397
- Logger({
398
- level: "WARN",
399
- message: `Parameter Validation warrnings for public > Inventory > getJobConfigByIntegrationType \n ${warrning}`,
400
- });
401
- }
402
-
403
- const query_params = {};
404
- query_params["integration_type"] = integrationType;
405
- query_params["disable"] = disable;
406
-
407
- const xHeaders = {};
408
-
409
- const response = await PublicAPIClient.execute(
410
- this._conf,
411
- "get",
412
- constructUrl({
413
- url: this._urls["getJobConfigByIntegrationType"],
414
- params: {},
415
- }),
416
- query_params,
417
- undefined,
418
- { ...xHeaders, ...requestHeaders },
419
- { responseHeaders }
420
- );
421
-
422
- let responseData = response;
423
- if (responseHeaders) {
424
- responseData = response[0];
425
- }
426
-
427
- const {
428
- error: res_error,
429
- } = InventoryPublicModel.ResponseEnvelopeListJobConfigDTO().validate(
430
- responseData,
431
- { abortEarly: false, allowUnknown: true }
432
- );
433
-
434
- if (res_error) {
435
- if (this._conf.options.strictResponseCheck === true) {
436
- return Promise.reject(new FDKResponseValidationError(res_error));
437
- } else {
438
- Logger({
439
- level: "WARN",
440
- message: `Response Validation Warnings for public > Inventory > getJobConfigByIntegrationType \n ${res_error}`,
441
- });
442
- }
443
- }
444
-
445
- return response;
446
- }
447
-
448
- /**
449
- * @param {InventoryPublicValidator.SaveJobCodesMetricsParam} arg - Arg object.
450
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
451
- * @param {import("../PublicAPIClient").Options} - Options
452
- * @returns {Promise<InventoryPublicModel.ResponseEnvelopeEmailJobMetrics>}
453
- * - Success response
454
- *
455
- * @name saveJobCodesMetrics
456
- * @summary: Save JobCode Metrics
457
- * @description: Endpoint to save JobCode Metrics - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/public/inventory/saveJobCodesMetrics/).
458
- */
459
- async saveJobCodesMetrics(
460
- { body, requestHeaders } = { requestHeaders: {} },
461
- { responseHeaders } = { responseHeaders: false }
462
- ) {
463
- const { error } = InventoryPublicValidator.saveJobCodesMetrics().validate(
464
- { body },
465
- { abortEarly: false, allowUnknown: true }
466
- );
467
- if (error) {
468
- return Promise.reject(new FDKClientValidationError(error));
469
- }
470
-
471
- // Showing warrnings if extra unknown parameters are found
472
- const {
473
- error: warrning,
474
- } = InventoryPublicValidator.saveJobCodesMetrics().validate(
475
- { body },
476
- { abortEarly: false, allowUnknown: false }
477
- );
478
- if (warrning) {
479
- Logger({
480
- level: "WARN",
481
- message: `Parameter Validation warrnings for public > Inventory > saveJobCodesMetrics \n ${warrning}`,
482
- });
483
- }
484
-
485
- const query_params = {};
486
-
487
- const xHeaders = {};
488
-
489
- const response = await PublicAPIClient.execute(
490
- this._conf,
491
- "post",
492
- constructUrl({
493
- url: this._urls["saveJobCodesMetrics"],
494
- params: {},
495
- }),
496
- query_params,
497
- body,
498
- { ...xHeaders, ...requestHeaders },
499
- { responseHeaders }
500
- );
501
-
502
- let responseData = response;
503
- if (responseHeaders) {
504
- responseData = response[0];
505
- }
506
-
507
- const {
508
- error: res_error,
509
- } = InventoryPublicModel.ResponseEnvelopeEmailJobMetrics().validate(
510
- responseData,
511
- { abortEarly: false, allowUnknown: true }
512
- );
513
-
514
- if (res_error) {
515
- if (this._conf.options.strictResponseCheck === true) {
516
- return Promise.reject(new FDKResponseValidationError(res_error));
517
- } else {
518
- Logger({
519
- level: "WARN",
520
- message: `Response Validation Warnings for public > Inventory > saveJobCodesMetrics \n ${res_error}`,
521
- });
522
- }
523
- }
524
-
525
- return response;
526
- }
527
- }
528
-
529
- module.exports = Inventory;