@gofynd/fdk-client-javascript 0.1.35 → 0.1.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/documentation/application/CART.md +272 -249
- package/documentation/application/CATALOG.md +417 -413
- package/documentation/application/COMMON.md +4 -0
- package/documentation/application/COMMUNICATION.md +4 -0
- package/documentation/application/CONFIGURATION.md +4 -0
- package/documentation/application/CONTENT.md +7 -20
- package/documentation/application/FILESTORAGE.md +85 -0
- package/documentation/application/LEAD.md +6 -2
- package/documentation/application/LOGISTIC.md +427 -101
- package/documentation/application/ORDER.md +292 -288
- package/documentation/application/PAYMENT.md +445 -259
- package/documentation/application/POSCART.md +309 -286
- package/documentation/application/README.md +1 -1
- package/documentation/application/REWARDS.md +153 -160
- package/documentation/application/SHARE.md +4 -0
- package/documentation/application/THEME.md +4 -0
- package/documentation/application/USER.md +4 -0
- package/documentation/platform/ANALYTICS.md +4 -0
- package/documentation/platform/AUDITTRAIL.md +6 -2
- package/documentation/platform/BILLING.md +4 -0
- package/documentation/platform/CART.md +476 -459
- package/documentation/platform/CATALOG.md +4138 -2968
- package/documentation/platform/COMMON.md +4 -0
- package/documentation/platform/COMMUNICATION.md +4 -0
- package/documentation/platform/COMPANYPROFILE.md +258 -206
- package/documentation/platform/CONFIGURATION.md +4 -0
- package/documentation/platform/CONTENT.md +8 -21
- package/documentation/platform/DISCOUNT.md +4 -0
- package/documentation/platform/FILESTORAGE.md +85 -0
- package/documentation/platform/INVENTORY.md +4 -0
- package/documentation/platform/LEAD.md +6 -2
- package/documentation/platform/ORDER.md +6298 -1448
- package/documentation/platform/PARTNER.md +12 -8
- package/documentation/platform/PAYMENT.md +107 -103
- package/documentation/platform/README.md +2 -2
- package/documentation/platform/REWARDS.md +219 -152
- package/documentation/platform/SHARE.md +4 -0
- package/documentation/platform/THEME.md +4 -0
- package/documentation/platform/USER.md +4 -0
- package/documentation/platform/WEBHOOK.md +4 -0
- package/documentation/public/CONFIGURATION.md +4 -0
- package/documentation/public/INVENTORY.md +4 -0
- package/documentation/public/WEBHOOK.md +4 -0
- package/package.json +2 -2
- package/sdk/application/ApplicationAPIClient.js +3 -0
- package/sdk/application/ApplicationClient.d.ts +1 -0
- package/sdk/application/ApplicationClient.js +11 -1
- package/sdk/application/ApplicationConfig.d.ts +1 -0
- package/sdk/application/ApplicationConfig.js +1 -0
- package/sdk/application/ApplicationModels.d.ts +94 -85
- package/sdk/application/ApplicationModels.js +1909 -1792
- package/sdk/application/client/CartApplicationClient.d.ts +36 -36
- package/sdk/application/client/CatalogApplicationClient.d.ts +39 -39
- package/sdk/application/client/CatalogApplicationClient.js +16 -16
- package/sdk/application/client/CommonApplicationClient.d.ts +2 -2
- package/sdk/application/client/CommunicationApplicationClient.d.ts +5 -5
- package/sdk/application/client/ConfigurationApplicationClient.d.ts +17 -17
- package/sdk/application/client/ContentApplicationClient.d.ts +19 -19
- package/sdk/application/client/FileStorageApplicationClient.d.ts +14 -6
- package/sdk/application/client/FileStorageApplicationClient.js +2 -0
- package/sdk/application/client/LeadApplicationClient.d.ts +10 -10
- package/sdk/application/client/LogisticApplicationClient.d.ts +32 -21
- package/sdk/application/client/LogisticApplicationClient.js +62 -27
- package/sdk/application/client/OrderApplicationClient.d.ts +15 -15
- package/sdk/application/client/OrderApplicationClient.js +1 -1
- package/sdk/application/client/PaymentApplicationClient.d.ts +79 -57
- package/sdk/application/client/PaymentApplicationClient.js +66 -0
- package/sdk/application/client/PosCartApplicationClient.d.ts +38 -38
- package/sdk/application/client/RewardsApplicationClient.d.ts +34 -34
- package/sdk/application/client/RewardsApplicationClient.js +77 -77
- package/sdk/application/client/ShareApplicationClient.d.ts +8 -8
- package/sdk/application/client/ThemeApplicationClient.d.ts +4 -4
- package/sdk/application/client/UserApplicationClient.d.ts +63 -63
- package/sdk/application/models/CatalogValidator.d.ts +1 -1
- package/sdk/application/models/CatalogValidator.js +2 -2
- package/sdk/application/models/LogisticValidator.d.ts +2 -1
- package/sdk/application/models/LogisticValidator.js +11 -6
- package/sdk/application/models/PaymentValidator.d.ts +2 -0
- package/sdk/application/models/PaymentValidator.js +12 -0
- package/sdk/application/models/RewardsValidator.d.ts +3 -3
- package/sdk/application/models/RewardsValidator.js +12 -12
- package/sdk/common/AxiosHelper.js +1 -1
- package/sdk/common/Constant.d.ts +9 -0
- package/sdk/common/Constant.js +11 -0
- package/sdk/platform/PlatformApplicationClient.d.ts +7962 -6505
- package/sdk/platform/PlatformApplicationClient.js +4377 -3635
- package/sdk/platform/PlatformApplicationModels.d.ts +26 -31
- package/sdk/platform/PlatformApplicationModels.js +5530 -4134
- package/sdk/platform/PlatformClient.d.ts +3495 -2780
- package/sdk/platform/PlatformClient.js +3985 -3108
- package/sdk/platform/PlatformModels.d.ts +354 -273
- package/sdk/platform/PlatformModels.js +5635 -4211
- package/sdk/platform/client/AnalyticsPlatformClient.d.ts +5 -5
- package/sdk/platform/client/AuditTrailPlatformClient.d.ts +1 -1
- package/sdk/platform/client/BillingPlatformClient.d.ts +4 -4
- package/sdk/platform/client/CatalogPlatformClient.d.ts +222 -154
- package/sdk/platform/client/CatalogPlatformClient.js +473 -295
- package/sdk/platform/client/CompanyProfilePlatformClient.d.ts +8 -8
- package/sdk/platform/client/ConfigurationPlatformClient.d.ts +9 -9
- package/sdk/platform/client/DiscountPlatformClient.d.ts +4 -4
- package/sdk/platform/client/FileStoragePlatformClient.d.ts +20 -4
- package/sdk/platform/client/FileStoragePlatformClient.js +49 -0
- package/sdk/platform/client/InventoryPlatformClient.d.ts +3 -3
- package/sdk/platform/client/LeadPlatformClient.d.ts +6 -6
- package/sdk/platform/client/OrderPlatformClient.d.ts +557 -131
- package/sdk/platform/client/OrderPlatformClient.js +1551 -247
- package/sdk/platform/client/PaymentPlatformClient.d.ts +4 -4
- package/sdk/platform/client/WebhookPlatformClient.d.ts +2 -2
- package/sdk/platform/models/CatalogValidator.d.ts +26 -22
- package/sdk/platform/models/CatalogValidator.js +109 -72
- package/sdk/platform/models/OrderValidator.d.ts +43 -11
- package/sdk/platform/models/OrderValidator.js +312 -51
- package/sdk/public/client/ConfigurationPublicClient.d.ts +2 -2
- package/sdk/public/client/InventoryPublicClient.d.ts +7 -7
- package/sdk/public/client/WebhookPublicClient.d.ts +3 -3
- package/tests/common/schema/action-url.json +15 -0
- package/tests/common/schema/url-action.json +16 -0
|
@@ -7,6 +7,37 @@ class Catalog {
|
|
|
7
7
|
this.config = config;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* @param {Object} arg - Arg object.
|
|
12
|
+
* @param {ProductBundleRequest} arg.body
|
|
13
|
+
* @summary: Create Product Bundle
|
|
14
|
+
* @description: Create Product Bundle. See `ProductBundleRequest` for the request body parameter need to create a product bundle. On successful request, returns in `ProductBundleRequest` with id
|
|
15
|
+
*/
|
|
16
|
+
createProductBundle({ body } = {}) {
|
|
17
|
+
const { error } = CatalogValidator.createProductBundle().validate(
|
|
18
|
+
{
|
|
19
|
+
body,
|
|
20
|
+
},
|
|
21
|
+
{ abortEarly: false, allowUnknown: true }
|
|
22
|
+
);
|
|
23
|
+
if (error) {
|
|
24
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const query_params = {};
|
|
28
|
+
|
|
29
|
+
const xHeaders = {};
|
|
30
|
+
|
|
31
|
+
return PlatformAPIClient.execute(
|
|
32
|
+
this.config,
|
|
33
|
+
"post",
|
|
34
|
+
`/service/platform/catalog/v1.0/company/${this.config.companyId}/product-bundle/`,
|
|
35
|
+
query_params,
|
|
36
|
+
body,
|
|
37
|
+
xHeaders
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
10
41
|
/**
|
|
11
42
|
* @param {Object} arg - Arg object.
|
|
12
43
|
* @param {string} [arg.q] - A search string that is searched with product
|
|
@@ -45,13 +76,16 @@ class Catalog {
|
|
|
45
76
|
|
|
46
77
|
/**
|
|
47
78
|
* @param {Object} arg - Arg object.
|
|
48
|
-
* @param {
|
|
49
|
-
*
|
|
50
|
-
* @
|
|
79
|
+
* @param {string} arg.id - A `id` is a unique identifier for a particular
|
|
80
|
+
* detail. Pass the `id` of the keywords which you want to delete.
|
|
81
|
+
* @param {ProductBundleUpdateRequest} arg.body
|
|
82
|
+
* @summary: Update a Product Bundle
|
|
83
|
+
* @description: Update a Product Bundle by its id. On successful request, returns the updated product bundle
|
|
51
84
|
*/
|
|
52
|
-
|
|
53
|
-
const { error } = CatalogValidator.
|
|
85
|
+
updateProductBundle({ id, body } = {}) {
|
|
86
|
+
const { error } = CatalogValidator.updateProductBundle().validate(
|
|
54
87
|
{
|
|
88
|
+
id,
|
|
55
89
|
body,
|
|
56
90
|
},
|
|
57
91
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -66,8 +100,8 @@ class Catalog {
|
|
|
66
100
|
|
|
67
101
|
return PlatformAPIClient.execute(
|
|
68
102
|
this.config,
|
|
69
|
-
"
|
|
70
|
-
`/service/platform/catalog/v1.0/company/${this.config.companyId}/product-bundle/`,
|
|
103
|
+
"put",
|
|
104
|
+
`/service/platform/catalog/v1.0/company/${this.config.companyId}/product-bundle/${id}/`,
|
|
71
105
|
query_params,
|
|
72
106
|
body,
|
|
73
107
|
xHeaders
|
|
@@ -108,16 +142,13 @@ class Catalog {
|
|
|
108
142
|
|
|
109
143
|
/**
|
|
110
144
|
* @param {Object} arg - Arg object.
|
|
111
|
-
* @param {
|
|
112
|
-
*
|
|
113
|
-
* @
|
|
114
|
-
* @summary: Update a Product Bundle
|
|
115
|
-
* @description: Update a Product Bundle by its id. On successful request, returns the updated product bundle
|
|
145
|
+
* @param {ValidateSizeGuide} arg.body
|
|
146
|
+
* @summary: Create a size guide.
|
|
147
|
+
* @description: This API allows to create a size guide associated to a brand.
|
|
116
148
|
*/
|
|
117
|
-
|
|
118
|
-
const { error } = CatalogValidator.
|
|
149
|
+
createSizeGuide({ body } = {}) {
|
|
150
|
+
const { error } = CatalogValidator.createSizeGuide().validate(
|
|
119
151
|
{
|
|
120
|
-
id,
|
|
121
152
|
body,
|
|
122
153
|
},
|
|
123
154
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -132,8 +163,8 @@ class Catalog {
|
|
|
132
163
|
|
|
133
164
|
return PlatformAPIClient.execute(
|
|
134
165
|
this.config,
|
|
135
|
-
"
|
|
136
|
-
`/service/platform/catalog/v1.0/company/${this.config.companyId}/
|
|
166
|
+
"post",
|
|
167
|
+
`/service/platform/catalog/v1.0/company/${this.config.companyId}/sizeguide`,
|
|
137
168
|
query_params,
|
|
138
169
|
body,
|
|
139
170
|
xHeaders
|
|
@@ -188,13 +219,15 @@ class Catalog {
|
|
|
188
219
|
|
|
189
220
|
/**
|
|
190
221
|
* @param {Object} arg - Arg object.
|
|
222
|
+
* @param {string} arg.id - Mongo id of the size guide to be edited
|
|
191
223
|
* @param {ValidateSizeGuide} arg.body
|
|
192
|
-
* @summary:
|
|
193
|
-
* @description: This API allows to
|
|
224
|
+
* @summary: Edit a size guide.
|
|
225
|
+
* @description: This API allows to edit a size guide.
|
|
194
226
|
*/
|
|
195
|
-
|
|
196
|
-
const { error } = CatalogValidator.
|
|
227
|
+
updateSizeGuide({ id, body } = {}) {
|
|
228
|
+
const { error } = CatalogValidator.updateSizeGuide().validate(
|
|
197
229
|
{
|
|
230
|
+
id,
|
|
198
231
|
body,
|
|
199
232
|
},
|
|
200
233
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -209,8 +242,8 @@ class Catalog {
|
|
|
209
242
|
|
|
210
243
|
return PlatformAPIClient.execute(
|
|
211
244
|
this.config,
|
|
212
|
-
"
|
|
213
|
-
`/service/platform/catalog/v1.0/company/${this.config.companyId}/sizeguide
|
|
245
|
+
"put",
|
|
246
|
+
`/service/platform/catalog/v1.0/company/${this.config.companyId}/sizeguide/${id}/`,
|
|
214
247
|
query_params,
|
|
215
248
|
body,
|
|
216
249
|
xHeaders
|
|
@@ -248,39 +281,6 @@ class Catalog {
|
|
|
248
281
|
);
|
|
249
282
|
}
|
|
250
283
|
|
|
251
|
-
/**
|
|
252
|
-
* @param {Object} arg - Arg object.
|
|
253
|
-
* @param {string} arg.id - Mongo id of the size guide to be edited
|
|
254
|
-
* @param {ValidateSizeGuide} arg.body
|
|
255
|
-
* @summary: Edit a size guide.
|
|
256
|
-
* @description: This API allows to edit a size guide.
|
|
257
|
-
*/
|
|
258
|
-
updateSizeGuide({ id, body } = {}) {
|
|
259
|
-
const { error } = CatalogValidator.updateSizeGuide().validate(
|
|
260
|
-
{
|
|
261
|
-
id,
|
|
262
|
-
body,
|
|
263
|
-
},
|
|
264
|
-
{ abortEarly: false, allowUnknown: true }
|
|
265
|
-
);
|
|
266
|
-
if (error) {
|
|
267
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
const query_params = {};
|
|
271
|
-
|
|
272
|
-
const xHeaders = {};
|
|
273
|
-
|
|
274
|
-
return PlatformAPIClient.execute(
|
|
275
|
-
this.config,
|
|
276
|
-
"put",
|
|
277
|
-
`/service/platform/catalog/v1.0/company/${this.config.companyId}/sizeguide/${id}/`,
|
|
278
|
-
query_params,
|
|
279
|
-
body,
|
|
280
|
-
xHeaders
|
|
281
|
-
);
|
|
282
|
-
}
|
|
283
|
-
|
|
284
284
|
/**
|
|
285
285
|
* @param {Object} arg - Arg object.
|
|
286
286
|
* @param {string} arg.sellerAppId - Id of the seller application which is
|
|
@@ -585,6 +585,37 @@ class Catalog {
|
|
|
585
585
|
);
|
|
586
586
|
}
|
|
587
587
|
|
|
588
|
+
/**
|
|
589
|
+
* @param {Object} arg - Arg object.
|
|
590
|
+
* @param {DepartmentCreateUpdate} arg.body
|
|
591
|
+
* @summary: Create the department.
|
|
592
|
+
* @description: Create departments using the API.
|
|
593
|
+
*/
|
|
594
|
+
createDepartments({ body } = {}) {
|
|
595
|
+
const { error } = CatalogValidator.createDepartments().validate(
|
|
596
|
+
{
|
|
597
|
+
body,
|
|
598
|
+
},
|
|
599
|
+
{ abortEarly: false, allowUnknown: true }
|
|
600
|
+
);
|
|
601
|
+
if (error) {
|
|
602
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
const query_params = {};
|
|
606
|
+
|
|
607
|
+
const xHeaders = {};
|
|
608
|
+
|
|
609
|
+
return PlatformAPIClient.execute(
|
|
610
|
+
this.config,
|
|
611
|
+
"post",
|
|
612
|
+
`/service/platform/catalog/v1.0/company/${this.config.companyId}/departments/`,
|
|
613
|
+
query_params,
|
|
614
|
+
body,
|
|
615
|
+
xHeaders
|
|
616
|
+
);
|
|
617
|
+
}
|
|
618
|
+
|
|
588
619
|
/**
|
|
589
620
|
* @param {Object} arg - Arg object.
|
|
590
621
|
* @param {number} [arg.pageNo] - The page number to navigate through the
|
|
@@ -635,13 +666,15 @@ class Catalog {
|
|
|
635
666
|
|
|
636
667
|
/**
|
|
637
668
|
* @param {Object} arg - Arg object.
|
|
669
|
+
* @param {string} arg.uid - A `uid` is a unique identifier of a department.
|
|
638
670
|
* @param {DepartmentCreateUpdate} arg.body
|
|
639
|
-
* @summary:
|
|
640
|
-
* @description:
|
|
671
|
+
* @summary: Update the department by their uid.
|
|
672
|
+
* @description: Update the department by their uid using this API.
|
|
641
673
|
*/
|
|
642
|
-
|
|
643
|
-
const { error } = CatalogValidator.
|
|
674
|
+
updateDepartment({ uid, body } = {}) {
|
|
675
|
+
const { error } = CatalogValidator.updateDepartment().validate(
|
|
644
676
|
{
|
|
677
|
+
uid,
|
|
645
678
|
body,
|
|
646
679
|
},
|
|
647
680
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -656,8 +689,8 @@ class Catalog {
|
|
|
656
689
|
|
|
657
690
|
return PlatformAPIClient.execute(
|
|
658
691
|
this.config,
|
|
659
|
-
"
|
|
660
|
-
`/service/platform/catalog/v1.0/company/${this.config.companyId}/departments/`,
|
|
692
|
+
"put",
|
|
693
|
+
`/service/platform/catalog/v1.0/company/${this.config.companyId}/departments/${uid}/`,
|
|
661
694
|
query_params,
|
|
662
695
|
body,
|
|
663
696
|
xHeaders
|
|
@@ -695,39 +728,6 @@ class Catalog {
|
|
|
695
728
|
);
|
|
696
729
|
}
|
|
697
730
|
|
|
698
|
-
/**
|
|
699
|
-
* @param {Object} arg - Arg object.
|
|
700
|
-
* @param {string} arg.uid - A `uid` is a unique identifier of a department.
|
|
701
|
-
* @param {DepartmentCreateUpdate} arg.body
|
|
702
|
-
* @summary: Update the department by their uid.
|
|
703
|
-
* @description: Update the department by their uid using this API.
|
|
704
|
-
*/
|
|
705
|
-
updateDepartment({ uid, body } = {}) {
|
|
706
|
-
const { error } = CatalogValidator.updateDepartment().validate(
|
|
707
|
-
{
|
|
708
|
-
uid,
|
|
709
|
-
body,
|
|
710
|
-
},
|
|
711
|
-
{ abortEarly: false, allowUnknown: true }
|
|
712
|
-
);
|
|
713
|
-
if (error) {
|
|
714
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
const query_params = {};
|
|
718
|
-
|
|
719
|
-
const xHeaders = {};
|
|
720
|
-
|
|
721
|
-
return PlatformAPIClient.execute(
|
|
722
|
-
this.config,
|
|
723
|
-
"put",
|
|
724
|
-
`/service/platform/catalog/v1.0/company/${this.config.companyId}/departments/${uid}/`,
|
|
725
|
-
query_params,
|
|
726
|
-
body,
|
|
727
|
-
xHeaders
|
|
728
|
-
);
|
|
729
|
-
}
|
|
730
|
-
|
|
731
731
|
/**
|
|
732
732
|
* @param {Object} arg - Arg object.
|
|
733
733
|
* @param {string} arg.department - A `department` is the name of a
|
|
@@ -831,8 +831,8 @@ class Catalog {
|
|
|
831
831
|
* @summary: Download Product Template View
|
|
832
832
|
* @description: Allows you to download product template data
|
|
833
833
|
*/
|
|
834
|
-
|
|
835
|
-
const { error } = CatalogValidator.
|
|
834
|
+
downloadInventoryTemplateView({ itemType } = {}) {
|
|
835
|
+
const { error } = CatalogValidator.downloadInventoryTemplateView().validate(
|
|
836
836
|
{
|
|
837
837
|
itemType,
|
|
838
838
|
},
|
|
@@ -981,6 +981,37 @@ class Catalog {
|
|
|
981
981
|
);
|
|
982
982
|
}
|
|
983
983
|
|
|
984
|
+
/**
|
|
985
|
+
* @param {Object} arg - Arg object.
|
|
986
|
+
* @param {CategoryRequestBody} arg.body
|
|
987
|
+
* @summary: Create product categories
|
|
988
|
+
* @description: This API lets user create product categories
|
|
989
|
+
*/
|
|
990
|
+
createCategories({ body } = {}) {
|
|
991
|
+
const { error } = CatalogValidator.createCategories().validate(
|
|
992
|
+
{
|
|
993
|
+
body,
|
|
994
|
+
},
|
|
995
|
+
{ abortEarly: false, allowUnknown: true }
|
|
996
|
+
);
|
|
997
|
+
if (error) {
|
|
998
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
const query_params = {};
|
|
1002
|
+
|
|
1003
|
+
const xHeaders = {};
|
|
1004
|
+
|
|
1005
|
+
return PlatformAPIClient.execute(
|
|
1006
|
+
this.config,
|
|
1007
|
+
"post",
|
|
1008
|
+
`/service/platform/catalog/v1.0/company/${this.config.companyId}/category/`,
|
|
1009
|
+
query_params,
|
|
1010
|
+
body,
|
|
1011
|
+
xHeaders
|
|
1012
|
+
);
|
|
1013
|
+
}
|
|
1014
|
+
|
|
984
1015
|
/**
|
|
985
1016
|
* @param {Object} arg - Arg object.
|
|
986
1017
|
* @param {string} [arg.level] - Get category for multiple levels
|
|
@@ -1029,13 +1060,15 @@ class Catalog {
|
|
|
1029
1060
|
|
|
1030
1061
|
/**
|
|
1031
1062
|
* @param {Object} arg - Arg object.
|
|
1063
|
+
* @param {string} arg.uid - Category unique id
|
|
1032
1064
|
* @param {CategoryRequestBody} arg.body
|
|
1033
|
-
* @summary:
|
|
1034
|
-
* @description:
|
|
1065
|
+
* @summary: Update product categories
|
|
1066
|
+
* @description: Update a product category using this apu
|
|
1035
1067
|
*/
|
|
1036
|
-
|
|
1037
|
-
const { error } = CatalogValidator.
|
|
1068
|
+
updateCategory({ uid, body } = {}) {
|
|
1069
|
+
const { error } = CatalogValidator.updateCategory().validate(
|
|
1038
1070
|
{
|
|
1071
|
+
uid,
|
|
1039
1072
|
body,
|
|
1040
1073
|
},
|
|
1041
1074
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -1050,8 +1083,8 @@ class Catalog {
|
|
|
1050
1083
|
|
|
1051
1084
|
return PlatformAPIClient.execute(
|
|
1052
1085
|
this.config,
|
|
1053
|
-
"
|
|
1054
|
-
`/service/platform/catalog/v1.0/company/${this.config.companyId}/category/`,
|
|
1086
|
+
"put",
|
|
1087
|
+
`/service/platform/catalog/v1.0/company/${this.config.companyId}/category/${uid}/`,
|
|
1055
1088
|
query_params,
|
|
1056
1089
|
body,
|
|
1057
1090
|
xHeaders
|
|
@@ -1091,15 +1124,13 @@ class Catalog {
|
|
|
1091
1124
|
|
|
1092
1125
|
/**
|
|
1093
1126
|
* @param {Object} arg - Arg object.
|
|
1094
|
-
* @param {
|
|
1095
|
-
* @
|
|
1096
|
-
* @
|
|
1097
|
-
* @description: Update a product category using this apu
|
|
1127
|
+
* @param {ProductCreateUpdateSchemaV2} arg.body
|
|
1128
|
+
* @summary: Create a product.
|
|
1129
|
+
* @description: This API allows to create product.
|
|
1098
1130
|
*/
|
|
1099
|
-
|
|
1100
|
-
const { error } = CatalogValidator.
|
|
1131
|
+
createProduct({ body } = {}) {
|
|
1132
|
+
const { error } = CatalogValidator.createProduct().validate(
|
|
1101
1133
|
{
|
|
1102
|
-
uid,
|
|
1103
1134
|
body,
|
|
1104
1135
|
},
|
|
1105
1136
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -1114,8 +1145,8 @@ class Catalog {
|
|
|
1114
1145
|
|
|
1115
1146
|
return PlatformAPIClient.execute(
|
|
1116
1147
|
this.config,
|
|
1117
|
-
"
|
|
1118
|
-
`/service/platform/catalog/
|
|
1148
|
+
"post",
|
|
1149
|
+
`/service/platform/catalog/v2.0/company/${this.config.companyId}/products/`,
|
|
1119
1150
|
query_params,
|
|
1120
1151
|
body,
|
|
1121
1152
|
xHeaders
|
|
@@ -1185,7 +1216,7 @@ class Catalog {
|
|
|
1185
1216
|
return PlatformAPIClient.execute(
|
|
1186
1217
|
this.config,
|
|
1187
1218
|
"get",
|
|
1188
|
-
`/service/platform/catalog/
|
|
1219
|
+
`/service/platform/catalog/v2.0/company/${this.config.companyId}/products/`,
|
|
1189
1220
|
query_params,
|
|
1190
1221
|
undefined,
|
|
1191
1222
|
xHeaders
|
|
@@ -1194,14 +1225,22 @@ class Catalog {
|
|
|
1194
1225
|
|
|
1195
1226
|
/**
|
|
1196
1227
|
* @param {Object} arg - Arg object.
|
|
1197
|
-
* @param {
|
|
1198
|
-
* @
|
|
1199
|
-
* @
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1228
|
+
* @param {number} arg.itemId - Get list of variants of item Id
|
|
1229
|
+
* @param {string} arg.variantType - Get multiple products filtered by variant type
|
|
1230
|
+
* @param {number} [arg.pageNo] - The page number to navigate through the
|
|
1231
|
+
* given set of results
|
|
1232
|
+
* @param {number} [arg.pageSize] - Number of items to retrieve in each
|
|
1233
|
+
* page. Default is 10.
|
|
1234
|
+
* @summary: Get product list
|
|
1235
|
+
* @description: This API gets meta associated to products.
|
|
1236
|
+
*/
|
|
1237
|
+
getVariantsOfProducts({ itemId, variantType, pageNo, pageSize } = {}) {
|
|
1238
|
+
const { error } = CatalogValidator.getVariantsOfProducts().validate(
|
|
1239
|
+
{
|
|
1240
|
+
itemId,
|
|
1241
|
+
variantType,
|
|
1242
|
+
pageNo,
|
|
1243
|
+
pageSize,
|
|
1205
1244
|
},
|
|
1206
1245
|
{ abortEarly: false, allowUnknown: true }
|
|
1207
1246
|
);
|
|
@@ -1210,15 +1249,17 @@ class Catalog {
|
|
|
1210
1249
|
}
|
|
1211
1250
|
|
|
1212
1251
|
const query_params = {};
|
|
1252
|
+
query_params["page_no"] = pageNo;
|
|
1253
|
+
query_params["page_size"] = pageSize;
|
|
1213
1254
|
|
|
1214
1255
|
const xHeaders = {};
|
|
1215
1256
|
|
|
1216
1257
|
return PlatformAPIClient.execute(
|
|
1217
1258
|
this.config,
|
|
1218
|
-
"
|
|
1219
|
-
`/service/platform/catalog/v1.0/company/${this.config.companyId}/products
|
|
1259
|
+
"get",
|
|
1260
|
+
`/service/platform/catalog/v1.0/company/${this.config.companyId}/products/${itemId}/variants/${variantType}`,
|
|
1220
1261
|
query_params,
|
|
1221
|
-
|
|
1262
|
+
undefined,
|
|
1222
1263
|
xHeaders
|
|
1223
1264
|
);
|
|
1224
1265
|
}
|
|
@@ -1261,18 +1302,14 @@ class Catalog {
|
|
|
1261
1302
|
|
|
1262
1303
|
/**
|
|
1263
1304
|
* @param {Object} arg - Arg object.
|
|
1264
|
-
* @param {
|
|
1265
|
-
* @
|
|
1266
|
-
* @
|
|
1267
|
-
* @summary: Get a single product.
|
|
1268
|
-
* @description: This API helps to get data associated to a particular product.
|
|
1305
|
+
* @param {number} arg.itemId - Id of the product to be updated.
|
|
1306
|
+
* @summary: Delete a product.
|
|
1307
|
+
* @description: This API allows to delete product.
|
|
1269
1308
|
*/
|
|
1270
|
-
|
|
1271
|
-
const { error } = CatalogValidator.
|
|
1309
|
+
deleteProduct({ itemId } = {}) {
|
|
1310
|
+
const { error } = CatalogValidator.deleteProduct().validate(
|
|
1272
1311
|
{
|
|
1273
1312
|
itemId,
|
|
1274
|
-
itemCode,
|
|
1275
|
-
brandUid,
|
|
1276
1313
|
},
|
|
1277
1314
|
{ abortEarly: false, allowUnknown: true }
|
|
1278
1315
|
);
|
|
@@ -1281,15 +1318,13 @@ class Catalog {
|
|
|
1281
1318
|
}
|
|
1282
1319
|
|
|
1283
1320
|
const query_params = {};
|
|
1284
|
-
query_params["item_code"] = itemCode;
|
|
1285
|
-
query_params["brand_uid"] = brandUid;
|
|
1286
1321
|
|
|
1287
1322
|
const xHeaders = {};
|
|
1288
1323
|
|
|
1289
1324
|
return PlatformAPIClient.execute(
|
|
1290
1325
|
this.config,
|
|
1291
|
-
"
|
|
1292
|
-
`/service/platform/catalog/
|
|
1326
|
+
"delete",
|
|
1327
|
+
`/service/platform/catalog/v2.0/company/${this.config.companyId}/products/${itemId}/`,
|
|
1293
1328
|
query_params,
|
|
1294
1329
|
undefined,
|
|
1295
1330
|
xHeaders
|
|
@@ -1299,7 +1334,7 @@ class Catalog {
|
|
|
1299
1334
|
/**
|
|
1300
1335
|
* @param {Object} arg - Arg object.
|
|
1301
1336
|
* @param {number} arg.itemId - Id of the product to be updated.
|
|
1302
|
-
* @param {
|
|
1337
|
+
* @param {ProductCreateUpdateSchemaV2} arg.body
|
|
1303
1338
|
* @summary: Edit a product.
|
|
1304
1339
|
* @description: This API allows to edit product.
|
|
1305
1340
|
*/
|
|
@@ -1322,21 +1357,58 @@ class Catalog {
|
|
|
1322
1357
|
return PlatformAPIClient.execute(
|
|
1323
1358
|
this.config,
|
|
1324
1359
|
"put",
|
|
1325
|
-
`/service/platform/catalog/
|
|
1360
|
+
`/service/platform/catalog/v2.0/company/${this.config.companyId}/products/${itemId}/`,
|
|
1326
1361
|
query_params,
|
|
1327
1362
|
body,
|
|
1328
1363
|
xHeaders
|
|
1329
1364
|
);
|
|
1330
1365
|
}
|
|
1331
1366
|
|
|
1367
|
+
/**
|
|
1368
|
+
* @param {Object} arg - Arg object.
|
|
1369
|
+
* @param {number} arg.itemId - Item Id of the product.
|
|
1370
|
+
* @param {number} [arg.brandUid] - Brand Id of the product.
|
|
1371
|
+
* @param {string} [arg.itemCode] - Item code of the product.
|
|
1372
|
+
* @summary: Get a single product.
|
|
1373
|
+
* @description: This API helps to get data associated to a particular product.
|
|
1374
|
+
*/
|
|
1375
|
+
getProduct({ itemId, brandUid, itemCode } = {}) {
|
|
1376
|
+
const { error } = CatalogValidator.getProduct().validate(
|
|
1377
|
+
{
|
|
1378
|
+
itemId,
|
|
1379
|
+
brandUid,
|
|
1380
|
+
itemCode,
|
|
1381
|
+
},
|
|
1382
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1383
|
+
);
|
|
1384
|
+
if (error) {
|
|
1385
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1388
|
+
const query_params = {};
|
|
1389
|
+
query_params["brand_uid"] = brandUid;
|
|
1390
|
+
query_params["item_code"] = itemCode;
|
|
1391
|
+
|
|
1392
|
+
const xHeaders = {};
|
|
1393
|
+
|
|
1394
|
+
return PlatformAPIClient.execute(
|
|
1395
|
+
this.config,
|
|
1396
|
+
"get",
|
|
1397
|
+
`/service/platform/catalog/v2.0/company/${this.config.companyId}/products/${itemId}/`,
|
|
1398
|
+
query_params,
|
|
1399
|
+
undefined,
|
|
1400
|
+
xHeaders
|
|
1401
|
+
);
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1332
1404
|
/**
|
|
1333
1405
|
* @param {Object} arg - Arg object.
|
|
1334
1406
|
* @param {number} arg.itemId - Id of the product to be updated.
|
|
1335
|
-
* @summary:
|
|
1336
|
-
* @description: This API allows to
|
|
1407
|
+
* @summary: All Sizes for a given Product
|
|
1408
|
+
* @description: This API allows to get All Sizes for a given Product.
|
|
1337
1409
|
*/
|
|
1338
|
-
|
|
1339
|
-
const { error } = CatalogValidator.
|
|
1410
|
+
allSizes({ itemId } = {}) {
|
|
1411
|
+
const { error } = CatalogValidator.allSizes().validate(
|
|
1340
1412
|
{
|
|
1341
1413
|
itemId,
|
|
1342
1414
|
},
|
|
@@ -1352,8 +1424,8 @@ class Catalog {
|
|
|
1352
1424
|
|
|
1353
1425
|
return PlatformAPIClient.execute(
|
|
1354
1426
|
this.config,
|
|
1355
|
-
"
|
|
1356
|
-
`/service/platform/catalog/
|
|
1427
|
+
"get",
|
|
1428
|
+
`/service/platform/catalog/v2.0/company/${this.config.companyId}/products/${itemId}/all_sizes`,
|
|
1357
1429
|
query_params,
|
|
1358
1430
|
undefined,
|
|
1359
1431
|
xHeaders
|
|
@@ -1430,6 +1502,38 @@ class Catalog {
|
|
|
1430
1502
|
|
|
1431
1503
|
/**
|
|
1432
1504
|
* @param {Object} arg - Arg object.
|
|
1505
|
+
* @param {BulkJob} arg.body
|
|
1506
|
+
* @summary: Create a Bulk product to upload job.
|
|
1507
|
+
* @description: This API helps to create a bulk products upload job.
|
|
1508
|
+
*/
|
|
1509
|
+
createBulkProductUploadJob({ body } = {}) {
|
|
1510
|
+
const { error } = CatalogValidator.createBulkProductUploadJob().validate(
|
|
1511
|
+
{
|
|
1512
|
+
body,
|
|
1513
|
+
},
|
|
1514
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1515
|
+
);
|
|
1516
|
+
if (error) {
|
|
1517
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1518
|
+
}
|
|
1519
|
+
|
|
1520
|
+
const query_params = {};
|
|
1521
|
+
|
|
1522
|
+
const xHeaders = {};
|
|
1523
|
+
|
|
1524
|
+
return PlatformAPIClient.execute(
|
|
1525
|
+
this.config,
|
|
1526
|
+
"post",
|
|
1527
|
+
`/service/platform/catalog/v1.0/company/${this.config.companyId}/products/bulk`,
|
|
1528
|
+
query_params,
|
|
1529
|
+
body,
|
|
1530
|
+
xHeaders
|
|
1531
|
+
);
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
/**
|
|
1535
|
+
* @param {Object} arg - Arg object.
|
|
1536
|
+
* @param {string} [arg.search] - Search string to filter the results by batch id
|
|
1433
1537
|
* @param {number} [arg.pageNo] - The page number to navigate through the
|
|
1434
1538
|
* given set of results
|
|
1435
1539
|
* @param {number} [arg.pageSize] - Number of items to retrieve in each
|
|
@@ -1437,9 +1541,10 @@ class Catalog {
|
|
|
1437
1541
|
* @summary: Get a list of all bulk product upload jobs.
|
|
1438
1542
|
* @description: This API helps to get bulk product upload jobs data.
|
|
1439
1543
|
*/
|
|
1440
|
-
getProductBulkUploadHistory({ pageNo, pageSize } = {}) {
|
|
1544
|
+
getProductBulkUploadHistory({ search, pageNo, pageSize } = {}) {
|
|
1441
1545
|
const { error } = CatalogValidator.getProductBulkUploadHistory().validate(
|
|
1442
1546
|
{
|
|
1547
|
+
search,
|
|
1443
1548
|
pageNo,
|
|
1444
1549
|
pageSize,
|
|
1445
1550
|
},
|
|
@@ -1450,6 +1555,7 @@ class Catalog {
|
|
|
1450
1555
|
}
|
|
1451
1556
|
|
|
1452
1557
|
const query_params = {};
|
|
1558
|
+
query_params["search"] = search;
|
|
1453
1559
|
query_params["page_no"] = pageNo;
|
|
1454
1560
|
query_params["page_size"] = pageSize;
|
|
1455
1561
|
|
|
@@ -1467,13 +1573,18 @@ class Catalog {
|
|
|
1467
1573
|
|
|
1468
1574
|
/**
|
|
1469
1575
|
* @param {Object} arg - Arg object.
|
|
1576
|
+
* @param {string} arg.department - Department of the product to be uploaded.
|
|
1577
|
+
* @param {string} arg.productType - Product type of the product to be
|
|
1578
|
+
* uploaded i.e. set, standard , digital.
|
|
1470
1579
|
* @param {BulkJob} arg.body
|
|
1471
1580
|
* @summary: Create a Bulk product to upload job.
|
|
1472
1581
|
* @description: This API helps to create a bulk products upload job.
|
|
1473
1582
|
*/
|
|
1474
|
-
|
|
1475
|
-
const { error } = CatalogValidator.
|
|
1583
|
+
uploadBulkProducts({ department, productType, body } = {}) {
|
|
1584
|
+
const { error } = CatalogValidator.uploadBulkProducts().validate(
|
|
1476
1585
|
{
|
|
1586
|
+
department,
|
|
1587
|
+
productType,
|
|
1477
1588
|
body,
|
|
1478
1589
|
},
|
|
1479
1590
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -1483,13 +1594,15 @@ class Catalog {
|
|
|
1483
1594
|
}
|
|
1484
1595
|
|
|
1485
1596
|
const query_params = {};
|
|
1597
|
+
query_params["department"] = department;
|
|
1598
|
+
query_params["product_type"] = productType;
|
|
1486
1599
|
|
|
1487
1600
|
const xHeaders = {};
|
|
1488
1601
|
|
|
1489
1602
|
return PlatformAPIClient.execute(
|
|
1490
1603
|
this.config,
|
|
1491
1604
|
"post",
|
|
1492
|
-
`/service/platform/catalog/
|
|
1605
|
+
`/service/platform/catalog/v2.0/company/${this.config.companyId}/products/bulk`,
|
|
1493
1606
|
query_params,
|
|
1494
1607
|
body,
|
|
1495
1608
|
xHeaders
|
|
@@ -1498,14 +1611,16 @@ class Catalog {
|
|
|
1498
1611
|
|
|
1499
1612
|
/**
|
|
1500
1613
|
* @param {Object} arg - Arg object.
|
|
1501
|
-
* @param {
|
|
1502
|
-
* @
|
|
1503
|
-
* @
|
|
1614
|
+
* @param {string} arg.batchId - Batch Id in which assets to be uploaded.
|
|
1615
|
+
* @param {BulkProductRequest} arg.body
|
|
1616
|
+
* @summary: Create products in bulk associated with given batch Id.
|
|
1617
|
+
* @description: This API helps to create products in bulk push to kafka for approval/creation.
|
|
1504
1618
|
*/
|
|
1505
|
-
|
|
1506
|
-
const { error } = CatalogValidator.
|
|
1619
|
+
createProductsInBulk({ batchId, body } = {}) {
|
|
1620
|
+
const { error } = CatalogValidator.createProductsInBulk().validate(
|
|
1507
1621
|
{
|
|
1508
1622
|
batchId,
|
|
1623
|
+
body,
|
|
1509
1624
|
},
|
|
1510
1625
|
{ abortEarly: false, allowUnknown: true }
|
|
1511
1626
|
);
|
|
@@ -1519,26 +1634,24 @@ class Catalog {
|
|
|
1519
1634
|
|
|
1520
1635
|
return PlatformAPIClient.execute(
|
|
1521
1636
|
this.config,
|
|
1522
|
-
"
|
|
1637
|
+
"post",
|
|
1523
1638
|
`/service/platform/catalog/v1.0/company/${this.config.companyId}/products/bulk/${batchId}`,
|
|
1524
1639
|
query_params,
|
|
1525
|
-
|
|
1640
|
+
body,
|
|
1526
1641
|
xHeaders
|
|
1527
1642
|
);
|
|
1528
1643
|
}
|
|
1529
1644
|
|
|
1530
1645
|
/**
|
|
1531
1646
|
* @param {Object} arg - Arg object.
|
|
1532
|
-
* @param {
|
|
1533
|
-
* @
|
|
1534
|
-
* @
|
|
1535
|
-
* @description: This API helps to create products in bulk push to kafka for approval/creation.
|
|
1647
|
+
* @param {number} arg.batchId - Batch Id of the bulk product job to be deleted.
|
|
1648
|
+
* @summary: Delete Bulk product job.
|
|
1649
|
+
* @description: This API allows to delete bulk product job associated with company.
|
|
1536
1650
|
*/
|
|
1537
|
-
|
|
1538
|
-
const { error } = CatalogValidator.
|
|
1651
|
+
deleteProductBulkJob({ batchId } = {}) {
|
|
1652
|
+
const { error } = CatalogValidator.deleteProductBulkJob().validate(
|
|
1539
1653
|
{
|
|
1540
1654
|
batchId,
|
|
1541
|
-
body,
|
|
1542
1655
|
},
|
|
1543
1656
|
{ abortEarly: false, allowUnknown: true }
|
|
1544
1657
|
);
|
|
@@ -1552,10 +1665,10 @@ class Catalog {
|
|
|
1552
1665
|
|
|
1553
1666
|
return PlatformAPIClient.execute(
|
|
1554
1667
|
this.config,
|
|
1555
|
-
"
|
|
1668
|
+
"delete",
|
|
1556
1669
|
`/service/platform/catalog/v1.0/company/${this.config.companyId}/products/bulk/${batchId}`,
|
|
1557
1670
|
query_params,
|
|
1558
|
-
|
|
1671
|
+
undefined,
|
|
1559
1672
|
xHeaders
|
|
1560
1673
|
);
|
|
1561
1674
|
}
|
|
@@ -1588,6 +1701,37 @@ class Catalog {
|
|
|
1588
1701
|
);
|
|
1589
1702
|
}
|
|
1590
1703
|
|
|
1704
|
+
/**
|
|
1705
|
+
* @param {Object} arg - Arg object.
|
|
1706
|
+
* @param {ProductBulkAssets} arg.body
|
|
1707
|
+
* @summary: Create a Bulk asset upload Job.
|
|
1708
|
+
* @description: This API helps to create a bulk asset upload job.
|
|
1709
|
+
*/
|
|
1710
|
+
createProductAssetsInBulk({ body } = {}) {
|
|
1711
|
+
const { error } = CatalogValidator.createProductAssetsInBulk().validate(
|
|
1712
|
+
{
|
|
1713
|
+
body,
|
|
1714
|
+
},
|
|
1715
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1716
|
+
);
|
|
1717
|
+
if (error) {
|
|
1718
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1719
|
+
}
|
|
1720
|
+
|
|
1721
|
+
const query_params = {};
|
|
1722
|
+
|
|
1723
|
+
const xHeaders = {};
|
|
1724
|
+
|
|
1725
|
+
return PlatformAPIClient.execute(
|
|
1726
|
+
this.config,
|
|
1727
|
+
"post",
|
|
1728
|
+
`/service/platform/catalog/v1.0/company/${this.config.companyId}/products/assets/bulk/`,
|
|
1729
|
+
query_params,
|
|
1730
|
+
body,
|
|
1731
|
+
xHeaders
|
|
1732
|
+
);
|
|
1733
|
+
}
|
|
1734
|
+
|
|
1591
1735
|
/**
|
|
1592
1736
|
* @param {Object} arg - Arg object.
|
|
1593
1737
|
* @param {number} [arg.pageNo] - The page number to navigate through the
|
|
@@ -1627,14 +1771,17 @@ class Catalog {
|
|
|
1627
1771
|
|
|
1628
1772
|
/**
|
|
1629
1773
|
* @param {Object} arg - Arg object.
|
|
1630
|
-
* @param {
|
|
1631
|
-
*
|
|
1632
|
-
* @
|
|
1774
|
+
* @param {number} arg.itemId - Item Id of the product associated with size
|
|
1775
|
+
* to be deleted.
|
|
1776
|
+
* @param {string} arg.size - Size to be deleted.
|
|
1777
|
+
* @summary: Delete a Size associated with product.
|
|
1778
|
+
* @description: This API allows to delete size associated with product.
|
|
1633
1779
|
*/
|
|
1634
|
-
|
|
1635
|
-
const { error } = CatalogValidator.
|
|
1780
|
+
deleteSize({ itemId, size } = {}) {
|
|
1781
|
+
const { error } = CatalogValidator.deleteSize().validate(
|
|
1636
1782
|
{
|
|
1637
|
-
|
|
1783
|
+
itemId,
|
|
1784
|
+
size,
|
|
1638
1785
|
},
|
|
1639
1786
|
{ abortEarly: false, allowUnknown: true }
|
|
1640
1787
|
);
|
|
@@ -1648,27 +1795,28 @@ class Catalog {
|
|
|
1648
1795
|
|
|
1649
1796
|
return PlatformAPIClient.execute(
|
|
1650
1797
|
this.config,
|
|
1651
|
-
"
|
|
1652
|
-
`/service/platform/catalog/v1.0/company/${this.config.companyId}/products/
|
|
1798
|
+
"delete",
|
|
1799
|
+
`/service/platform/catalog/v1.0/company/${this.config.companyId}/products/${itemId}/sizes/${size}`,
|
|
1653
1800
|
query_params,
|
|
1654
|
-
|
|
1801
|
+
undefined,
|
|
1655
1802
|
xHeaders
|
|
1656
1803
|
);
|
|
1657
1804
|
}
|
|
1658
1805
|
|
|
1659
1806
|
/**
|
|
1660
1807
|
* @param {Object} arg - Arg object.
|
|
1661
|
-
* @param {number} arg.itemId - Item
|
|
1662
|
-
*
|
|
1663
|
-
* @param {
|
|
1664
|
-
* @summary:
|
|
1665
|
-
* @description: This API allows
|
|
1808
|
+
* @param {number} arg.itemId - Item code of the product of which size is to be get.
|
|
1809
|
+
* @param {string} arg.size - Size in which inventory is to be added.
|
|
1810
|
+
* @param {InventoryRequest} arg.body
|
|
1811
|
+
* @summary: Add Inventory for particular size and store.
|
|
1812
|
+
* @description: This API allows add Inventory for particular size and store.
|
|
1666
1813
|
*/
|
|
1667
|
-
|
|
1668
|
-
const { error } = CatalogValidator.
|
|
1814
|
+
addInventory({ itemId, size, body } = {}) {
|
|
1815
|
+
const { error } = CatalogValidator.addInventory().validate(
|
|
1669
1816
|
{
|
|
1670
1817
|
itemId,
|
|
1671
1818
|
size,
|
|
1819
|
+
body,
|
|
1672
1820
|
},
|
|
1673
1821
|
{ abortEarly: false, allowUnknown: true }
|
|
1674
1822
|
);
|
|
@@ -1682,10 +1830,10 @@ class Catalog {
|
|
|
1682
1830
|
|
|
1683
1831
|
return PlatformAPIClient.execute(
|
|
1684
1832
|
this.config,
|
|
1685
|
-
"
|
|
1833
|
+
"post",
|
|
1686
1834
|
`/service/platform/catalog/v1.0/company/${this.config.companyId}/products/${itemId}/sizes/${size}`,
|
|
1687
1835
|
query_params,
|
|
1688
|
-
|
|
1836
|
+
body,
|
|
1689
1837
|
xHeaders
|
|
1690
1838
|
);
|
|
1691
1839
|
}
|
|
@@ -1739,18 +1887,34 @@ class Catalog {
|
|
|
1739
1887
|
|
|
1740
1888
|
/**
|
|
1741
1889
|
* @param {Object} arg - Arg object.
|
|
1742
|
-
* @param {
|
|
1743
|
-
* @param {string} arg.
|
|
1744
|
-
*
|
|
1745
|
-
* @
|
|
1746
|
-
*
|
|
1890
|
+
* @param {string} arg.itemId - Item code of the product of which size is to be get.
|
|
1891
|
+
* @param {string} arg.sizeIdentifier - Size Identifier (Seller Identifier
|
|
1892
|
+
* or Primary Identifier) of which inventory is to get.
|
|
1893
|
+
* @param {number} [arg.pageNo] - The page number to navigate through the
|
|
1894
|
+
* given set of results
|
|
1895
|
+
* @param {number} [arg.pageSize] - Number of items to retrieve in each
|
|
1896
|
+
* page. Default is 12.
|
|
1897
|
+
* @param {string} [arg.q] - Search with help of store code.
|
|
1898
|
+
* @param {number[]} [arg.locationIds] - Search by store ids.
|
|
1899
|
+
* @summary: Get Inventory for company
|
|
1900
|
+
* @description: This API allows get Inventory data for particular company grouped by size and store.
|
|
1747
1901
|
*/
|
|
1748
|
-
|
|
1749
|
-
|
|
1902
|
+
getInventoryBySizeIdentifier({
|
|
1903
|
+
itemId,
|
|
1904
|
+
sizeIdentifier,
|
|
1905
|
+
pageNo,
|
|
1906
|
+
pageSize,
|
|
1907
|
+
q,
|
|
1908
|
+
locationIds,
|
|
1909
|
+
} = {}) {
|
|
1910
|
+
const { error } = CatalogValidator.getInventoryBySizeIdentifier().validate(
|
|
1750
1911
|
{
|
|
1751
1912
|
itemId,
|
|
1752
|
-
|
|
1753
|
-
|
|
1913
|
+
sizeIdentifier,
|
|
1914
|
+
pageNo,
|
|
1915
|
+
pageSize,
|
|
1916
|
+
q,
|
|
1917
|
+
locationIds,
|
|
1754
1918
|
},
|
|
1755
1919
|
{ abortEarly: false, allowUnknown: true }
|
|
1756
1920
|
);
|
|
@@ -1759,49 +1923,59 @@ class Catalog {
|
|
|
1759
1923
|
}
|
|
1760
1924
|
|
|
1761
1925
|
const query_params = {};
|
|
1926
|
+
query_params["page_no"] = pageNo;
|
|
1927
|
+
query_params["page_size"] = pageSize;
|
|
1928
|
+
query_params["q"] = q;
|
|
1929
|
+
query_params["location_ids"] = locationIds;
|
|
1762
1930
|
|
|
1763
1931
|
const xHeaders = {};
|
|
1764
1932
|
|
|
1765
1933
|
return PlatformAPIClient.execute(
|
|
1766
1934
|
this.config,
|
|
1767
|
-
"
|
|
1768
|
-
`/service/platform/catalog/v1.0/company/${this.config.companyId}/products/${itemId}/
|
|
1935
|
+
"get",
|
|
1936
|
+
`/service/platform/catalog/v1.0/company/${this.config.companyId}/products/${itemId}/inventory/${sizeIdentifier}`,
|
|
1769
1937
|
query_params,
|
|
1770
|
-
|
|
1938
|
+
undefined,
|
|
1771
1939
|
xHeaders
|
|
1772
1940
|
);
|
|
1773
1941
|
}
|
|
1774
1942
|
|
|
1775
1943
|
/**
|
|
1776
1944
|
* @param {Object} arg - Arg object.
|
|
1777
|
-
* @param {string} arg.itemId - Item code of the product of which size is to be get.
|
|
1778
|
-
* @param {string} arg.
|
|
1779
|
-
* or Primary Identifier) of which inventory is to get.
|
|
1945
|
+
* @param {string} [arg.itemId] - Item code of the product of which size is to be get.
|
|
1946
|
+
* @param {string} [arg.size] - Size of which inventory is to get.
|
|
1780
1947
|
* @param {number} [arg.pageNo] - The page number to navigate through the
|
|
1781
1948
|
* given set of results
|
|
1782
1949
|
* @param {number} [arg.pageSize] - Number of items to retrieve in each
|
|
1783
1950
|
* page. Default is 12.
|
|
1784
1951
|
* @param {string} [arg.q] - Search with help of store code.
|
|
1785
|
-
* @param {
|
|
1952
|
+
* @param {boolean} [arg.sellable] - Filter on whether product is in stock or not.
|
|
1953
|
+
* @param {number[]} [arg.storeIds] - The Store Id of products to fetch inventory.
|
|
1954
|
+
* @param {string} [arg.sizeIdentifier] - Size Identifier (Seller Identifier
|
|
1955
|
+
* or Primary Identifier) of which inventory is to get.
|
|
1786
1956
|
* @summary: Get Inventory for company
|
|
1787
|
-
* @description: This API allows get
|
|
1957
|
+
* @description: This API allows get Inventories data for particular company.
|
|
1788
1958
|
*/
|
|
1789
|
-
|
|
1959
|
+
getInventories({
|
|
1790
1960
|
itemId,
|
|
1791
|
-
|
|
1961
|
+
size,
|
|
1792
1962
|
pageNo,
|
|
1793
1963
|
pageSize,
|
|
1794
1964
|
q,
|
|
1795
|
-
|
|
1965
|
+
sellable,
|
|
1966
|
+
storeIds,
|
|
1967
|
+
sizeIdentifier,
|
|
1796
1968
|
} = {}) {
|
|
1797
|
-
const { error } = CatalogValidator.
|
|
1969
|
+
const { error } = CatalogValidator.getInventories().validate(
|
|
1798
1970
|
{
|
|
1799
1971
|
itemId,
|
|
1800
|
-
|
|
1972
|
+
size,
|
|
1801
1973
|
pageNo,
|
|
1802
1974
|
pageSize,
|
|
1803
1975
|
q,
|
|
1804
|
-
|
|
1976
|
+
sellable,
|
|
1977
|
+
storeIds,
|
|
1978
|
+
sizeIdentifier,
|
|
1805
1979
|
},
|
|
1806
1980
|
{ abortEarly: false, allowUnknown: true }
|
|
1807
1981
|
);
|
|
@@ -1810,17 +1984,21 @@ class Catalog {
|
|
|
1810
1984
|
}
|
|
1811
1985
|
|
|
1812
1986
|
const query_params = {};
|
|
1987
|
+
query_params["item_id"] = itemId;
|
|
1988
|
+
query_params["size"] = size;
|
|
1813
1989
|
query_params["page_no"] = pageNo;
|
|
1814
1990
|
query_params["page_size"] = pageSize;
|
|
1815
1991
|
query_params["q"] = q;
|
|
1816
|
-
query_params["
|
|
1992
|
+
query_params["sellable"] = sellable;
|
|
1993
|
+
query_params["store_ids"] = storeIds;
|
|
1994
|
+
query_params["size_identifier"] = sizeIdentifier;
|
|
1817
1995
|
|
|
1818
1996
|
const xHeaders = {};
|
|
1819
1997
|
|
|
1820
1998
|
return PlatformAPIClient.execute(
|
|
1821
1999
|
this.config,
|
|
1822
2000
|
"get",
|
|
1823
|
-
`/service/platform/catalog/v1.0/company/${this.config.companyId}/
|
|
2001
|
+
`/service/platform/catalog/v1.0/company/${this.config.companyId}/inventories`,
|
|
1824
2002
|
query_params,
|
|
1825
2003
|
undefined,
|
|
1826
2004
|
xHeaders
|
|
@@ -1864,6 +2042,37 @@ class Catalog {
|
|
|
1864
2042
|
);
|
|
1865
2043
|
}
|
|
1866
2044
|
|
|
2045
|
+
/**
|
|
2046
|
+
* @param {Object} arg - Arg object.
|
|
2047
|
+
* @param {BulkJob} arg.body
|
|
2048
|
+
* @summary: Create a Bulk Inventory upload Job.
|
|
2049
|
+
* @description: This API helps to create a bulk Inventory upload job.
|
|
2050
|
+
*/
|
|
2051
|
+
createBulkInventoryJob({ body } = {}) {
|
|
2052
|
+
const { error } = CatalogValidator.createBulkInventoryJob().validate(
|
|
2053
|
+
{
|
|
2054
|
+
body,
|
|
2055
|
+
},
|
|
2056
|
+
{ abortEarly: false, allowUnknown: true }
|
|
2057
|
+
);
|
|
2058
|
+
if (error) {
|
|
2059
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
2060
|
+
}
|
|
2061
|
+
|
|
2062
|
+
const query_params = {};
|
|
2063
|
+
|
|
2064
|
+
const xHeaders = {};
|
|
2065
|
+
|
|
2066
|
+
return PlatformAPIClient.execute(
|
|
2067
|
+
this.config,
|
|
2068
|
+
"post",
|
|
2069
|
+
`/service/platform/catalog/v1.0/company/${this.config.companyId}/inventory/bulk/`,
|
|
2070
|
+
query_params,
|
|
2071
|
+
body,
|
|
2072
|
+
xHeaders
|
|
2073
|
+
);
|
|
2074
|
+
}
|
|
2075
|
+
|
|
1867
2076
|
/**
|
|
1868
2077
|
* @param {Object} arg - Arg object.
|
|
1869
2078
|
* @param {number} [arg.pageNo] - The page number to navigate through the
|
|
@@ -1903,13 +2112,15 @@ class Catalog {
|
|
|
1903
2112
|
|
|
1904
2113
|
/**
|
|
1905
2114
|
* @param {Object} arg - Arg object.
|
|
1906
|
-
* @param {
|
|
1907
|
-
* @
|
|
1908
|
-
* @
|
|
2115
|
+
* @param {string} arg.batchId - Batch Id of the bulk create job.
|
|
2116
|
+
* @param {InventoryBulkRequest} arg.body
|
|
2117
|
+
* @summary: Create products in bulk associated with given batch Id.
|
|
2118
|
+
* @description: This API helps to create products in bulk push to kafka for approval/creation.
|
|
1909
2119
|
*/
|
|
1910
|
-
|
|
1911
|
-
const { error } = CatalogValidator.
|
|
2120
|
+
createBulkInventory({ batchId, body } = {}) {
|
|
2121
|
+
const { error } = CatalogValidator.createBulkInventory().validate(
|
|
1912
2122
|
{
|
|
2123
|
+
batchId,
|
|
1913
2124
|
body,
|
|
1914
2125
|
},
|
|
1915
2126
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -1925,7 +2136,7 @@ class Catalog {
|
|
|
1925
2136
|
return PlatformAPIClient.execute(
|
|
1926
2137
|
this.config,
|
|
1927
2138
|
"post",
|
|
1928
|
-
`/service/platform/catalog/v1.0/company/${this.config.companyId}/inventory/bulk/`,
|
|
2139
|
+
`/service/platform/catalog/v1.0/company/${this.config.companyId}/inventory/bulk/${batchId}/`,
|
|
1929
2140
|
query_params,
|
|
1930
2141
|
body,
|
|
1931
2142
|
xHeaders
|
|
@@ -1965,15 +2176,13 @@ class Catalog {
|
|
|
1965
2176
|
|
|
1966
2177
|
/**
|
|
1967
2178
|
* @param {Object} arg - Arg object.
|
|
1968
|
-
* @param {
|
|
1969
|
-
* @
|
|
1970
|
-
* @
|
|
1971
|
-
* @description: This API helps to create products in bulk push to kafka for approval/creation.
|
|
2179
|
+
* @param {InventoryExportRequest} arg.body
|
|
2180
|
+
* @summary: Create a Inventory export Job.
|
|
2181
|
+
* @description: This API helps to create a Inventory export job.
|
|
1972
2182
|
*/
|
|
1973
|
-
|
|
1974
|
-
const { error } = CatalogValidator.
|
|
2183
|
+
createInventoryExportJob({ body } = {}) {
|
|
2184
|
+
const { error } = CatalogValidator.createInventoryExportJob().validate(
|
|
1975
2185
|
{
|
|
1976
|
-
batchId,
|
|
1977
2186
|
body,
|
|
1978
2187
|
},
|
|
1979
2188
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -1989,7 +2198,7 @@ class Catalog {
|
|
|
1989
2198
|
return PlatformAPIClient.execute(
|
|
1990
2199
|
this.config,
|
|
1991
2200
|
"post",
|
|
1992
|
-
`/service/platform/catalog/v1.0/company/${this.config.companyId}/inventory/
|
|
2201
|
+
`/service/platform/catalog/v1.0/company/${this.config.companyId}/inventory/download/`,
|
|
1993
2202
|
query_params,
|
|
1994
2203
|
body,
|
|
1995
2204
|
xHeaders
|
|
@@ -2026,14 +2235,15 @@ class Catalog {
|
|
|
2026
2235
|
|
|
2027
2236
|
/**
|
|
2028
2237
|
* @param {Object} arg - Arg object.
|
|
2029
|
-
* @param {
|
|
2030
|
-
*
|
|
2031
|
-
* @
|
|
2238
|
+
* @param {string} [arg.filterType] - Filter type from any one of ['brand',
|
|
2239
|
+
* 'store', 'type']
|
|
2240
|
+
* @summary: Get List of different filters for inventory export
|
|
2241
|
+
* @description: This API allows get List of different filters like brand, store, and type for inventory export.
|
|
2032
2242
|
*/
|
|
2033
|
-
|
|
2034
|
-
const { error } = CatalogValidator.
|
|
2243
|
+
exportInventoryConfig({ filterType } = {}) {
|
|
2244
|
+
const { error } = CatalogValidator.exportInventoryConfig().validate(
|
|
2035
2245
|
{
|
|
2036
|
-
|
|
2246
|
+
filterType,
|
|
2037
2247
|
},
|
|
2038
2248
|
{ abortEarly: false, allowUnknown: true }
|
|
2039
2249
|
);
|
|
@@ -2042,30 +2252,35 @@ class Catalog {
|
|
|
2042
2252
|
}
|
|
2043
2253
|
|
|
2044
2254
|
const query_params = {};
|
|
2255
|
+
query_params["filter_type"] = filterType;
|
|
2045
2256
|
|
|
2046
2257
|
const xHeaders = {};
|
|
2047
2258
|
|
|
2048
2259
|
return PlatformAPIClient.execute(
|
|
2049
2260
|
this.config,
|
|
2050
|
-
"
|
|
2051
|
-
`/service/platform/catalog/v1.0/company/${this.config.companyId}/inventory/download/`,
|
|
2261
|
+
"get",
|
|
2262
|
+
`/service/platform/catalog/v1.0/company/${this.config.companyId}/inventory/download/configuration/`,
|
|
2052
2263
|
query_params,
|
|
2053
|
-
|
|
2264
|
+
undefined,
|
|
2054
2265
|
xHeaders
|
|
2055
2266
|
);
|
|
2056
2267
|
}
|
|
2057
2268
|
|
|
2058
2269
|
/**
|
|
2059
2270
|
* @param {Object} arg - Arg object.
|
|
2060
|
-
* @param {
|
|
2061
|
-
*
|
|
2062
|
-
*
|
|
2063
|
-
* @
|
|
2271
|
+
* @param {number} arg.itemId - Item code of the product of which size is to be get.
|
|
2272
|
+
* @param {string} arg.sellerIdentifier - Size Identifier (Seller Identifier
|
|
2273
|
+
* or Primary Identifier) of which inventory is to get.
|
|
2274
|
+
* @param {InventoryRequestSchemaV2} arg.body
|
|
2275
|
+
* @summary: Add Inventory for particular size and store.
|
|
2276
|
+
* @description: This API allows add Inventory for particular size and store.
|
|
2064
2277
|
*/
|
|
2065
|
-
|
|
2066
|
-
const { error } = CatalogValidator.
|
|
2278
|
+
updateRealtimeInventory({ itemId, sellerIdentifier, body } = {}) {
|
|
2279
|
+
const { error } = CatalogValidator.updateRealtimeInventory().validate(
|
|
2067
2280
|
{
|
|
2068
|
-
|
|
2281
|
+
itemId,
|
|
2282
|
+
sellerIdentifier,
|
|
2283
|
+
body,
|
|
2069
2284
|
},
|
|
2070
2285
|
{ abortEarly: false, allowUnknown: true }
|
|
2071
2286
|
);
|
|
@@ -2074,16 +2289,15 @@ class Catalog {
|
|
|
2074
2289
|
}
|
|
2075
2290
|
|
|
2076
2291
|
const query_params = {};
|
|
2077
|
-
query_params["filter_type"] = filterType;
|
|
2078
2292
|
|
|
2079
2293
|
const xHeaders = {};
|
|
2080
2294
|
|
|
2081
2295
|
return PlatformAPIClient.execute(
|
|
2082
2296
|
this.config,
|
|
2083
|
-
"
|
|
2084
|
-
`/service/platform/catalog/
|
|
2297
|
+
"post",
|
|
2298
|
+
`/service/platform/catalog/v2.0/company/${this.config.companyId}/products/${itemId}/inventory/${sellerIdentifier}/`,
|
|
2085
2299
|
query_params,
|
|
2086
|
-
|
|
2300
|
+
body,
|
|
2087
2301
|
xHeaders
|
|
2088
2302
|
);
|
|
2089
2303
|
}
|
|
@@ -2126,18 +2340,13 @@ class Catalog {
|
|
|
2126
2340
|
|
|
2127
2341
|
/**
|
|
2128
2342
|
* @param {Object} arg - Arg object.
|
|
2129
|
-
* @param {number} arg.itemId - Item code of the product of which size is to be get.
|
|
2130
|
-
* @param {string} arg.sellerIdentifier - Size Identifier (Seller Identifier
|
|
2131
|
-
* or Primary Identifier) of which inventory is to get.
|
|
2132
2343
|
* @param {InventoryRequestSchemaV2} arg.body
|
|
2133
2344
|
* @summary: Add Inventory for particular size and store.
|
|
2134
2345
|
* @description: This API allows add Inventory for particular size and store.
|
|
2135
2346
|
*/
|
|
2136
|
-
|
|
2137
|
-
const { error } = CatalogValidator.
|
|
2347
|
+
updateInventories({ body } = {}) {
|
|
2348
|
+
const { error } = CatalogValidator.updateInventories().validate(
|
|
2138
2349
|
{
|
|
2139
|
-
itemId,
|
|
2140
|
-
sellerIdentifier,
|
|
2141
2350
|
body,
|
|
2142
2351
|
},
|
|
2143
2352
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -2153,7 +2362,7 @@ class Catalog {
|
|
|
2153
2362
|
return PlatformAPIClient.execute(
|
|
2154
2363
|
this.config,
|
|
2155
2364
|
"post",
|
|
2156
|
-
`/service/platform/catalog/v2.0/company/${this.config.companyId}/
|
|
2365
|
+
`/service/platform/catalog/v2.0/company/${this.config.companyId}/inventory/`,
|
|
2157
2366
|
query_params,
|
|
2158
2367
|
body,
|
|
2159
2368
|
xHeaders
|
|
@@ -2162,12 +2371,12 @@ class Catalog {
|
|
|
2162
2371
|
|
|
2163
2372
|
/**
|
|
2164
2373
|
* @param {Object} arg - Arg object.
|
|
2165
|
-
* @param {
|
|
2166
|
-
* @summary:
|
|
2167
|
-
* @description:
|
|
2374
|
+
* @param {HsnUpsert} arg.body
|
|
2375
|
+
* @summary: Create Hsn Code.
|
|
2376
|
+
* @description: Create Hsn Code.
|
|
2168
2377
|
*/
|
|
2169
|
-
|
|
2170
|
-
const { error } = CatalogValidator.
|
|
2378
|
+
createHsnCode({ body } = {}) {
|
|
2379
|
+
const { error } = CatalogValidator.createHsnCode().validate(
|
|
2171
2380
|
{
|
|
2172
2381
|
body,
|
|
2173
2382
|
},
|
|
@@ -2184,7 +2393,7 @@ class Catalog {
|
|
|
2184
2393
|
return PlatformAPIClient.execute(
|
|
2185
2394
|
this.config,
|
|
2186
2395
|
"post",
|
|
2187
|
-
`/service/platform/catalog/
|
|
2396
|
+
`/service/platform/catalog/v1.0/company/${this.config.companyId}/hsn/`,
|
|
2188
2397
|
query_params,
|
|
2189
2398
|
body,
|
|
2190
2399
|
xHeaders
|
|
@@ -2231,13 +2440,15 @@ class Catalog {
|
|
|
2231
2440
|
|
|
2232
2441
|
/**
|
|
2233
2442
|
* @param {Object} arg - Arg object.
|
|
2443
|
+
* @param {string} arg.id - Unique id
|
|
2234
2444
|
* @param {HsnUpsert} arg.body
|
|
2235
|
-
* @summary:
|
|
2236
|
-
* @description:
|
|
2445
|
+
* @summary: Update Hsn Code.
|
|
2446
|
+
* @description: Update Hsn Code.
|
|
2237
2447
|
*/
|
|
2238
|
-
|
|
2239
|
-
const { error } = CatalogValidator.
|
|
2448
|
+
updateHsnCode({ id, body } = {}) {
|
|
2449
|
+
const { error } = CatalogValidator.updateHsnCode().validate(
|
|
2240
2450
|
{
|
|
2451
|
+
id,
|
|
2241
2452
|
body,
|
|
2242
2453
|
},
|
|
2243
2454
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -2252,8 +2463,8 @@ class Catalog {
|
|
|
2252
2463
|
|
|
2253
2464
|
return PlatformAPIClient.execute(
|
|
2254
2465
|
this.config,
|
|
2255
|
-
"
|
|
2256
|
-
`/service/platform/catalog/v1.0/company/${this.config.companyId}/hsn/`,
|
|
2466
|
+
"put",
|
|
2467
|
+
`/service/platform/catalog/v1.0/company/${this.config.companyId}/hsn/${id}/`,
|
|
2257
2468
|
query_params,
|
|
2258
2469
|
body,
|
|
2259
2470
|
xHeaders
|
|
@@ -2291,39 +2502,6 @@ class Catalog {
|
|
|
2291
2502
|
);
|
|
2292
2503
|
}
|
|
2293
2504
|
|
|
2294
|
-
/**
|
|
2295
|
-
* @param {Object} arg - Arg object.
|
|
2296
|
-
* @param {string} arg.id - Unique id
|
|
2297
|
-
* @param {HsnUpsert} arg.body
|
|
2298
|
-
* @summary: Update Hsn Code.
|
|
2299
|
-
* @description: Update Hsn Code.
|
|
2300
|
-
*/
|
|
2301
|
-
updateHsnCode({ id, body } = {}) {
|
|
2302
|
-
const { error } = CatalogValidator.updateHsnCode().validate(
|
|
2303
|
-
{
|
|
2304
|
-
id,
|
|
2305
|
-
body,
|
|
2306
|
-
},
|
|
2307
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2308
|
-
);
|
|
2309
|
-
if (error) {
|
|
2310
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
2311
|
-
}
|
|
2312
|
-
|
|
2313
|
-
const query_params = {};
|
|
2314
|
-
|
|
2315
|
-
const xHeaders = {};
|
|
2316
|
-
|
|
2317
|
-
return PlatformAPIClient.execute(
|
|
2318
|
-
this.config,
|
|
2319
|
-
"put",
|
|
2320
|
-
`/service/platform/catalog/v1.0/company/${this.config.companyId}/hsn/${id}/`,
|
|
2321
|
-
query_params,
|
|
2322
|
-
body,
|
|
2323
|
-
xHeaders
|
|
2324
|
-
);
|
|
2325
|
-
}
|
|
2326
|
-
|
|
2327
2505
|
/**
|
|
2328
2506
|
* @param {Object} arg - Arg object.
|
|
2329
2507
|
* @param {BulkHsnUpsert} arg.body
|