@gofynd/fdk-client-javascript 1.0.0 → 1.0.2
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/documentation/application/CART.md +251 -251
- package/documentation/application/CATALOG.md +393 -393
- package/documentation/application/CONTENT.md +15 -1
- package/documentation/application/ORDER.md +268 -268
- package/documentation/application/PAYMENT.md +249 -249
- package/documentation/application/POSCART.md +297 -297
- package/documentation/platform/CART.md +499 -499
- package/documentation/platform/CATALOG.md +3497 -3097
- package/documentation/platform/COMPANYPROFILE.md +207 -207
- package/documentation/platform/CONTENT.md +123 -1
- package/documentation/platform/ORDER.md +1518 -1324
- package/documentation/platform/PARTNER.md +7 -7
- package/documentation/platform/PAYMENT.md +96 -96
- package/index.js +7 -1
- package/package.json +1 -1
- package/sdk/application/ApplicationConfig.js +1 -1
- package/sdk/application/Cart/CartApplicationClient.js +865 -52
- package/sdk/application/Cart/CartApplicationModel.d.ts +7 -7
- package/sdk/application/Cart/CartApplicationModel.js +335 -335
- package/sdk/application/Cart/CartApplicationValidator.js +1 -0
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +1 -1
- package/sdk/application/Catalog/CatalogApplicationClient.js +1034 -60
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +19 -19
- package/sdk/application/Catalog/CatalogApplicationModel.js +532 -532
- package/sdk/application/Catalog/CatalogApplicationValidator.js +1 -0
- package/sdk/application/Common/CommonApplicationClient.js +66 -4
- package/sdk/application/Common/CommonApplicationValidator.js +1 -0
- package/sdk/application/Communication/CommunicationApplicationClient.js +108 -6
- package/sdk/application/Communication/CommunicationApplicationValidator.js +1 -0
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +1 -1
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +558 -32
- package/sdk/application/Configuration/ConfigurationApplicationValidator.js +1 -0
- package/sdk/application/Content/ContentApplicationClient.js +621 -38
- package/sdk/application/Content/ContentApplicationModel.d.ts +1 -0
- package/sdk/application/Content/ContentApplicationModel.js +11 -1
- package/sdk/application/Content/ContentApplicationValidator.js +1 -0
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +101 -6
- package/sdk/application/FileStorage/FileStorageApplicationValidator.js +1 -0
- package/sdk/application/Lead/LeadApplicationClient.js +229 -14
- package/sdk/application/Lead/LeadApplicationValidator.js +1 -0
- package/sdk/application/Logistic/LogisticApplicationClient.js +134 -8
- package/sdk/application/Logistic/LogisticApplicationValidator.js +1 -0
- package/sdk/application/Order/OrderApplicationClient.d.ts +1 -1
- package/sdk/application/Order/OrderApplicationClient.js +403 -24
- package/sdk/application/Order/OrderApplicationModel.d.ts +20 -20
- package/sdk/application/Order/OrderApplicationModel.js +334 -334
- package/sdk/application/Order/OrderApplicationValidator.js +1 -0
- package/sdk/application/Payment/PaymentApplicationClient.js +1381 -78
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +2 -2
- package/sdk/application/Payment/PaymentApplicationModel.js +350 -350
- package/sdk/application/Payment/PaymentApplicationValidator.js +1 -0
- package/sdk/application/PosCart/PosCartApplicationClient.js +914 -54
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +15 -15
- package/sdk/application/PosCart/PosCartApplicationModel.js +389 -389
- package/sdk/application/PosCart/PosCartApplicationValidator.js +1 -0
- package/sdk/application/Rewards/RewardsApplicationClient.js +235 -14
- package/sdk/application/Rewards/RewardsApplicationValidator.js +1 -0
- package/sdk/application/Share/ShareApplicationClient.js +226 -14
- package/sdk/application/Share/ShareApplicationValidator.js +1 -0
- package/sdk/application/Theme/ThemeApplicationClient.js +130 -8
- package/sdk/application/Theme/ThemeApplicationValidator.js +1 -0
- package/sdk/application/User/UserApplicationClient.js +1133 -70
- package/sdk/application/User/UserApplicationValidator.js +1 -0
- package/sdk/common/AxiosHelper.js +1 -1
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +16 -8
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +287 -16
- package/sdk/platform/Analytics/AnalyticsPlatformClient.d.ts +8 -4
- package/sdk/platform/Analytics/AnalyticsPlatformClient.js +153 -8
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +8 -4
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +141 -8
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +24 -12
- package/sdk/platform/Billing/BillingPlatformClient.js +429 -24
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +34 -17
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +617 -34
- package/sdk/platform/Cart/CartPlatformModel.d.ts +35 -35
- package/sdk/platform/Cart/CartPlatformModel.js +617 -617
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +191 -138
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +2202 -302
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +11 -11
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +45 -45
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +344 -226
- package/sdk/platform/Catalog/CatalogPlatformClient.js +3282 -488
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +110 -100
- package/sdk/platform/Catalog/CatalogPlatformModel.js +2073 -1795
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +23 -21
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +103 -84
- package/sdk/platform/Common/CommonPlatformClient.d.ts +4 -2
- package/sdk/platform/Common/CommonPlatformClient.js +73 -4
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +80 -40
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +1499 -80
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +2 -1
- package/sdk/platform/Communication/CommunicationPlatformClient.js +41 -2
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +27 -14
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +486 -26
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +9 -9
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +274 -274
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +56 -28
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +1022 -56
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +36 -18
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +693 -36
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +148 -67
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +2446 -140
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +1 -0
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +7 -0
- package/sdk/platform/Content/ContentPlatformModel.d.ts +4 -0
- package/sdk/platform/Content/ContentPlatformModel.js +43 -1
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +21 -10
- package/sdk/platform/Discount/DiscountPlatformClient.js +400 -22
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +8 -4
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +148 -8
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +12 -6
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +214 -12
- package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +27 -14
- package/sdk/platform/Inventory/InventoryPlatformClient.js +449 -24
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +26 -13
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +447 -26
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +22 -11
- package/sdk/platform/Lead/LeadPlatformClient.js +384 -22
- package/sdk/platform/OAuthClient.js +8 -8
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +6 -3
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +125 -6
- package/sdk/platform/Order/OrderPlatformClient.d.ts +108 -47
- package/sdk/platform/Order/OrderPlatformClient.js +1641 -100
- package/sdk/platform/Order/OrderPlatformModel.d.ts +69 -58
- package/sdk/platform/Order/OrderPlatformModel.js +1485 -1493
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +2 -1
- package/sdk/platform/Order/OrderPlatformValidator.js +15 -4
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -2
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +74 -4
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -1
- package/sdk/platform/Partner/PartnerPlatformModel.js +8 -8
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +22 -11
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +418 -22
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +21 -11
- package/sdk/platform/Payment/PaymentPlatformClient.js +374 -20
- package/sdk/platform/Payment/PaymentPlatformModel.js +139 -139
- package/sdk/platform/PlatformApplicationClient.d.ts +2973 -2827
- package/sdk/platform/PlatformApplicationClient.js +3461 -3263
- package/sdk/platform/PlatformClient.d.ts +2973 -2827
- package/sdk/platform/PlatformClient.js +3461 -3263
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +26 -13
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +449 -26
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +8 -4
- package/sdk/platform/Share/SharePlatformApplicationClient.js +139 -8
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +47 -23
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +816 -48
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +24 -12
- package/sdk/platform/User/UserPlatformApplicationClient.js +417 -24
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +12 -6
- package/sdk/platform/Webhook/WebhookPlatformClient.js +229 -12
- package/sdk/public/Configuration/ConfigurationPublicClient.js +72 -4
- package/sdk/public/Configuration/ConfigurationPublicValidator.js +3 -1
- package/sdk/public/Inventory/InventoryPublicClient.js +210 -12
- package/sdk/public/Inventory/InventoryPublicValidator.js +3 -1
- package/sdk/public/Webhook/WebhookPublicClient.js +74 -4
- package/sdk/public/Webhook/WebhookPublicValidator.js +3 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export = CatalogValidator;
|
|
2
2
|
declare class CatalogValidator {
|
|
3
|
-
static getProductBundle(): any;
|
|
4
3
|
static createProductBundle(): any;
|
|
5
|
-
static
|
|
4
|
+
static getProductBundle(): any;
|
|
6
5
|
static getProductBundleDetail(): any;
|
|
7
|
-
static
|
|
6
|
+
static updateProductBundle(): any;
|
|
8
7
|
static createSizeGuide(): any;
|
|
9
|
-
static
|
|
8
|
+
static getSizeGuides(): any;
|
|
10
9
|
static getSizeGuide(): any;
|
|
10
|
+
static updateSizeGuide(): any;
|
|
11
11
|
static getSellerInsights(): any;
|
|
12
12
|
static createMarketplaceOptin(): any;
|
|
13
13
|
static getMarketplaceOptinDetail(): any;
|
|
@@ -17,10 +17,10 @@ declare class CatalogValidator {
|
|
|
17
17
|
static getStoreDetail(): any;
|
|
18
18
|
static getGenderAttribute(): any;
|
|
19
19
|
static listProductTemplateCategories(): any;
|
|
20
|
-
static listDepartmentsData(): any;
|
|
21
20
|
static createDepartments(): any;
|
|
22
|
-
static
|
|
21
|
+
static listDepartmentsData(): any;
|
|
23
22
|
static getDepartmentData(): any;
|
|
23
|
+
static updateDepartment(): any;
|
|
24
24
|
static listProductTemplate(): any;
|
|
25
25
|
static validateProductTemplate(): any;
|
|
26
26
|
static downloadProductTemplateViews(): any;
|
|
@@ -28,49 +28,51 @@ declare class CatalogValidator {
|
|
|
28
28
|
static validateProductTemplateSchema(): any;
|
|
29
29
|
static listHSNCodes(): any;
|
|
30
30
|
static listProductTemplateExportDetails(): any;
|
|
31
|
+
static createProductExportJob(): any;
|
|
32
|
+
static getProductExportJobs(): any;
|
|
31
33
|
static listTemplateBrandTypeValues(): any;
|
|
32
|
-
static listCategories(): any;
|
|
33
34
|
static createCategories(): any;
|
|
34
|
-
static
|
|
35
|
+
static listCategories(): any;
|
|
35
36
|
static getCategoryData(): any;
|
|
36
|
-
static
|
|
37
|
+
static updateCategory(): any;
|
|
37
38
|
static createProduct(): any;
|
|
39
|
+
static getProducts(): any;
|
|
38
40
|
static getVariantsOfProducts(): any;
|
|
39
41
|
static getProductAttributes(): any;
|
|
40
|
-
static editProduct(): any;
|
|
41
42
|
static getProduct(): any;
|
|
43
|
+
static editProduct(): any;
|
|
42
44
|
static deleteProduct(): any;
|
|
43
45
|
static allSizes(): any;
|
|
44
46
|
static getProductValidation(): any;
|
|
45
47
|
static getProductSize(): any;
|
|
46
|
-
static getProductBulkUploadHistory(): any;
|
|
47
48
|
static createBulkProductUploadJob(): any;
|
|
49
|
+
static getProductBulkUploadHistory(): any;
|
|
48
50
|
static uploadBulkProducts(): any;
|
|
49
|
-
static deleteProductBulkJob(): any;
|
|
50
51
|
static createProductsInBulk(): any;
|
|
52
|
+
static deleteProductBulkJob(): any;
|
|
51
53
|
static getProductTags(): any;
|
|
52
|
-
static getProductAssetsInBulk(): any;
|
|
53
54
|
static createProductAssetsInBulk(): any;
|
|
55
|
+
static getProductAssetsInBulk(): any;
|
|
54
56
|
static deleteSize(): any;
|
|
55
|
-
static getInventoryBySize(): any;
|
|
56
57
|
static addInventory(): any;
|
|
58
|
+
static getInventoryBySize(): any;
|
|
57
59
|
static getInventoryBySizeIdentifier(): any;
|
|
58
60
|
static getInventories(): any;
|
|
59
61
|
static deleteInventory(): any;
|
|
60
|
-
static getInventoryBulkUploadHistory(): any;
|
|
61
62
|
static createBulkInventoryJob(): any;
|
|
62
|
-
static
|
|
63
|
+
static getInventoryBulkUploadHistory(): any;
|
|
63
64
|
static createBulkInventory(): any;
|
|
64
|
-
static
|
|
65
|
+
static deleteBulkInventoryJob(): any;
|
|
65
66
|
static createInventoryExportJob(): any;
|
|
67
|
+
static getInventoryExport(): any;
|
|
68
|
+
static createInventoryExport(): any;
|
|
69
|
+
static listInventoryExport(): any;
|
|
66
70
|
static exportInventoryConfig(): any;
|
|
67
|
-
static deleteRealtimeInventory(): any;
|
|
68
71
|
static updateRealtimeInventory(): any;
|
|
72
|
+
static deleteRealtimeInventory(): any;
|
|
69
73
|
static updateInventories(): any;
|
|
70
|
-
static getAllHsnCodes(): any;
|
|
71
|
-
static createHsnCode(): any;
|
|
72
|
-
static updateHsnCode(): any;
|
|
73
74
|
static getHsnCode(): any;
|
|
75
|
+
static updateHsnCode(): any;
|
|
74
76
|
static bulkHsnCode(): any;
|
|
75
77
|
static getAllProductHsnCodes(): any;
|
|
76
78
|
static getSingleProductHSNCode(): any;
|
|
@@ -2,6 +2,12 @@ const Joi = require("joi");
|
|
|
2
2
|
|
|
3
3
|
const CatalogModel = require("./CatalogPlatformModel");
|
|
4
4
|
class CatalogValidator {
|
|
5
|
+
static createProductBundle() {
|
|
6
|
+
return Joi.object({
|
|
7
|
+
body: CatalogModel.ProductBundleRequest().required(),
|
|
8
|
+
}).required();
|
|
9
|
+
}
|
|
10
|
+
|
|
5
11
|
static getProductBundle() {
|
|
6
12
|
return Joi.object({
|
|
7
13
|
q: Joi.string().allow(""),
|
|
@@ -9,9 +15,9 @@ class CatalogValidator {
|
|
|
9
15
|
}).required();
|
|
10
16
|
}
|
|
11
17
|
|
|
12
|
-
static
|
|
18
|
+
static getProductBundleDetail() {
|
|
13
19
|
return Joi.object({
|
|
14
|
-
|
|
20
|
+
id: Joi.string().allow("").required(),
|
|
15
21
|
}).required();
|
|
16
22
|
}
|
|
17
23
|
|
|
@@ -22,9 +28,9 @@ class CatalogValidator {
|
|
|
22
28
|
}).required();
|
|
23
29
|
}
|
|
24
30
|
|
|
25
|
-
static
|
|
31
|
+
static createSizeGuide() {
|
|
26
32
|
return Joi.object({
|
|
27
|
-
|
|
33
|
+
body: CatalogModel.ValidateSizeGuide().required(),
|
|
28
34
|
}).required();
|
|
29
35
|
}
|
|
30
36
|
|
|
@@ -38,9 +44,9 @@ class CatalogValidator {
|
|
|
38
44
|
}).required();
|
|
39
45
|
}
|
|
40
46
|
|
|
41
|
-
static
|
|
47
|
+
static getSizeGuide() {
|
|
42
48
|
return Joi.object({
|
|
43
|
-
|
|
49
|
+
id: Joi.string().allow("").required(),
|
|
44
50
|
}).required();
|
|
45
51
|
}
|
|
46
52
|
|
|
@@ -51,12 +57,6 @@ class CatalogValidator {
|
|
|
51
57
|
}).required();
|
|
52
58
|
}
|
|
53
59
|
|
|
54
|
-
static getSizeGuide() {
|
|
55
|
-
return Joi.object({
|
|
56
|
-
id: Joi.string().allow("").required(),
|
|
57
|
-
}).required();
|
|
58
|
-
}
|
|
59
|
-
|
|
60
60
|
static getSellerInsights() {
|
|
61
61
|
return Joi.object({
|
|
62
62
|
sellerAppId: Joi.string().allow("").required(),
|
|
@@ -113,9 +113,16 @@ class CatalogValidator {
|
|
|
113
113
|
}).required();
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
+
static createDepartments() {
|
|
117
|
+
return Joi.object({
|
|
118
|
+
body: CatalogModel.DepartmentCreateUpdate().required(),
|
|
119
|
+
}).required();
|
|
120
|
+
}
|
|
121
|
+
|
|
116
122
|
static listDepartmentsData() {
|
|
117
123
|
return Joi.object({
|
|
118
124
|
pageNo: Joi.number(),
|
|
125
|
+
itemType: Joi.string().allow(""),
|
|
119
126
|
pageSize: Joi.number(),
|
|
120
127
|
name: Joi.string().allow(""),
|
|
121
128
|
search: Joi.string().allow(""),
|
|
@@ -123,9 +130,9 @@ class CatalogValidator {
|
|
|
123
130
|
}).required();
|
|
124
131
|
}
|
|
125
132
|
|
|
126
|
-
static
|
|
133
|
+
static getDepartmentData() {
|
|
127
134
|
return Joi.object({
|
|
128
|
-
|
|
135
|
+
uid: Joi.string().allow("").required(),
|
|
129
136
|
}).required();
|
|
130
137
|
}
|
|
131
138
|
|
|
@@ -136,12 +143,6 @@ class CatalogValidator {
|
|
|
136
143
|
}).required();
|
|
137
144
|
}
|
|
138
145
|
|
|
139
|
-
static getDepartmentData() {
|
|
140
|
-
return Joi.object({
|
|
141
|
-
uid: Joi.string().allow("").required(),
|
|
142
|
-
}).required();
|
|
143
|
-
}
|
|
144
|
-
|
|
145
146
|
static listProductTemplate() {
|
|
146
147
|
return Joi.object({
|
|
147
148
|
department: Joi.string().allow("").required(),
|
|
@@ -180,9 +181,32 @@ class CatalogValidator {
|
|
|
180
181
|
return Joi.object({}).required();
|
|
181
182
|
}
|
|
182
183
|
|
|
184
|
+
static createProductExportJob() {
|
|
185
|
+
return Joi.object({
|
|
186
|
+
body: CatalogModel.ProductTemplateDownloadsExport().required(),
|
|
187
|
+
}).required();
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
static getProductExportJobs() {
|
|
191
|
+
return Joi.object({
|
|
192
|
+
status: Joi.string().allow(""),
|
|
193
|
+
fromDate: Joi.string().allow(""),
|
|
194
|
+
toDate: Joi.string().allow(""),
|
|
195
|
+
q: Joi.string().allow(""),
|
|
196
|
+
}).required();
|
|
197
|
+
}
|
|
198
|
+
|
|
183
199
|
static listTemplateBrandTypeValues() {
|
|
184
200
|
return Joi.object({
|
|
185
201
|
filter: Joi.string().allow("").required(),
|
|
202
|
+
templateTag: Joi.string().allow(""),
|
|
203
|
+
itemType: Joi.string().allow(""),
|
|
204
|
+
}).required();
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
static createCategories() {
|
|
208
|
+
return Joi.object({
|
|
209
|
+
body: CatalogModel.CategoryRequestBody().required(),
|
|
186
210
|
}).required();
|
|
187
211
|
}
|
|
188
212
|
|
|
@@ -196,9 +220,9 @@ class CatalogValidator {
|
|
|
196
220
|
}).required();
|
|
197
221
|
}
|
|
198
222
|
|
|
199
|
-
static
|
|
223
|
+
static getCategoryData() {
|
|
200
224
|
return Joi.object({
|
|
201
|
-
|
|
225
|
+
uid: Joi.string().allow("").required(),
|
|
202
226
|
}).required();
|
|
203
227
|
}
|
|
204
228
|
|
|
@@ -209,9 +233,9 @@ class CatalogValidator {
|
|
|
209
233
|
}).required();
|
|
210
234
|
}
|
|
211
235
|
|
|
212
|
-
static
|
|
236
|
+
static createProduct() {
|
|
213
237
|
return Joi.object({
|
|
214
|
-
|
|
238
|
+
body: CatalogModel.ProductCreateUpdateSchemaV2().required(),
|
|
215
239
|
}).required();
|
|
216
240
|
}
|
|
217
241
|
|
|
@@ -229,12 +253,6 @@ class CatalogValidator {
|
|
|
229
253
|
}).required();
|
|
230
254
|
}
|
|
231
255
|
|
|
232
|
-
static createProduct() {
|
|
233
|
-
return Joi.object({
|
|
234
|
-
body: CatalogModel.ProductCreateUpdateSchemaV2().required(),
|
|
235
|
-
}).required();
|
|
236
|
-
}
|
|
237
|
-
|
|
238
256
|
static getVariantsOfProducts() {
|
|
239
257
|
return Joi.object({
|
|
240
258
|
itemId: Joi.number().required(),
|
|
@@ -251,18 +269,18 @@ class CatalogValidator {
|
|
|
251
269
|
}).required();
|
|
252
270
|
}
|
|
253
271
|
|
|
254
|
-
static
|
|
272
|
+
static getProduct() {
|
|
255
273
|
return Joi.object({
|
|
256
274
|
itemId: Joi.number().required(),
|
|
257
|
-
|
|
275
|
+
brandUid: Joi.number(),
|
|
276
|
+
itemCode: Joi.string().allow(""),
|
|
258
277
|
}).required();
|
|
259
278
|
}
|
|
260
279
|
|
|
261
|
-
static
|
|
280
|
+
static editProduct() {
|
|
262
281
|
return Joi.object({
|
|
263
282
|
itemId: Joi.number().required(),
|
|
264
|
-
|
|
265
|
-
itemCode: Joi.string().allow(""),
|
|
283
|
+
body: CatalogModel.ProductCreateUpdateSchemaV2().required(),
|
|
266
284
|
}).required();
|
|
267
285
|
}
|
|
268
286
|
|
|
@@ -291,17 +309,17 @@ class CatalogValidator {
|
|
|
291
309
|
}).required();
|
|
292
310
|
}
|
|
293
311
|
|
|
294
|
-
static
|
|
312
|
+
static createBulkProductUploadJob() {
|
|
295
313
|
return Joi.object({
|
|
296
|
-
|
|
297
|
-
pageNo: Joi.number(),
|
|
298
|
-
pageSize: Joi.number(),
|
|
314
|
+
body: CatalogModel.BulkJob().required(),
|
|
299
315
|
}).required();
|
|
300
316
|
}
|
|
301
317
|
|
|
302
|
-
static
|
|
318
|
+
static getProductBulkUploadHistory() {
|
|
303
319
|
return Joi.object({
|
|
304
|
-
|
|
320
|
+
search: Joi.string().allow(""),
|
|
321
|
+
pageNo: Joi.number(),
|
|
322
|
+
pageSize: Joi.number(),
|
|
305
323
|
}).required();
|
|
306
324
|
}
|
|
307
325
|
|
|
@@ -313,16 +331,16 @@ class CatalogValidator {
|
|
|
313
331
|
}).required();
|
|
314
332
|
}
|
|
315
333
|
|
|
316
|
-
static
|
|
334
|
+
static createProductsInBulk() {
|
|
317
335
|
return Joi.object({
|
|
318
|
-
batchId: Joi.
|
|
336
|
+
batchId: Joi.string().allow("").required(),
|
|
337
|
+
body: CatalogModel.BulkProductRequest().required(),
|
|
319
338
|
}).required();
|
|
320
339
|
}
|
|
321
340
|
|
|
322
|
-
static
|
|
341
|
+
static deleteProductBulkJob() {
|
|
323
342
|
return Joi.object({
|
|
324
|
-
batchId: Joi.
|
|
325
|
-
body: CatalogModel.BulkProductRequest().required(),
|
|
343
|
+
batchId: Joi.number().required(),
|
|
326
344
|
}).required();
|
|
327
345
|
}
|
|
328
346
|
|
|
@@ -330,6 +348,12 @@ class CatalogValidator {
|
|
|
330
348
|
return Joi.object({}).required();
|
|
331
349
|
}
|
|
332
350
|
|
|
351
|
+
static createProductAssetsInBulk() {
|
|
352
|
+
return Joi.object({
|
|
353
|
+
body: CatalogModel.ProductBulkAssets().required(),
|
|
354
|
+
}).required();
|
|
355
|
+
}
|
|
356
|
+
|
|
333
357
|
static getProductAssetsInBulk() {
|
|
334
358
|
return Joi.object({
|
|
335
359
|
pageNo: Joi.number(),
|
|
@@ -337,22 +361,24 @@ class CatalogValidator {
|
|
|
337
361
|
}).required();
|
|
338
362
|
}
|
|
339
363
|
|
|
340
|
-
static
|
|
364
|
+
static deleteSize() {
|
|
341
365
|
return Joi.object({
|
|
342
|
-
|
|
366
|
+
itemId: Joi.number().required(),
|
|
367
|
+
size: Joi.string().allow("").required(),
|
|
343
368
|
}).required();
|
|
344
369
|
}
|
|
345
370
|
|
|
346
|
-
static
|
|
371
|
+
static addInventory() {
|
|
347
372
|
return Joi.object({
|
|
348
373
|
itemId: Joi.number().required(),
|
|
349
374
|
size: Joi.string().allow("").required(),
|
|
375
|
+
body: CatalogModel.InventoryRequest().required(),
|
|
350
376
|
}).required();
|
|
351
377
|
}
|
|
352
378
|
|
|
353
379
|
static getInventoryBySize() {
|
|
354
380
|
return Joi.object({
|
|
355
|
-
itemId: Joi.
|
|
381
|
+
itemId: Joi.number().required(),
|
|
356
382
|
size: Joi.string().allow("").required(),
|
|
357
383
|
pageNo: Joi.number(),
|
|
358
384
|
pageSize: Joi.number(),
|
|
@@ -361,17 +387,9 @@ class CatalogValidator {
|
|
|
361
387
|
}).required();
|
|
362
388
|
}
|
|
363
389
|
|
|
364
|
-
static addInventory() {
|
|
365
|
-
return Joi.object({
|
|
366
|
-
itemId: Joi.number().required(),
|
|
367
|
-
size: Joi.string().allow("").required(),
|
|
368
|
-
body: CatalogModel.InventoryRequest().required(),
|
|
369
|
-
}).required();
|
|
370
|
-
}
|
|
371
|
-
|
|
372
390
|
static getInventoryBySizeIdentifier() {
|
|
373
391
|
return Joi.object({
|
|
374
|
-
itemId: Joi.
|
|
392
|
+
itemId: Joi.number().required(),
|
|
375
393
|
sizeIdentifier: Joi.string().allow("").required(),
|
|
376
394
|
pageNo: Joi.number(),
|
|
377
395
|
pageSize: Joi.number(),
|
|
@@ -401,6 +419,12 @@ class CatalogValidator {
|
|
|
401
419
|
}).required();
|
|
402
420
|
}
|
|
403
421
|
|
|
422
|
+
static createBulkInventoryJob() {
|
|
423
|
+
return Joi.object({
|
|
424
|
+
body: CatalogModel.BulkJob().required(),
|
|
425
|
+
}).required();
|
|
426
|
+
}
|
|
427
|
+
|
|
404
428
|
static getInventoryBulkUploadHistory() {
|
|
405
429
|
return Joi.object({
|
|
406
430
|
pageNo: Joi.number(),
|
|
@@ -408,9 +432,10 @@ class CatalogValidator {
|
|
|
408
432
|
}).required();
|
|
409
433
|
}
|
|
410
434
|
|
|
411
|
-
static
|
|
435
|
+
static createBulkInventory() {
|
|
412
436
|
return Joi.object({
|
|
413
|
-
|
|
437
|
+
batchId: Joi.string().allow("").required(),
|
|
438
|
+
body: CatalogModel.InventoryBulkRequest().required(),
|
|
414
439
|
}).required();
|
|
415
440
|
}
|
|
416
441
|
|
|
@@ -420,10 +445,9 @@ class CatalogValidator {
|
|
|
420
445
|
}).required();
|
|
421
446
|
}
|
|
422
447
|
|
|
423
|
-
static
|
|
448
|
+
static createInventoryExportJob() {
|
|
424
449
|
return Joi.object({
|
|
425
|
-
|
|
426
|
-
body: CatalogModel.InventoryBulkRequest().required(),
|
|
450
|
+
body: CatalogModel.InventoryExportRequest().required(),
|
|
427
451
|
}).required();
|
|
428
452
|
}
|
|
429
453
|
|
|
@@ -431,9 +455,18 @@ class CatalogValidator {
|
|
|
431
455
|
return Joi.object({}).required();
|
|
432
456
|
}
|
|
433
457
|
|
|
434
|
-
static
|
|
458
|
+
static createInventoryExport() {
|
|
435
459
|
return Joi.object({
|
|
436
|
-
body: CatalogModel.
|
|
460
|
+
body: CatalogModel.InventoryCreateRequest().required(),
|
|
461
|
+
}).required();
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
static listInventoryExport() {
|
|
465
|
+
return Joi.object({
|
|
466
|
+
status: Joi.string().allow(""),
|
|
467
|
+
fromDate: Joi.string().allow(""),
|
|
468
|
+
toDate: Joi.string().allow(""),
|
|
469
|
+
q: Joi.string().allow(""),
|
|
437
470
|
}).required();
|
|
438
471
|
}
|
|
439
472
|
|
|
@@ -443,7 +476,7 @@ class CatalogValidator {
|
|
|
443
476
|
}).required();
|
|
444
477
|
}
|
|
445
478
|
|
|
446
|
-
static
|
|
479
|
+
static updateRealtimeInventory() {
|
|
447
480
|
return Joi.object({
|
|
448
481
|
itemId: Joi.number().required(),
|
|
449
482
|
sellerIdentifier: Joi.string().allow("").required(),
|
|
@@ -451,7 +484,7 @@ class CatalogValidator {
|
|
|
451
484
|
}).required();
|
|
452
485
|
}
|
|
453
486
|
|
|
454
|
-
static
|
|
487
|
+
static deleteRealtimeInventory() {
|
|
455
488
|
return Joi.object({
|
|
456
489
|
itemId: Joi.number().required(),
|
|
457
490
|
sellerIdentifier: Joi.string().allow("").required(),
|
|
@@ -465,17 +498,9 @@ class CatalogValidator {
|
|
|
465
498
|
}).required();
|
|
466
499
|
}
|
|
467
500
|
|
|
468
|
-
static
|
|
469
|
-
return Joi.object({
|
|
470
|
-
pageNo: Joi.number(),
|
|
471
|
-
pageSize: Joi.number(),
|
|
472
|
-
q: Joi.string().allow(""),
|
|
473
|
-
}).required();
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
static createHsnCode() {
|
|
501
|
+
static getHsnCode() {
|
|
477
502
|
return Joi.object({
|
|
478
|
-
|
|
503
|
+
id: Joi.string().allow("").required(),
|
|
479
504
|
}).required();
|
|
480
505
|
}
|
|
481
506
|
|
|
@@ -486,12 +511,6 @@ class CatalogValidator {
|
|
|
486
511
|
}).required();
|
|
487
512
|
}
|
|
488
513
|
|
|
489
|
-
static getHsnCode() {
|
|
490
|
-
return Joi.object({
|
|
491
|
-
id: Joi.string().allow("").required(),
|
|
492
|
-
}).required();
|
|
493
|
-
}
|
|
494
|
-
|
|
495
514
|
static bulkHsnCode() {
|
|
496
515
|
return Joi.object({
|
|
497
516
|
body: CatalogModel.BulkHsnUpsert().required(),
|
|
@@ -6,13 +6,14 @@ declare class Common {
|
|
|
6
6
|
* @param {Object} arg - Arg object.
|
|
7
7
|
* @param {string} [arg.authorization] -
|
|
8
8
|
* @param {string} [arg.query] - Provide application name
|
|
9
|
+
* @returns {Promise<ApplicationResponse>} - Success response
|
|
9
10
|
* @summary: Search Application
|
|
10
11
|
* @description: Provide application name or domain url
|
|
11
12
|
*/
|
|
12
13
|
searchApplication({ authorization, query }?: {
|
|
13
14
|
authorization?: string;
|
|
14
15
|
query?: string;
|
|
15
|
-
}): Promise<
|
|
16
|
+
}): Promise<ApplicationResponse>;
|
|
16
17
|
/**
|
|
17
18
|
* @param {Object} arg - Arg object.
|
|
18
19
|
* @param {string} [arg.locationType] - Provide location type to query on.
|
|
@@ -20,11 +21,12 @@ declare class Common {
|
|
|
20
21
|
* @param {string} [arg.id] - Field is optional when location_type is
|
|
21
22
|
* country. If querying for state, provide id of country. If querying for
|
|
22
23
|
* city, provide id of state.
|
|
24
|
+
* @returns {Promise<Locations>} - Success response
|
|
23
25
|
* @summary: Get countries, states, cities
|
|
24
26
|
* @description:
|
|
25
27
|
*/
|
|
26
28
|
getLocations({ locationType, id }?: {
|
|
27
29
|
locationType?: string;
|
|
28
30
|
id?: string;
|
|
29
|
-
}): Promise<
|
|
31
|
+
}): Promise<Locations>;
|
|
30
32
|
}
|
|
@@ -2,6 +2,9 @@ const Paginator = require("../../common/Paginator");
|
|
|
2
2
|
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
3
3
|
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
4
4
|
const CommonValidator = require("./CommonPlatformValidator");
|
|
5
|
+
const CommonModel = require("./CommonPlatformModel");
|
|
6
|
+
const { Logger } = require("./../../common/Logger");
|
|
7
|
+
|
|
5
8
|
class Common {
|
|
6
9
|
constructor(config) {
|
|
7
10
|
this.config = config;
|
|
@@ -11,10 +14,11 @@ class Common {
|
|
|
11
14
|
* @param {Object} arg - Arg object.
|
|
12
15
|
* @param {string} [arg.authorization] -
|
|
13
16
|
* @param {string} [arg.query] - Provide application name
|
|
17
|
+
* @returns {Promise<ApplicationResponse>} - Success response
|
|
14
18
|
* @summary: Search Application
|
|
15
19
|
* @description: Provide application name or domain url
|
|
16
20
|
*/
|
|
17
|
-
searchApplication({ authorization, query } = {}) {
|
|
21
|
+
async searchApplication({ authorization, query } = {}) {
|
|
18
22
|
const { error } = CommonValidator.searchApplication().validate(
|
|
19
23
|
{
|
|
20
24
|
authorization,
|
|
@@ -26,13 +30,29 @@ class Common {
|
|
|
26
30
|
return Promise.reject(new FDKClientValidationError(error));
|
|
27
31
|
}
|
|
28
32
|
|
|
33
|
+
// Showing warrnings if extra unknown parameters are found
|
|
34
|
+
const { error: warrning } = CommonValidator.searchApplication().validate(
|
|
35
|
+
{
|
|
36
|
+
authorization,
|
|
37
|
+
query,
|
|
38
|
+
},
|
|
39
|
+
{ abortEarly: false, allowUnknown: false }
|
|
40
|
+
);
|
|
41
|
+
if (warrning) {
|
|
42
|
+
Logger({
|
|
43
|
+
level: "WARN",
|
|
44
|
+
message: "Parameter Validation warrnings for searchApplication",
|
|
45
|
+
});
|
|
46
|
+
Logger({ level: "WARN", message: warrning });
|
|
47
|
+
}
|
|
48
|
+
|
|
29
49
|
const query_params = {};
|
|
30
50
|
query_params["query"] = query;
|
|
31
51
|
|
|
32
52
|
const xHeaders = {};
|
|
33
53
|
xHeaders["authorization"] = authorization;
|
|
34
54
|
|
|
35
|
-
|
|
55
|
+
const response = await PlatformAPIClient.execute(
|
|
36
56
|
this.config,
|
|
37
57
|
"get",
|
|
38
58
|
`/service/common/configuration/v1.0/application/search-application`,
|
|
@@ -40,6 +60,23 @@ class Common {
|
|
|
40
60
|
undefined,
|
|
41
61
|
xHeaders
|
|
42
62
|
);
|
|
63
|
+
|
|
64
|
+
const {
|
|
65
|
+
error: res_error,
|
|
66
|
+
} = CommonModel.ApplicationResponse().validate(response, {
|
|
67
|
+
abortEarly: false,
|
|
68
|
+
allowUnknown: false,
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
if (res_error) {
|
|
72
|
+
Logger({
|
|
73
|
+
level: "WARN",
|
|
74
|
+
message: "Response Validation Warnnings for searchApplication",
|
|
75
|
+
});
|
|
76
|
+
Logger({ level: "WARN", message: res_error });
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return response;
|
|
43
80
|
}
|
|
44
81
|
|
|
45
82
|
/**
|
|
@@ -49,10 +86,11 @@ class Common {
|
|
|
49
86
|
* @param {string} [arg.id] - Field is optional when location_type is
|
|
50
87
|
* country. If querying for state, provide id of country. If querying for
|
|
51
88
|
* city, provide id of state.
|
|
89
|
+
* @returns {Promise<Locations>} - Success response
|
|
52
90
|
* @summary: Get countries, states, cities
|
|
53
91
|
* @description:
|
|
54
92
|
*/
|
|
55
|
-
getLocations({ locationType, id } = {}) {
|
|
93
|
+
async getLocations({ locationType, id } = {}) {
|
|
56
94
|
const { error } = CommonValidator.getLocations().validate(
|
|
57
95
|
{
|
|
58
96
|
locationType,
|
|
@@ -64,13 +102,29 @@ class Common {
|
|
|
64
102
|
return Promise.reject(new FDKClientValidationError(error));
|
|
65
103
|
}
|
|
66
104
|
|
|
105
|
+
// Showing warrnings if extra unknown parameters are found
|
|
106
|
+
const { error: warrning } = CommonValidator.getLocations().validate(
|
|
107
|
+
{
|
|
108
|
+
locationType,
|
|
109
|
+
id,
|
|
110
|
+
},
|
|
111
|
+
{ abortEarly: false, allowUnknown: false }
|
|
112
|
+
);
|
|
113
|
+
if (warrning) {
|
|
114
|
+
Logger({
|
|
115
|
+
level: "WARN",
|
|
116
|
+
message: "Parameter Validation warrnings for getLocations",
|
|
117
|
+
});
|
|
118
|
+
Logger({ level: "WARN", message: warrning });
|
|
119
|
+
}
|
|
120
|
+
|
|
67
121
|
const query_params = {};
|
|
68
122
|
query_params["location_type"] = locationType;
|
|
69
123
|
query_params["id"] = id;
|
|
70
124
|
|
|
71
125
|
const xHeaders = {};
|
|
72
126
|
|
|
73
|
-
|
|
127
|
+
const response = await PlatformAPIClient.execute(
|
|
74
128
|
this.config,
|
|
75
129
|
"get",
|
|
76
130
|
`/service/common/configuration/v1.0/location`,
|
|
@@ -78,6 +132,21 @@ class Common {
|
|
|
78
132
|
undefined,
|
|
79
133
|
xHeaders
|
|
80
134
|
);
|
|
135
|
+
|
|
136
|
+
const { error: res_error } = CommonModel.Locations().validate(response, {
|
|
137
|
+
abortEarly: false,
|
|
138
|
+
allowUnknown: false,
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
if (res_error) {
|
|
142
|
+
Logger({
|
|
143
|
+
level: "WARN",
|
|
144
|
+
message: "Response Validation Warnnings for getLocations",
|
|
145
|
+
});
|
|
146
|
+
Logger({ level: "WARN", message: res_error });
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return response;
|
|
81
150
|
}
|
|
82
151
|
}
|
|
83
152
|
|