@gofynd/fdk-client-javascript 1.4.3 → 1.4.5
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.
- package/README.md +1 -10
- package/package.json +1 -1
- package/sdk/application/Cart/CartApplicationClient.d.ts +48 -48
- package/sdk/application/Cart/CartApplicationClient.js +48 -48
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +69 -69
- package/sdk/application/Catalog/CatalogApplicationClient.js +69 -69
- package/sdk/application/Common/CommonApplicationClient.d.ts +4 -4
- package/sdk/application/Common/CommonApplicationClient.js +4 -4
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +6 -6
- package/sdk/application/Communication/CommunicationApplicationClient.js +6 -6
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +32 -32
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +32 -32
- package/sdk/application/Content/ContentApplicationClient.d.ts +45 -45
- package/sdk/application/Content/ContentApplicationClient.js +45 -45
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +5 -5
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +5 -5
- package/sdk/application/Lead/LeadApplicationClient.d.ts +9 -9
- package/sdk/application/Lead/LeadApplicationClient.js +9 -9
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +22 -22
- package/sdk/application/Logistic/LogisticApplicationClient.js +22 -22
- package/sdk/application/Order/OrderApplicationClient.d.ts +14 -25
- package/sdk/application/Order/OrderApplicationClient.js +14 -94
- package/sdk/application/Order/OrderApplicationValidator.d.ts +1 -15
- package/sdk/application/Order/OrderApplicationValidator.js +0 -13
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +71 -71
- package/sdk/application/Payment/PaymentApplicationClient.js +71 -71
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +1 -1
- package/sdk/application/Rewards/RewardsApplicationClient.js +1 -1
- package/sdk/application/Share/ShareApplicationClient.d.ts +1 -1
- package/sdk/application/Share/ShareApplicationClient.js +1 -1
- package/sdk/application/Share/ShareApplicationModel.d.ts +2 -0
- package/sdk/application/Share/ShareApplicationModel.js +2 -0
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +8 -8
- package/sdk/application/Theme/ThemeApplicationClient.js +8 -8
- package/sdk/application/User/UserApplicationClient.d.ts +74 -74
- package/sdk/application/User/UserApplicationClient.js +74 -74
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +5 -5
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +5 -5
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +13 -13
- package/sdk/platform/Billing/BillingPlatformClient.js +13 -13
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +102 -102
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +102 -102
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +132 -131
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +132 -131
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +130 -130
- package/sdk/platform/Catalog/CatalogPlatformClient.js +130 -130
- package/sdk/platform/Common/CommonPlatformClient.d.ts +2 -2
- package/sdk/platform/Common/CommonPlatformClient.js +2 -2
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +118 -118
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +118 -118
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +1 -1
- package/sdk/platform/Communication/CommunicationPlatformClient.js +1 -1
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +22 -22
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +22 -22
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +34 -7
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +35 -5
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +4 -4
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +4 -4
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +41 -41
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +41 -41
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +26 -26
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +26 -26
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +93 -93
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +93 -93
- package/sdk/platform/Content/ContentPlatformClient.d.ts +29 -29
- package/sdk/platform/Content/ContentPlatformClient.js +29 -29
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +18 -18
- package/sdk/platform/Discount/DiscountPlatformClient.js +18 -18
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +18 -17
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +18 -17
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +6 -6
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +6 -6
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +2 -2
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +4 -4
- package/sdk/platform/Finance/FinancePlatformClient.js +4 -4
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +12 -12
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +12 -12
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +15 -15
- package/sdk/platform/Lead/LeadPlatformClient.js +15 -15
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +10 -10
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +10 -10
- package/sdk/platform/Order/OrderPlatformClient.d.ts +95 -106
- package/sdk/platform/Order/OrderPlatformClient.js +95 -190
- package/sdk/platform/Order/OrderPlatformModel.d.ts +10 -0
- package/sdk/platform/Order/OrderPlatformModel.js +4 -0
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +1 -33
- package/sdk/platform/Order/OrderPlatformValidator.js +0 -20
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -4
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +4 -4
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +77 -77
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +77 -77
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +2 -2
- package/sdk/platform/Payment/PaymentPlatformClient.js +2 -2
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +7 -0
- package/sdk/platform/Payment/PaymentPlatformModel.js +3 -0
- package/sdk/platform/PlatformClient.d.ts +0 -2
- package/sdk/platform/PlatformClient.js +0 -4
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +7 -7
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +7 -7
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +40 -40
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +40 -40
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +51 -50
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +51 -50
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +1 -1
- package/sdk/platform/Share/SharePlatformApplicationClient.js +1 -1
- package/sdk/platform/Share/SharePlatformModel.d.ts +2 -0
- package/sdk/platform/Share/SharePlatformModel.js +2 -0
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +34 -104
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +34 -591
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +1 -100
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +0 -92
- package/sdk/platform/Theme/ThemePlatformClient.d.ts +6 -6
- package/sdk/platform/Theme/ThemePlatformClient.js +6 -6
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +35 -35
- package/sdk/platform/User/UserPlatformApplicationClient.js +35 -35
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +7 -6
- package/sdk/platform/Webhook/WebhookPlatformClient.js +7 -6
- package/sdk/platform/index.d.ts +0 -1
- package/sdk/platform/index.js +0 -2
- package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +0 -152
- package/sdk/platform/Inventory/InventoryPlatformClient.js +0 -1017
- package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +0 -1355
- package/sdk/platform/Inventory/InventoryPlatformModel.js +0 -1544
- package/sdk/platform/Inventory/InventoryPlatformValidator.d.ts +0 -171
- package/sdk/platform/Inventory/InventoryPlatformValidator.js +0 -159
|
@@ -1,1017 +0,0 @@
|
|
|
1
|
-
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
2
|
-
const {
|
|
3
|
-
FDKClientValidationError,
|
|
4
|
-
FDKResponseValidationError,
|
|
5
|
-
} = require("../../common/FDKError");
|
|
6
|
-
const Paginator = require("../../common/Paginator");
|
|
7
|
-
const InventoryPlatformValidator = require("./InventoryPlatformValidator");
|
|
8
|
-
const InventoryPlatformModel = require("./InventoryPlatformModel");
|
|
9
|
-
const { Logger } = require("./../../common/Logger");
|
|
10
|
-
const Joi = require("joi");
|
|
11
|
-
|
|
12
|
-
class Inventory {
|
|
13
|
-
constructor(config) {
|
|
14
|
-
this.config = config;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* @param {InventoryPlatformValidator.CreateJobParam} arg - Arg object
|
|
19
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
20
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
21
|
-
* @returns {Promise<InventoryPlatformModel.ResponseEnvelopeString>} -
|
|
22
|
-
* Success response
|
|
23
|
-
* @name createJob
|
|
24
|
-
* @summary: Creates A New Job Config
|
|
25
|
-
* @description: REST Endpoint that creates a new job config - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/inventory/createJob/).
|
|
26
|
-
*/
|
|
27
|
-
async createJob(
|
|
28
|
-
{ body, requestHeaders } = { requestHeaders: {} },
|
|
29
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
30
|
-
) {
|
|
31
|
-
const { error } = InventoryPlatformValidator.createJob().validate(
|
|
32
|
-
{
|
|
33
|
-
body,
|
|
34
|
-
},
|
|
35
|
-
{ abortEarly: false, allowUnknown: true }
|
|
36
|
-
);
|
|
37
|
-
if (error) {
|
|
38
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// Showing warrnings if extra unknown parameters are found
|
|
42
|
-
const { error: warrning } = InventoryPlatformValidator.createJob().validate(
|
|
43
|
-
{
|
|
44
|
-
body,
|
|
45
|
-
},
|
|
46
|
-
{ abortEarly: false, allowUnknown: false }
|
|
47
|
-
);
|
|
48
|
-
if (warrning) {
|
|
49
|
-
Logger({
|
|
50
|
-
level: "WARN",
|
|
51
|
-
message: `Parameter Validation warrnings for platform > Inventory > createJob \n ${warrning}`,
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const query_params = {};
|
|
56
|
-
|
|
57
|
-
const xHeaders = {};
|
|
58
|
-
|
|
59
|
-
const response = await PlatformAPIClient.execute(
|
|
60
|
-
this.config,
|
|
61
|
-
"post",
|
|
62
|
-
`/service/platform/inventory/v1.0/company/${this.config.companyId}/jobs`,
|
|
63
|
-
query_params,
|
|
64
|
-
body,
|
|
65
|
-
{ ...xHeaders, ...requestHeaders },
|
|
66
|
-
{ responseHeaders }
|
|
67
|
-
);
|
|
68
|
-
|
|
69
|
-
let responseData = response;
|
|
70
|
-
if (responseHeaders) {
|
|
71
|
-
responseData = response[0];
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const {
|
|
75
|
-
error: res_error,
|
|
76
|
-
} = InventoryPlatformModel.ResponseEnvelopeString().validate(responseData, {
|
|
77
|
-
abortEarly: false,
|
|
78
|
-
allowUnknown: true,
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
if (res_error) {
|
|
82
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
83
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
84
|
-
} else {
|
|
85
|
-
Logger({
|
|
86
|
-
level: "WARN",
|
|
87
|
-
message: `Response Validation Warnings for platform > Inventory > createJob \n ${res_error}`,
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
return response;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* @param {InventoryPlatformValidator.DisableParam} arg - Arg object
|
|
97
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
98
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
99
|
-
* @returns {Promise<InventoryPlatformModel.ResponseEnvelopeString>} -
|
|
100
|
-
* Success response
|
|
101
|
-
* @name disable
|
|
102
|
-
* @summary: Disable Job Config
|
|
103
|
-
* @description: REST Endpoint that disables Inventory Job Config - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/inventory/disable/).
|
|
104
|
-
*/
|
|
105
|
-
async disable(
|
|
106
|
-
{ integrationId, requestHeaders } = { requestHeaders: {} },
|
|
107
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
108
|
-
) {
|
|
109
|
-
const { error } = InventoryPlatformValidator.disable().validate(
|
|
110
|
-
{
|
|
111
|
-
integrationId,
|
|
112
|
-
},
|
|
113
|
-
{ abortEarly: false, allowUnknown: true }
|
|
114
|
-
);
|
|
115
|
-
if (error) {
|
|
116
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// Showing warrnings if extra unknown parameters are found
|
|
120
|
-
const { error: warrning } = InventoryPlatformValidator.disable().validate(
|
|
121
|
-
{
|
|
122
|
-
integrationId,
|
|
123
|
-
},
|
|
124
|
-
{ abortEarly: false, allowUnknown: false }
|
|
125
|
-
);
|
|
126
|
-
if (warrning) {
|
|
127
|
-
Logger({
|
|
128
|
-
level: "WARN",
|
|
129
|
-
message: `Parameter Validation warrnings for platform > Inventory > disable \n ${warrning}`,
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
const query_params = {};
|
|
134
|
-
|
|
135
|
-
const xHeaders = {};
|
|
136
|
-
|
|
137
|
-
const response = await PlatformAPIClient.execute(
|
|
138
|
-
this.config,
|
|
139
|
-
"get",
|
|
140
|
-
`/service/platform/inventory/v1.0/company/${this.config.companyId}/jobs/disable/integration/${integrationId}`,
|
|
141
|
-
query_params,
|
|
142
|
-
undefined,
|
|
143
|
-
{ ...xHeaders, ...requestHeaders },
|
|
144
|
-
{ responseHeaders }
|
|
145
|
-
);
|
|
146
|
-
|
|
147
|
-
let responseData = response;
|
|
148
|
-
if (responseHeaders) {
|
|
149
|
-
responseData = response[0];
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
const {
|
|
153
|
-
error: res_error,
|
|
154
|
-
} = InventoryPlatformModel.ResponseEnvelopeString().validate(responseData, {
|
|
155
|
-
abortEarly: false,
|
|
156
|
-
allowUnknown: true,
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
if (res_error) {
|
|
160
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
161
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
162
|
-
} else {
|
|
163
|
-
Logger({
|
|
164
|
-
level: "WARN",
|
|
165
|
-
message: `Response Validation Warnings for platform > Inventory > disable \n ${res_error}`,
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
return response;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* @param {InventoryPlatformValidator.GetConfigByCompanyParam} arg - Arg object
|
|
175
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
176
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
177
|
-
* @returns {Promise<InventoryPlatformModel.ResponseEnvelopeListSlingshotConfigurationDetail>}
|
|
178
|
-
* - Success response
|
|
179
|
-
*
|
|
180
|
-
* @name getConfigByCompany
|
|
181
|
-
* @summary: Get Slingshot Configuration Of A Company
|
|
182
|
-
* @description: REST Endpoint that returns all configuration detail of a company - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/inventory/getConfigByCompany/).
|
|
183
|
-
*/
|
|
184
|
-
async getConfigByCompany(
|
|
185
|
-
{ requestHeaders } = { requestHeaders: {} },
|
|
186
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
187
|
-
) {
|
|
188
|
-
const { error } = InventoryPlatformValidator.getConfigByCompany().validate(
|
|
189
|
-
{},
|
|
190
|
-
{ abortEarly: false, allowUnknown: true }
|
|
191
|
-
);
|
|
192
|
-
if (error) {
|
|
193
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
// Showing warrnings if extra unknown parameters are found
|
|
197
|
-
const {
|
|
198
|
-
error: warrning,
|
|
199
|
-
} = InventoryPlatformValidator.getConfigByCompany().validate(
|
|
200
|
-
{},
|
|
201
|
-
{ abortEarly: false, allowUnknown: false }
|
|
202
|
-
);
|
|
203
|
-
if (warrning) {
|
|
204
|
-
Logger({
|
|
205
|
-
level: "WARN",
|
|
206
|
-
message: `Parameter Validation warrnings for platform > Inventory > getConfigByCompany \n ${warrning}`,
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
const query_params = {};
|
|
211
|
-
|
|
212
|
-
const xHeaders = {};
|
|
213
|
-
|
|
214
|
-
const response = await PlatformAPIClient.execute(
|
|
215
|
-
this.config,
|
|
216
|
-
"get",
|
|
217
|
-
`/service/platform/inventory/v1.0/company/${this.config.companyId}/slingshot`,
|
|
218
|
-
query_params,
|
|
219
|
-
undefined,
|
|
220
|
-
{ ...xHeaders, ...requestHeaders },
|
|
221
|
-
{ responseHeaders }
|
|
222
|
-
);
|
|
223
|
-
|
|
224
|
-
let responseData = response;
|
|
225
|
-
if (responseHeaders) {
|
|
226
|
-
responseData = response[0];
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
const {
|
|
230
|
-
error: res_error,
|
|
231
|
-
} = InventoryPlatformModel.ResponseEnvelopeListSlingshotConfigurationDetail().validate(
|
|
232
|
-
responseData,
|
|
233
|
-
{ abortEarly: false, allowUnknown: true }
|
|
234
|
-
);
|
|
235
|
-
|
|
236
|
-
if (res_error) {
|
|
237
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
238
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
239
|
-
} else {
|
|
240
|
-
Logger({
|
|
241
|
-
level: "WARN",
|
|
242
|
-
message: `Response Validation Warnings for platform > Inventory > getConfigByCompany \n ${res_error}`,
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
return response;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
/**
|
|
251
|
-
* @param {InventoryPlatformValidator.GetJobByCodeParam} arg - Arg object
|
|
252
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
253
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
254
|
-
* @returns {Promise<InventoryPlatformModel.ResponseEnvelopeJobConfigDTO>}
|
|
255
|
-
* - Success response
|
|
256
|
-
*
|
|
257
|
-
* @name getJobByCode
|
|
258
|
-
* @summary: Get Job Config By Code
|
|
259
|
-
* @description: REST Endpoint that returns job config by code - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/inventory/getJobByCode/).
|
|
260
|
-
*/
|
|
261
|
-
async getJobByCode(
|
|
262
|
-
{ code, requestHeaders } = { requestHeaders: {} },
|
|
263
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
264
|
-
) {
|
|
265
|
-
const { error } = InventoryPlatformValidator.getJobByCode().validate(
|
|
266
|
-
{
|
|
267
|
-
code,
|
|
268
|
-
},
|
|
269
|
-
{ abortEarly: false, allowUnknown: true }
|
|
270
|
-
);
|
|
271
|
-
if (error) {
|
|
272
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
// Showing warrnings if extra unknown parameters are found
|
|
276
|
-
const {
|
|
277
|
-
error: warrning,
|
|
278
|
-
} = InventoryPlatformValidator.getJobByCode().validate(
|
|
279
|
-
{
|
|
280
|
-
code,
|
|
281
|
-
},
|
|
282
|
-
{ abortEarly: false, allowUnknown: false }
|
|
283
|
-
);
|
|
284
|
-
if (warrning) {
|
|
285
|
-
Logger({
|
|
286
|
-
level: "WARN",
|
|
287
|
-
message: `Parameter Validation warrnings for platform > Inventory > getJobByCode \n ${warrning}`,
|
|
288
|
-
});
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
const query_params = {};
|
|
292
|
-
|
|
293
|
-
const xHeaders = {};
|
|
294
|
-
|
|
295
|
-
const response = await PlatformAPIClient.execute(
|
|
296
|
-
this.config,
|
|
297
|
-
"get",
|
|
298
|
-
`/service/platform/inventory/v1.0/company/${this.config.companyId}/jobs/code/${code}`,
|
|
299
|
-
query_params,
|
|
300
|
-
undefined,
|
|
301
|
-
{ ...xHeaders, ...requestHeaders },
|
|
302
|
-
{ responseHeaders }
|
|
303
|
-
);
|
|
304
|
-
|
|
305
|
-
let responseData = response;
|
|
306
|
-
if (responseHeaders) {
|
|
307
|
-
responseData = response[0];
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
const {
|
|
311
|
-
error: res_error,
|
|
312
|
-
} = InventoryPlatformModel.ResponseEnvelopeJobConfigDTO().validate(
|
|
313
|
-
responseData,
|
|
314
|
-
{ abortEarly: false, allowUnknown: true }
|
|
315
|
-
);
|
|
316
|
-
|
|
317
|
-
if (res_error) {
|
|
318
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
319
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
320
|
-
} else {
|
|
321
|
-
Logger({
|
|
322
|
-
level: "WARN",
|
|
323
|
-
message: `Response Validation Warnings for platform > Inventory > getJobByCode \n ${res_error}`,
|
|
324
|
-
});
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
return response;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
/**
|
|
332
|
-
* @param {InventoryPlatformValidator.GetJobByCompanyAndIntegrationParam} arg
|
|
333
|
-
* - Arg object
|
|
334
|
-
*
|
|
335
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
336
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
337
|
-
* @returns {Promise<InventoryPlatformModel.ResponseEnvelopeListJobConfigDTO>}
|
|
338
|
-
* - Success response
|
|
339
|
-
*
|
|
340
|
-
* @name getJobByCompanyAndIntegration
|
|
341
|
-
* @summary: Get Job Configs By Company And Integration
|
|
342
|
-
* @description: REST Endpoint that returns all job configs by company And integration - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/inventory/getJobByCompanyAndIntegration/).
|
|
343
|
-
*/
|
|
344
|
-
async getJobByCompanyAndIntegration(
|
|
345
|
-
{ integrationId, pageNo, pageSize, requestHeaders } = {
|
|
346
|
-
requestHeaders: {},
|
|
347
|
-
},
|
|
348
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
349
|
-
) {
|
|
350
|
-
const {
|
|
351
|
-
error,
|
|
352
|
-
} = InventoryPlatformValidator.getJobByCompanyAndIntegration().validate(
|
|
353
|
-
{
|
|
354
|
-
integrationId,
|
|
355
|
-
pageNo,
|
|
356
|
-
pageSize,
|
|
357
|
-
},
|
|
358
|
-
{ abortEarly: false, allowUnknown: true }
|
|
359
|
-
);
|
|
360
|
-
if (error) {
|
|
361
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
// Showing warrnings if extra unknown parameters are found
|
|
365
|
-
const {
|
|
366
|
-
error: warrning,
|
|
367
|
-
} = InventoryPlatformValidator.getJobByCompanyAndIntegration().validate(
|
|
368
|
-
{
|
|
369
|
-
integrationId,
|
|
370
|
-
pageNo,
|
|
371
|
-
pageSize,
|
|
372
|
-
},
|
|
373
|
-
{ abortEarly: false, allowUnknown: false }
|
|
374
|
-
);
|
|
375
|
-
if (warrning) {
|
|
376
|
-
Logger({
|
|
377
|
-
level: "WARN",
|
|
378
|
-
message: `Parameter Validation warrnings for platform > Inventory > getJobByCompanyAndIntegration \n ${warrning}`,
|
|
379
|
-
});
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
const query_params = {};
|
|
383
|
-
query_params["page_no"] = pageNo;
|
|
384
|
-
query_params["page_size"] = pageSize;
|
|
385
|
-
|
|
386
|
-
const xHeaders = {};
|
|
387
|
-
|
|
388
|
-
const response = await PlatformAPIClient.execute(
|
|
389
|
-
this.config,
|
|
390
|
-
"get",
|
|
391
|
-
`/service/platform/inventory/v1.0/company/${this.config.companyId}/jobs/integration/${integrationId}`,
|
|
392
|
-
query_params,
|
|
393
|
-
undefined,
|
|
394
|
-
{ ...xHeaders, ...requestHeaders },
|
|
395
|
-
{ responseHeaders }
|
|
396
|
-
);
|
|
397
|
-
|
|
398
|
-
let responseData = response;
|
|
399
|
-
if (responseHeaders) {
|
|
400
|
-
responseData = response[0];
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
const {
|
|
404
|
-
error: res_error,
|
|
405
|
-
} = InventoryPlatformModel.ResponseEnvelopeListJobConfigDTO().validate(
|
|
406
|
-
responseData,
|
|
407
|
-
{ abortEarly: false, allowUnknown: true }
|
|
408
|
-
);
|
|
409
|
-
|
|
410
|
-
if (res_error) {
|
|
411
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
412
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
413
|
-
} else {
|
|
414
|
-
Logger({
|
|
415
|
-
level: "WARN",
|
|
416
|
-
message: `Response Validation Warnings for platform > Inventory > getJobByCompanyAndIntegration \n ${res_error}`,
|
|
417
|
-
});
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
return response;
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
/**
|
|
425
|
-
* @param {InventoryPlatformValidator.GetJobCodeMetricsParam} arg - Arg object
|
|
426
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
427
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
428
|
-
* @returns {Promise<InventoryPlatformModel.ResponseEnvelopeJobMetricsDto>}
|
|
429
|
-
* - Success response
|
|
430
|
-
*
|
|
431
|
-
* @name getJobCodeMetrics
|
|
432
|
-
* @summary: Get Job Metrics
|
|
433
|
-
* @description: REST Endpoint that returns Inventory Run History For A Job Code - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/inventory/getJobCodeMetrics/).
|
|
434
|
-
*/
|
|
435
|
-
async getJobCodeMetrics(
|
|
436
|
-
{ code, pageNo, pageSize, status, date, requestHeaders } = {
|
|
437
|
-
requestHeaders: {},
|
|
438
|
-
},
|
|
439
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
440
|
-
) {
|
|
441
|
-
const { error } = InventoryPlatformValidator.getJobCodeMetrics().validate(
|
|
442
|
-
{
|
|
443
|
-
code,
|
|
444
|
-
pageNo,
|
|
445
|
-
pageSize,
|
|
446
|
-
status,
|
|
447
|
-
date,
|
|
448
|
-
},
|
|
449
|
-
{ abortEarly: false, allowUnknown: true }
|
|
450
|
-
);
|
|
451
|
-
if (error) {
|
|
452
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
// Showing warrnings if extra unknown parameters are found
|
|
456
|
-
const {
|
|
457
|
-
error: warrning,
|
|
458
|
-
} = InventoryPlatformValidator.getJobCodeMetrics().validate(
|
|
459
|
-
{
|
|
460
|
-
code,
|
|
461
|
-
pageNo,
|
|
462
|
-
pageSize,
|
|
463
|
-
status,
|
|
464
|
-
date,
|
|
465
|
-
},
|
|
466
|
-
{ abortEarly: false, allowUnknown: false }
|
|
467
|
-
);
|
|
468
|
-
if (warrning) {
|
|
469
|
-
Logger({
|
|
470
|
-
level: "WARN",
|
|
471
|
-
message: `Parameter Validation warrnings for platform > Inventory > getJobCodeMetrics \n ${warrning}`,
|
|
472
|
-
});
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
const query_params = {};
|
|
476
|
-
query_params["page_no"] = pageNo;
|
|
477
|
-
query_params["page_size"] = pageSize;
|
|
478
|
-
query_params["status"] = status;
|
|
479
|
-
query_params["date"] = date;
|
|
480
|
-
|
|
481
|
-
const xHeaders = {};
|
|
482
|
-
|
|
483
|
-
const response = await PlatformAPIClient.execute(
|
|
484
|
-
this.config,
|
|
485
|
-
"get",
|
|
486
|
-
`/service/platform/inventory/v1.0/company/${this.config.companyId}/jobs/code/${code}/metrics`,
|
|
487
|
-
query_params,
|
|
488
|
-
undefined,
|
|
489
|
-
{ ...xHeaders, ...requestHeaders },
|
|
490
|
-
{ responseHeaders }
|
|
491
|
-
);
|
|
492
|
-
|
|
493
|
-
let responseData = response;
|
|
494
|
-
if (responseHeaders) {
|
|
495
|
-
responseData = response[0];
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
const {
|
|
499
|
-
error: res_error,
|
|
500
|
-
} = InventoryPlatformModel.ResponseEnvelopeJobMetricsDto().validate(
|
|
501
|
-
responseData,
|
|
502
|
-
{ abortEarly: false, allowUnknown: true }
|
|
503
|
-
);
|
|
504
|
-
|
|
505
|
-
if (res_error) {
|
|
506
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
507
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
508
|
-
} else {
|
|
509
|
-
Logger({
|
|
510
|
-
level: "WARN",
|
|
511
|
-
message: `Response Validation Warnings for platform > Inventory > getJobCodeMetrics \n ${res_error}`,
|
|
512
|
-
});
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
return response;
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
/**
|
|
520
|
-
* @param {InventoryPlatformValidator.GetJobCodesByCompanyAndIntegrationParam} arg
|
|
521
|
-
* - Arg object
|
|
522
|
-
*
|
|
523
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
524
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
525
|
-
* @returns {Promise<InventoryPlatformModel.ResponseEnvelopeListJobConfigListDTO>}
|
|
526
|
-
* - Success response
|
|
527
|
-
*
|
|
528
|
-
* @name getJobCodesByCompanyAndIntegration
|
|
529
|
-
* @summary: Get Job Codes By Company And Integration
|
|
530
|
-
* @description: REST Endpoint that returns all job codes by company And integration - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/inventory/getJobCodesByCompanyAndIntegration/).
|
|
531
|
-
*/
|
|
532
|
-
async getJobCodesByCompanyAndIntegration(
|
|
533
|
-
{ integrationId, pageNo, pageSize, requestHeaders } = {
|
|
534
|
-
requestHeaders: {},
|
|
535
|
-
},
|
|
536
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
537
|
-
) {
|
|
538
|
-
const {
|
|
539
|
-
error,
|
|
540
|
-
} = InventoryPlatformValidator.getJobCodesByCompanyAndIntegration().validate(
|
|
541
|
-
{
|
|
542
|
-
integrationId,
|
|
543
|
-
pageNo,
|
|
544
|
-
pageSize,
|
|
545
|
-
},
|
|
546
|
-
{ abortEarly: false, allowUnknown: true }
|
|
547
|
-
);
|
|
548
|
-
if (error) {
|
|
549
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
// Showing warrnings if extra unknown parameters are found
|
|
553
|
-
const {
|
|
554
|
-
error: warrning,
|
|
555
|
-
} = InventoryPlatformValidator.getJobCodesByCompanyAndIntegration().validate(
|
|
556
|
-
{
|
|
557
|
-
integrationId,
|
|
558
|
-
pageNo,
|
|
559
|
-
pageSize,
|
|
560
|
-
},
|
|
561
|
-
{ abortEarly: false, allowUnknown: false }
|
|
562
|
-
);
|
|
563
|
-
if (warrning) {
|
|
564
|
-
Logger({
|
|
565
|
-
level: "WARN",
|
|
566
|
-
message: `Parameter Validation warrnings for platform > Inventory > getJobCodesByCompanyAndIntegration \n ${warrning}`,
|
|
567
|
-
});
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
const query_params = {};
|
|
571
|
-
query_params["page_no"] = pageNo;
|
|
572
|
-
query_params["page_size"] = pageSize;
|
|
573
|
-
|
|
574
|
-
const xHeaders = {};
|
|
575
|
-
|
|
576
|
-
const response = await PlatformAPIClient.execute(
|
|
577
|
-
this.config,
|
|
578
|
-
"get",
|
|
579
|
-
`/service/platform/inventory/v1.0/company/${this.config.companyId}/jobs/code/integration/${integrationId}`,
|
|
580
|
-
query_params,
|
|
581
|
-
undefined,
|
|
582
|
-
{ ...xHeaders, ...requestHeaders },
|
|
583
|
-
{ responseHeaders }
|
|
584
|
-
);
|
|
585
|
-
|
|
586
|
-
let responseData = response;
|
|
587
|
-
if (responseHeaders) {
|
|
588
|
-
responseData = response[0];
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
const {
|
|
592
|
-
error: res_error,
|
|
593
|
-
} = InventoryPlatformModel.ResponseEnvelopeListJobConfigListDTO().validate(
|
|
594
|
-
responseData,
|
|
595
|
-
{ abortEarly: false, allowUnknown: true }
|
|
596
|
-
);
|
|
597
|
-
|
|
598
|
-
if (res_error) {
|
|
599
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
600
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
601
|
-
} else {
|
|
602
|
-
Logger({
|
|
603
|
-
level: "WARN",
|
|
604
|
-
message: `Response Validation Warnings for platform > Inventory > getJobCodesByCompanyAndIntegration \n ${res_error}`,
|
|
605
|
-
});
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
return response;
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
/**
|
|
613
|
-
* @param {InventoryPlatformValidator.GetJobConfigDefaultsParam} arg - Arg object
|
|
614
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
615
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
616
|
-
* @returns {Promise<InventoryPlatformModel.ResponseEnvelopeJobConfigDTO>}
|
|
617
|
-
* - Success response
|
|
618
|
-
*
|
|
619
|
-
* @name getJobConfigDefaults
|
|
620
|
-
* @summary: Get Job Configs Defaults
|
|
621
|
-
* @description: REST Endpoint that returns default fields job configs by company And integration - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/inventory/getJobConfigDefaults/).
|
|
622
|
-
*/
|
|
623
|
-
async getJobConfigDefaults(
|
|
624
|
-
{ requestHeaders } = { requestHeaders: {} },
|
|
625
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
626
|
-
) {
|
|
627
|
-
const {
|
|
628
|
-
error,
|
|
629
|
-
} = InventoryPlatformValidator.getJobConfigDefaults().validate(
|
|
630
|
-
{},
|
|
631
|
-
{ abortEarly: false, allowUnknown: true }
|
|
632
|
-
);
|
|
633
|
-
if (error) {
|
|
634
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
// Showing warrnings if extra unknown parameters are found
|
|
638
|
-
const {
|
|
639
|
-
error: warrning,
|
|
640
|
-
} = InventoryPlatformValidator.getJobConfigDefaults().validate(
|
|
641
|
-
{},
|
|
642
|
-
{ abortEarly: false, allowUnknown: false }
|
|
643
|
-
);
|
|
644
|
-
if (warrning) {
|
|
645
|
-
Logger({
|
|
646
|
-
level: "WARN",
|
|
647
|
-
message: `Parameter Validation warrnings for platform > Inventory > getJobConfigDefaults \n ${warrning}`,
|
|
648
|
-
});
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
const query_params = {};
|
|
652
|
-
|
|
653
|
-
const xHeaders = {};
|
|
654
|
-
|
|
655
|
-
const response = await PlatformAPIClient.execute(
|
|
656
|
-
this.config,
|
|
657
|
-
"get",
|
|
658
|
-
`/service/platform/inventory/v1.0/company/${this.config.companyId}/jobs/defaults`,
|
|
659
|
-
query_params,
|
|
660
|
-
undefined,
|
|
661
|
-
{ ...xHeaders, ...requestHeaders },
|
|
662
|
-
{ responseHeaders }
|
|
663
|
-
);
|
|
664
|
-
|
|
665
|
-
let responseData = response;
|
|
666
|
-
if (responseHeaders) {
|
|
667
|
-
responseData = response[0];
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
const {
|
|
671
|
-
error: res_error,
|
|
672
|
-
} = InventoryPlatformModel.ResponseEnvelopeJobConfigDTO().validate(
|
|
673
|
-
responseData,
|
|
674
|
-
{ abortEarly: false, allowUnknown: true }
|
|
675
|
-
);
|
|
676
|
-
|
|
677
|
-
if (res_error) {
|
|
678
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
679
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
680
|
-
} else {
|
|
681
|
-
Logger({
|
|
682
|
-
level: "WARN",
|
|
683
|
-
message: `Response Validation Warnings for platform > Inventory > getJobConfigDefaults \n ${res_error}`,
|
|
684
|
-
});
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
return response;
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
/**
|
|
692
|
-
* @param {InventoryPlatformValidator.GetJobStepsParam} arg - Arg object
|
|
693
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
694
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
695
|
-
* @returns {Promise<InventoryPlatformModel.ResponseEnvelopeListJobStepsDTO>}
|
|
696
|
-
* - Success response
|
|
697
|
-
*
|
|
698
|
-
* @name getJobSteps
|
|
699
|
-
* @summary: Get Job Code Steps
|
|
700
|
-
* @description: REST Endpoint that returns Inventory Job Steps - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/inventory/getJobSteps/).
|
|
701
|
-
*/
|
|
702
|
-
async getJobSteps(
|
|
703
|
-
{ jobId, requestHeaders } = { requestHeaders: {} },
|
|
704
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
705
|
-
) {
|
|
706
|
-
const { error } = InventoryPlatformValidator.getJobSteps().validate(
|
|
707
|
-
{
|
|
708
|
-
jobId,
|
|
709
|
-
},
|
|
710
|
-
{ abortEarly: false, allowUnknown: true }
|
|
711
|
-
);
|
|
712
|
-
if (error) {
|
|
713
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
// Showing warrnings if extra unknown parameters are found
|
|
717
|
-
const {
|
|
718
|
-
error: warrning,
|
|
719
|
-
} = InventoryPlatformValidator.getJobSteps().validate(
|
|
720
|
-
{
|
|
721
|
-
jobId,
|
|
722
|
-
},
|
|
723
|
-
{ abortEarly: false, allowUnknown: false }
|
|
724
|
-
);
|
|
725
|
-
if (warrning) {
|
|
726
|
-
Logger({
|
|
727
|
-
level: "WARN",
|
|
728
|
-
message: `Parameter Validation warrnings for platform > Inventory > getJobSteps \n ${warrning}`,
|
|
729
|
-
});
|
|
730
|
-
}
|
|
731
|
-
|
|
732
|
-
const query_params = {};
|
|
733
|
-
|
|
734
|
-
const xHeaders = {};
|
|
735
|
-
|
|
736
|
-
const response = await PlatformAPIClient.execute(
|
|
737
|
-
this.config,
|
|
738
|
-
"get",
|
|
739
|
-
`/service/platform/inventory/v1.0/company/${this.config.companyId}/jobs/steps/${jobId}`,
|
|
740
|
-
query_params,
|
|
741
|
-
undefined,
|
|
742
|
-
{ ...xHeaders, ...requestHeaders },
|
|
743
|
-
{ responseHeaders }
|
|
744
|
-
);
|
|
745
|
-
|
|
746
|
-
let responseData = response;
|
|
747
|
-
if (responseHeaders) {
|
|
748
|
-
responseData = response[0];
|
|
749
|
-
}
|
|
750
|
-
|
|
751
|
-
const {
|
|
752
|
-
error: res_error,
|
|
753
|
-
} = InventoryPlatformModel.ResponseEnvelopeListJobStepsDTO().validate(
|
|
754
|
-
responseData,
|
|
755
|
-
{ abortEarly: false, allowUnknown: true }
|
|
756
|
-
);
|
|
757
|
-
|
|
758
|
-
if (res_error) {
|
|
759
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
760
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
761
|
-
} else {
|
|
762
|
-
Logger({
|
|
763
|
-
level: "WARN",
|
|
764
|
-
message: `Response Validation Warnings for platform > Inventory > getJobSteps \n ${res_error}`,
|
|
765
|
-
});
|
|
766
|
-
}
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
return response;
|
|
770
|
-
}
|
|
771
|
-
|
|
772
|
-
/**
|
|
773
|
-
* @param {InventoryPlatformValidator.GetJobsByCompanyParam} arg - Arg object
|
|
774
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
775
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
776
|
-
* @returns {Promise<InventoryPlatformModel.ResponseEnvelopeListJobConfigRawDTO>}
|
|
777
|
-
* - Success response
|
|
778
|
-
*
|
|
779
|
-
* @name getJobsByCompany
|
|
780
|
-
* @summary: Get Job Configs For A Company
|
|
781
|
-
* @description: REST Endpoint that returns all job configs for a company - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/inventory/getJobsByCompany/).
|
|
782
|
-
*/
|
|
783
|
-
async getJobsByCompany(
|
|
784
|
-
{ pageNo, pageSize, requestHeaders } = { requestHeaders: {} },
|
|
785
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
786
|
-
) {
|
|
787
|
-
const { error } = InventoryPlatformValidator.getJobsByCompany().validate(
|
|
788
|
-
{
|
|
789
|
-
pageNo,
|
|
790
|
-
pageSize,
|
|
791
|
-
},
|
|
792
|
-
{ abortEarly: false, allowUnknown: true }
|
|
793
|
-
);
|
|
794
|
-
if (error) {
|
|
795
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
796
|
-
}
|
|
797
|
-
|
|
798
|
-
// Showing warrnings if extra unknown parameters are found
|
|
799
|
-
const {
|
|
800
|
-
error: warrning,
|
|
801
|
-
} = InventoryPlatformValidator.getJobsByCompany().validate(
|
|
802
|
-
{
|
|
803
|
-
pageNo,
|
|
804
|
-
pageSize,
|
|
805
|
-
},
|
|
806
|
-
{ abortEarly: false, allowUnknown: false }
|
|
807
|
-
);
|
|
808
|
-
if (warrning) {
|
|
809
|
-
Logger({
|
|
810
|
-
level: "WARN",
|
|
811
|
-
message: `Parameter Validation warrnings for platform > Inventory > getJobsByCompany \n ${warrning}`,
|
|
812
|
-
});
|
|
813
|
-
}
|
|
814
|
-
|
|
815
|
-
const query_params = {};
|
|
816
|
-
query_params["page_no"] = pageNo;
|
|
817
|
-
query_params["page_size"] = pageSize;
|
|
818
|
-
|
|
819
|
-
const xHeaders = {};
|
|
820
|
-
|
|
821
|
-
const response = await PlatformAPIClient.execute(
|
|
822
|
-
this.config,
|
|
823
|
-
"get",
|
|
824
|
-
`/service/platform/inventory/v1.0/company/${this.config.companyId}/jobs`,
|
|
825
|
-
query_params,
|
|
826
|
-
undefined,
|
|
827
|
-
{ ...xHeaders, ...requestHeaders },
|
|
828
|
-
{ responseHeaders }
|
|
829
|
-
);
|
|
830
|
-
|
|
831
|
-
let responseData = response;
|
|
832
|
-
if (responseHeaders) {
|
|
833
|
-
responseData = response[0];
|
|
834
|
-
}
|
|
835
|
-
|
|
836
|
-
const {
|
|
837
|
-
error: res_error,
|
|
838
|
-
} = InventoryPlatformModel.ResponseEnvelopeListJobConfigRawDTO().validate(
|
|
839
|
-
responseData,
|
|
840
|
-
{ abortEarly: false, allowUnknown: true }
|
|
841
|
-
);
|
|
842
|
-
|
|
843
|
-
if (res_error) {
|
|
844
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
845
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
846
|
-
} else {
|
|
847
|
-
Logger({
|
|
848
|
-
level: "WARN",
|
|
849
|
-
message: `Response Validation Warnings for platform > Inventory > getJobsByCompany \n ${res_error}`,
|
|
850
|
-
});
|
|
851
|
-
}
|
|
852
|
-
}
|
|
853
|
-
|
|
854
|
-
return response;
|
|
855
|
-
}
|
|
856
|
-
|
|
857
|
-
/**
|
|
858
|
-
* @param {InventoryPlatformValidator.SuppressStoresParam} arg - Arg object
|
|
859
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
860
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
861
|
-
* @returns {Promise<InventoryPlatformModel.ResponseEnvelopeKafkaResponse>}
|
|
862
|
-
* - Success response
|
|
863
|
-
*
|
|
864
|
-
* @name suppressStores
|
|
865
|
-
* @summary: Get Slingshot Configuration Of A Company
|
|
866
|
-
* @description: REST Endpoint that returns all configuration detail of a company - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/inventory/suppressStores/).
|
|
867
|
-
*/
|
|
868
|
-
async suppressStores(
|
|
869
|
-
{ body, requestHeaders } = { requestHeaders: {} },
|
|
870
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
871
|
-
) {
|
|
872
|
-
const { error } = InventoryPlatformValidator.suppressStores().validate(
|
|
873
|
-
{
|
|
874
|
-
body,
|
|
875
|
-
},
|
|
876
|
-
{ abortEarly: false, allowUnknown: true }
|
|
877
|
-
);
|
|
878
|
-
if (error) {
|
|
879
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
880
|
-
}
|
|
881
|
-
|
|
882
|
-
// Showing warrnings if extra unknown parameters are found
|
|
883
|
-
const {
|
|
884
|
-
error: warrning,
|
|
885
|
-
} = InventoryPlatformValidator.suppressStores().validate(
|
|
886
|
-
{
|
|
887
|
-
body,
|
|
888
|
-
},
|
|
889
|
-
{ abortEarly: false, allowUnknown: false }
|
|
890
|
-
);
|
|
891
|
-
if (warrning) {
|
|
892
|
-
Logger({
|
|
893
|
-
level: "WARN",
|
|
894
|
-
message: `Parameter Validation warrnings for platform > Inventory > suppressStores \n ${warrning}`,
|
|
895
|
-
});
|
|
896
|
-
}
|
|
897
|
-
|
|
898
|
-
const query_params = {};
|
|
899
|
-
|
|
900
|
-
const xHeaders = {};
|
|
901
|
-
|
|
902
|
-
const response = await PlatformAPIClient.execute(
|
|
903
|
-
this.config,
|
|
904
|
-
"post",
|
|
905
|
-
`/service/platform/inventory/v1.0/company/${this.config.companyId}/kafka/suppressStore`,
|
|
906
|
-
query_params,
|
|
907
|
-
body,
|
|
908
|
-
{ ...xHeaders, ...requestHeaders },
|
|
909
|
-
{ responseHeaders }
|
|
910
|
-
);
|
|
911
|
-
|
|
912
|
-
let responseData = response;
|
|
913
|
-
if (responseHeaders) {
|
|
914
|
-
responseData = response[0];
|
|
915
|
-
}
|
|
916
|
-
|
|
917
|
-
const {
|
|
918
|
-
error: res_error,
|
|
919
|
-
} = InventoryPlatformModel.ResponseEnvelopeKafkaResponse().validate(
|
|
920
|
-
responseData,
|
|
921
|
-
{ abortEarly: false, allowUnknown: true }
|
|
922
|
-
);
|
|
923
|
-
|
|
924
|
-
if (res_error) {
|
|
925
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
926
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
927
|
-
} else {
|
|
928
|
-
Logger({
|
|
929
|
-
level: "WARN",
|
|
930
|
-
message: `Response Validation Warnings for platform > Inventory > suppressStores \n ${res_error}`,
|
|
931
|
-
});
|
|
932
|
-
}
|
|
933
|
-
}
|
|
934
|
-
|
|
935
|
-
return response;
|
|
936
|
-
}
|
|
937
|
-
|
|
938
|
-
/**
|
|
939
|
-
* @param {InventoryPlatformValidator.UpdateJobParam} arg - Arg object
|
|
940
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
941
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
942
|
-
* @returns {Promise<InventoryPlatformModel.ResponseEnvelopeString>} -
|
|
943
|
-
* Success response
|
|
944
|
-
* @name updateJob
|
|
945
|
-
* @summary: Updates An Existing Job Config
|
|
946
|
-
* @description: REST Endpoint that updates a job config - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/inventory/updateJob/).
|
|
947
|
-
*/
|
|
948
|
-
async updateJob(
|
|
949
|
-
{ body, requestHeaders } = { requestHeaders: {} },
|
|
950
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
951
|
-
) {
|
|
952
|
-
const { error } = InventoryPlatformValidator.updateJob().validate(
|
|
953
|
-
{
|
|
954
|
-
body,
|
|
955
|
-
},
|
|
956
|
-
{ abortEarly: false, allowUnknown: true }
|
|
957
|
-
);
|
|
958
|
-
if (error) {
|
|
959
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
960
|
-
}
|
|
961
|
-
|
|
962
|
-
// Showing warrnings if extra unknown parameters are found
|
|
963
|
-
const { error: warrning } = InventoryPlatformValidator.updateJob().validate(
|
|
964
|
-
{
|
|
965
|
-
body,
|
|
966
|
-
},
|
|
967
|
-
{ abortEarly: false, allowUnknown: false }
|
|
968
|
-
);
|
|
969
|
-
if (warrning) {
|
|
970
|
-
Logger({
|
|
971
|
-
level: "WARN",
|
|
972
|
-
message: `Parameter Validation warrnings for platform > Inventory > updateJob \n ${warrning}`,
|
|
973
|
-
});
|
|
974
|
-
}
|
|
975
|
-
|
|
976
|
-
const query_params = {};
|
|
977
|
-
|
|
978
|
-
const xHeaders = {};
|
|
979
|
-
|
|
980
|
-
const response = await PlatformAPIClient.execute(
|
|
981
|
-
this.config,
|
|
982
|
-
"put",
|
|
983
|
-
`/service/platform/inventory/v1.0/company/${this.config.companyId}/jobs`,
|
|
984
|
-
query_params,
|
|
985
|
-
body,
|
|
986
|
-
{ ...xHeaders, ...requestHeaders },
|
|
987
|
-
{ responseHeaders }
|
|
988
|
-
);
|
|
989
|
-
|
|
990
|
-
let responseData = response;
|
|
991
|
-
if (responseHeaders) {
|
|
992
|
-
responseData = response[0];
|
|
993
|
-
}
|
|
994
|
-
|
|
995
|
-
const {
|
|
996
|
-
error: res_error,
|
|
997
|
-
} = InventoryPlatformModel.ResponseEnvelopeString().validate(responseData, {
|
|
998
|
-
abortEarly: false,
|
|
999
|
-
allowUnknown: true,
|
|
1000
|
-
});
|
|
1001
|
-
|
|
1002
|
-
if (res_error) {
|
|
1003
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
1004
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1005
|
-
} else {
|
|
1006
|
-
Logger({
|
|
1007
|
-
level: "WARN",
|
|
1008
|
-
message: `Response Validation Warnings for platform > Inventory > updateJob \n ${res_error}`,
|
|
1009
|
-
});
|
|
1010
|
-
}
|
|
1011
|
-
}
|
|
1012
|
-
|
|
1013
|
-
return response;
|
|
1014
|
-
}
|
|
1015
|
-
}
|
|
1016
|
-
|
|
1017
|
-
module.exports = Inventory;
|