@gofynd/fdk-client-javascript 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -2
- package/index.d.ts +4 -4
- package/index.js +9 -10
- package/package.json +14 -14
- package/sdk/APIClient.d.ts +11 -0
- package/sdk/APIClient.js +35 -0
- package/sdk/Client.d.ts +6 -0
- package/sdk/Client.js +17 -0
- package/sdk/Config.d.ts +9 -0
- package/sdk/Config.js +17 -0
- package/sdk/application/Cart/CartApplicationClient.js +29 -28
- package/sdk/application/Cart/CartApplicationModel.js +3 -1
- package/sdk/application/Catalog/CatalogApplicationClient.js +43 -42
- package/sdk/application/Catalog/CatalogApplicationModel.js +1 -1
- package/sdk/application/Common/CommonApplicationClient.js +5 -4
- package/sdk/application/Communication/CommunicationApplicationClient.js +6 -5
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +21 -20
- package/sdk/application/Content/ContentApplicationClient.js +26 -25
- package/sdk/application/Content/ContentApplicationModel.js +1 -0
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +6 -5
- package/sdk/application/Lead/LeadApplicationClient.js +10 -9
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +1 -3
- package/sdk/application/Logistic/LogisticApplicationClient.js +11 -12
- package/sdk/application/Logistic/LogisticApplicationValidator.js +0 -1
- package/sdk/application/Order/OrderApplicationClient.js +15 -14
- package/sdk/application/Order/OrderApplicationModel.js +9 -0
- package/sdk/application/Payment/PaymentApplicationClient.js +42 -41
- package/sdk/application/PosCart/PosCartApplicationClient.js +30 -29
- package/sdk/application/PosCart/PosCartApplicationModel.js +3 -1
- package/sdk/application/Rewards/RewardsApplicationClient.js +11 -10
- package/sdk/application/Share/ShareApplicationClient.js +10 -9
- package/sdk/application/Theme/ThemeApplicationClient.js +7 -6
- package/sdk/application/User/UserApplicationClient.js +38 -37
- package/sdk/common/AxiosHelper.js +17 -6
- package/sdk/constructUrl.d.ts +5 -0
- package/sdk/constructUrl.js +13 -0
- package/sdk/index.d.ts +3 -0
- package/sdk/index.js +5 -0
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +3 -1
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +1 -1
- package/sdk/platform/Analytics/AnalyticsPlatformClient.js +5 -4
- package/sdk/platform/Analytics/AnalyticsPlatformValidator.js +1 -0
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +3 -2
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +1 -0
- package/sdk/platform/Billing/BillingPlatformClient.js +3 -2
- package/sdk/platform/Billing/BillingPlatformValidator.js +1 -0
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +27 -0
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +177 -1
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +3 -0
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +17 -1
- package/sdk/platform/Cart/CartPlatformModel.js +7 -3
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +3 -1
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +1 -1
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +2 -2
- package/sdk/platform/Catalog/CatalogPlatformClient.js +6 -9
- package/sdk/platform/Catalog/CatalogPlatformModel.js +7 -7
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +2 -1
- package/sdk/platform/Common/CommonPlatformClient.js +7 -18
- package/sdk/platform/Common/CommonPlatformValidator.js +1 -0
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +3 -1
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +1 -1
- package/sdk/platform/Communication/CommunicationPlatformClient.js +4 -3
- package/sdk/platform/Communication/CommunicationPlatformValidator.js +1 -0
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +5 -4
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +1 -0
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +3 -1
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +1 -1
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +9 -8
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +1 -0
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +0 -10
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +3 -62
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +0 -1
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +1 -7
- package/sdk/platform/Content/ContentPlatformModel.js +1 -0
- package/sdk/platform/Discount/DiscountPlatformClient.js +3 -2
- package/sdk/platform/Discount/DiscountPlatformValidator.js +1 -0
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +3 -3
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +27 -5
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +1 -1
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +3 -3
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +28 -6
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +1 -0
- package/sdk/platform/Inventory/InventoryPlatformClient.js +3 -2
- package/sdk/platform/Inventory/InventoryPlatformValidator.js +1 -0
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +3 -1
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +1 -1
- package/sdk/platform/Lead/LeadPlatformClient.js +4 -3
- package/sdk/platform/Lead/LeadPlatformValidator.js +1 -0
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +3 -1
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +1 -1
- package/sdk/platform/Order/OrderPlatformClient.d.ts +1 -1
- package/sdk/platform/Order/OrderPlatformClient.js +16 -3
- package/sdk/platform/Order/OrderPlatformModel.js +1 -0
- package/sdk/platform/Order/OrderPlatformValidator.js +1 -0
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +3 -1
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +1 -1
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +1 -1
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +14 -14
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +1 -1
- package/sdk/platform/Payment/PaymentPlatformClient.js +3 -2
- package/sdk/platform/Payment/PaymentPlatformValidator.js +1 -0
- package/sdk/platform/PlatformClient.d.ts +13 -9
- package/sdk/platform/PlatformClient.js +13 -9
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +4 -4
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +36 -17
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +1 -1
- package/sdk/platform/Share/SharePlatformApplicationClient.js +3 -1
- package/sdk/platform/Share/SharePlatformApplicationValidator.js +1 -1
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +3 -1
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +1 -1
- package/sdk/platform/User/UserPlatformApplicationClient.js +3 -1
- package/sdk/platform/User/UserPlatformApplicationValidator.js +1 -1
- package/sdk/platform/Webhook/WebhookPlatformClient.js +3 -2
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +1 -0
- package/sdk/public/Configuration/ConfigurationPublicClient.js +2 -0
- package/sdk/public/Inventory/InventoryPublicClient.js +2 -0
- package/sdk/public/Webhook/WebhookPublicClient.js +2 -0
- package/.github/workflows/on_create_release.yml +0 -23
- package/.github/workflows/on_merge_main.yml +0 -38
- package/.github/workflows/on_pull_request.yml +0 -35
- package/.prettierrc +0 -5
- package/documentation/application/CART.md +0 -8771
- package/documentation/application/CATALOG.md +0 -8690
- package/documentation/application/COMMON.md +0 -325
- package/documentation/application/COMMUNICATION.md +0 -387
- package/documentation/application/CONFIGURATION.md +0 -2212
- package/documentation/application/CONTENT.md +0 -2629
- package/documentation/application/FILESTORAGE.md +0 -442
- package/documentation/application/LEAD.md +0 -1549
- package/documentation/application/LOGISTIC.md +0 -689
- package/documentation/application/ORDER.md +0 -2937
- package/documentation/application/PAYMENT.md +0 -4475
- package/documentation/application/POSCART.md +0 -9375
- package/documentation/application/README.md +0 -21
- package/documentation/application/REWARDS.md +0 -554
- package/documentation/application/SHARE.md +0 -635
- package/documentation/application/THEME.md +0 -5517
- package/documentation/application/USER.md +0 -3798
- package/documentation/platform/ANALYTICS.md +0 -1012
- package/documentation/platform/AUDITTRAIL.md +0 -493
- package/documentation/platform/BILLING.md +0 -1889
- package/documentation/platform/CART.md +0 -4711
- package/documentation/platform/CATALOG.md +0 -20522
- package/documentation/platform/COMMON.md +0 -325
- package/documentation/platform/COMMUNICATION.md +0 -4970
- package/documentation/platform/COMPANYPROFILE.md +0 -1646
- package/documentation/platform/CONFIGURATION.md +0 -6316
- package/documentation/platform/CONTENT.md +0 -8364
- package/documentation/platform/DISCOUNT.md +0 -767
- package/documentation/platform/FILESTORAGE.md +0 -945
- package/documentation/platform/INVENTORY.md +0 -1136
- package/documentation/platform/LEAD.md +0 -4394
- package/documentation/platform/ORDER.md +0 -6525
- package/documentation/platform/PARTNER.md +0 -193
- package/documentation/platform/PAYMENT.md +0 -3138
- package/documentation/platform/README.md +0 -27
- package/documentation/platform/REWARDS.md +0 -919
- package/documentation/platform/SHARE.md +0 -513
- package/documentation/platform/THEME.md +0 -35446
- package/documentation/platform/USER.md +0 -2174
- package/documentation/platform/WEBHOOK.md +0 -485
- package/documentation/public/CONFIGURATION.md +0 -325
- package/documentation/public/INVENTORY.md +0 -508
- package/documentation/public/WEBHOOK.md +0 -246
- package/jest.config.d.ts +0 -4
- package/jest.config.js +0 -6
- package/tests/application/catalog.spec.js +0 -54
- package/tests/common/action-url.spec.js +0 -35
- package/tests/common/schema/action-url.json +0 -178
- package/tests/common/schema/url-action.json +0 -683
- package/tests/common/url-action.spec.js +0 -48
- package/tests/helpers/cookie.helper.js +0 -31
- package/tests/helpers/oauth.helper.js +0 -43
- package/tests/platform/catalog.spec.js +0 -49
- package/tests/public/location.spec.js +0 -39
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
const Paginator = require("../../common/Paginator");
|
|
2
|
-
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
3
1
|
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
2
|
+
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
3
|
+
const Paginator = require("../../common/Paginator");
|
|
4
4
|
const OrderValidator = require("./OrderPlatformValidator");
|
|
5
5
|
const OrderModel = require("./OrderPlatformModel");
|
|
6
6
|
const { Logger } = require("./../../common/Logger");
|
|
7
|
+
const Joi = require("joi");
|
|
7
8
|
|
|
8
9
|
class Order {
|
|
9
10
|
constructor(config) {
|
|
@@ -215,12 +216,20 @@ class Order {
|
|
|
215
216
|
* @summary:
|
|
216
217
|
* @description:
|
|
217
218
|
*/
|
|
218
|
-
async click2Call({
|
|
219
|
+
async click2Call({
|
|
220
|
+
caller,
|
|
221
|
+
receiver,
|
|
222
|
+
bagId,
|
|
223
|
+
|
|
224
|
+
callingTo,
|
|
225
|
+
callerId,
|
|
226
|
+
} = {}) {
|
|
219
227
|
const { error } = OrderValidator.click2Call().validate(
|
|
220
228
|
{
|
|
221
229
|
caller,
|
|
222
230
|
receiver,
|
|
223
231
|
bagId,
|
|
232
|
+
|
|
224
233
|
callingTo,
|
|
225
234
|
callerId,
|
|
226
235
|
},
|
|
@@ -236,6 +245,7 @@ class Order {
|
|
|
236
245
|
caller,
|
|
237
246
|
receiver,
|
|
238
247
|
bagId,
|
|
248
|
+
|
|
239
249
|
callingTo,
|
|
240
250
|
callerId,
|
|
241
251
|
},
|
|
@@ -2831,6 +2841,7 @@ class Order {
|
|
|
2831
2841
|
async updateAddress({
|
|
2832
2842
|
shipmentId,
|
|
2833
2843
|
addressCategory,
|
|
2844
|
+
|
|
2834
2845
|
name,
|
|
2835
2846
|
address,
|
|
2836
2847
|
addressType,
|
|
@@ -2846,6 +2857,7 @@ class Order {
|
|
|
2846
2857
|
{
|
|
2847
2858
|
shipmentId,
|
|
2848
2859
|
addressCategory,
|
|
2860
|
+
|
|
2849
2861
|
name,
|
|
2850
2862
|
address,
|
|
2851
2863
|
addressType,
|
|
@@ -2868,6 +2880,7 @@ class Order {
|
|
|
2868
2880
|
{
|
|
2869
2881
|
shipmentId,
|
|
2870
2882
|
addressCategory,
|
|
2883
|
+
|
|
2871
2884
|
name,
|
|
2872
2885
|
address,
|
|
2873
2886
|
addressType,
|
|
@@ -136,6 +136,7 @@ class OrderModel {
|
|
|
136
136
|
employee_discount: Joi.number(),
|
|
137
137
|
is_priority: Joi.boolean(),
|
|
138
138
|
loyalty_discount: Joi.number(),
|
|
139
|
+
marketplace_invoice_id: Joi.string().allow("").allow(null),
|
|
139
140
|
order_item_id: Joi.string().allow(""),
|
|
140
141
|
quantity: Joi.number(),
|
|
141
142
|
size_level_total_qty: Joi.number().allow(null),
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
const Paginator = require("../../common/Paginator");
|
|
2
1
|
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
3
2
|
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
3
|
+
const Paginator = require("../../common/Paginator");
|
|
4
4
|
const PartnerValidator = require("./PartnerPlatformApplicationValidator");
|
|
5
5
|
const PartnerModel = require("./PartnerPlatformModel");
|
|
6
6
|
const { Logger } = require("./../../common/Logger");
|
|
7
|
+
const Joi = require("joi");
|
|
7
8
|
|
|
8
9
|
class Partner {
|
|
9
10
|
constructor(config, applicationId) {
|
|
@@ -141,4 +142,5 @@ class Partner {
|
|
|
141
142
|
return response;
|
|
142
143
|
}
|
|
143
144
|
}
|
|
145
|
+
|
|
144
146
|
module.exports = Partner;
|
|
@@ -31,7 +31,7 @@ declare class Payment {
|
|
|
31
31
|
* @summary: Get bank details
|
|
32
32
|
* @description: Use this API to get saved bank details for returned/cancelled order using order id.
|
|
33
33
|
*/
|
|
34
|
-
getBankAccountDetailsOpenAPI({ orderId, requestHash }?: {
|
|
34
|
+
getBankAccountDetailsOpenAPI({ orderId, requestHash, }?: {
|
|
35
35
|
orderId: string;
|
|
36
36
|
requestHash?: string;
|
|
37
37
|
}): Promise<RefundAccountResponse>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
const Paginator = require("../../common/Paginator");
|
|
2
1
|
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
3
2
|
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
3
|
+
const Paginator = require("../../common/Paginator");
|
|
4
4
|
const PaymentValidator = require("./PaymentPlatformApplicationValidator");
|
|
5
5
|
const PaymentModel = require("./PaymentPlatformModel");
|
|
6
6
|
const { Logger } = require("./../../common/Logger");
|
|
7
|
+
const Joi = require("joi");
|
|
7
8
|
|
|
8
9
|
class Payment {
|
|
9
10
|
constructor(config, applicationId) {
|
|
@@ -145,10 +146,15 @@ class Payment {
|
|
|
145
146
|
* @summary: Get bank details
|
|
146
147
|
* @description: Use this API to get saved bank details for returned/cancelled order using order id.
|
|
147
148
|
*/
|
|
148
|
-
async getBankAccountDetailsOpenAPI({
|
|
149
|
+
async getBankAccountDetailsOpenAPI({
|
|
150
|
+
orderId,
|
|
151
|
+
|
|
152
|
+
requestHash,
|
|
153
|
+
} = {}) {
|
|
149
154
|
const { error } = PaymentValidator.getBankAccountDetailsOpenAPI().validate(
|
|
150
155
|
{
|
|
151
156
|
orderId,
|
|
157
|
+
|
|
152
158
|
requestHash,
|
|
153
159
|
},
|
|
154
160
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -163,6 +169,7 @@ class Payment {
|
|
|
163
169
|
} = PaymentValidator.getBankAccountDetailsOpenAPI().validate(
|
|
164
170
|
{
|
|
165
171
|
orderId,
|
|
172
|
+
|
|
166
173
|
requestHash,
|
|
167
174
|
},
|
|
168
175
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -344,9 +351,7 @@ class Payment {
|
|
|
344
351
|
*/
|
|
345
352
|
async getUserBeneficiaries({ orderId } = {}) {
|
|
346
353
|
const { error } = PaymentValidator.getUserBeneficiaries().validate(
|
|
347
|
-
{
|
|
348
|
-
orderId,
|
|
349
|
-
},
|
|
354
|
+
{ orderId },
|
|
350
355
|
{ abortEarly: false, allowUnknown: true }
|
|
351
356
|
);
|
|
352
357
|
if (error) {
|
|
@@ -357,9 +362,7 @@ class Payment {
|
|
|
357
362
|
const {
|
|
358
363
|
error: warrning,
|
|
359
364
|
} = PaymentValidator.getUserBeneficiaries().validate(
|
|
360
|
-
{
|
|
361
|
-
orderId,
|
|
362
|
-
},
|
|
365
|
+
{ orderId },
|
|
363
366
|
{ abortEarly: false, allowUnknown: false }
|
|
364
367
|
);
|
|
365
368
|
if (warrning) {
|
|
@@ -476,9 +479,7 @@ class Payment {
|
|
|
476
479
|
*/
|
|
477
480
|
async getUserOrderBeneficiaries({ orderId } = {}) {
|
|
478
481
|
const { error } = PaymentValidator.getUserOrderBeneficiaries().validate(
|
|
479
|
-
{
|
|
480
|
-
orderId,
|
|
481
|
-
},
|
|
482
|
+
{ orderId },
|
|
482
483
|
{ abortEarly: false, allowUnknown: true }
|
|
483
484
|
);
|
|
484
485
|
if (error) {
|
|
@@ -489,9 +490,7 @@ class Payment {
|
|
|
489
490
|
const {
|
|
490
491
|
error: warrning,
|
|
491
492
|
} = PaymentValidator.getUserOrderBeneficiaries().validate(
|
|
492
|
-
{
|
|
493
|
-
orderId,
|
|
494
|
-
},
|
|
493
|
+
{ orderId },
|
|
495
494
|
{ abortEarly: false, allowUnknown: false }
|
|
496
495
|
);
|
|
497
496
|
if (warrning) {
|
|
@@ -726,4 +725,5 @@ class Payment {
|
|
|
726
725
|
return response;
|
|
727
726
|
}
|
|
728
727
|
}
|
|
728
|
+
|
|
729
729
|
module.exports = Payment;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
const Paginator = require("../../common/Paginator");
|
|
2
|
-
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
3
1
|
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
2
|
+
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
3
|
+
const Paginator = require("../../common/Paginator");
|
|
4
4
|
const PaymentValidator = require("./PaymentPlatformValidator");
|
|
5
5
|
const PaymentModel = require("./PaymentPlatformModel");
|
|
6
6
|
const { Logger } = require("./../../common/Logger");
|
|
7
|
+
const Joi = require("joi");
|
|
7
8
|
|
|
8
9
|
class Payment {
|
|
9
10
|
constructor(config) {
|
|
@@ -1443,6 +1443,7 @@ type DefaultNavigationResponse = {
|
|
|
1443
1443
|
};
|
|
1444
1444
|
type Detail = {
|
|
1445
1445
|
description?: string;
|
|
1446
|
+
image_url?: string;
|
|
1446
1447
|
title?: string;
|
|
1447
1448
|
};
|
|
1448
1449
|
type EditorMeta = {
|
|
@@ -3267,6 +3268,7 @@ type AffiliateMeta = {
|
|
|
3267
3268
|
employee_discount?: number;
|
|
3268
3269
|
is_priority?: boolean;
|
|
3269
3270
|
loyalty_discount?: number;
|
|
3271
|
+
marketplace_invoice_id?: string;
|
|
3270
3272
|
order_item_id?: string;
|
|
3271
3273
|
quantity?: number;
|
|
3272
3274
|
size_level_total_qty?: number;
|
|
@@ -5787,15 +5789,15 @@ type GetCompanySerializer = {
|
|
|
5787
5789
|
addresses?: GetAddressSerializer[];
|
|
5788
5790
|
business_type?: string;
|
|
5789
5791
|
company_type?: string;
|
|
5790
|
-
created_by?:
|
|
5792
|
+
created_by?: UserSerializer2;
|
|
5791
5793
|
created_on?: string;
|
|
5792
|
-
modified_by?:
|
|
5794
|
+
modified_by?: UserSerializer2;
|
|
5793
5795
|
modified_on?: string;
|
|
5794
5796
|
name?: string;
|
|
5795
5797
|
reject_reason?: string;
|
|
5796
5798
|
stage?: string;
|
|
5797
5799
|
uid?: number;
|
|
5798
|
-
verified_by?:
|
|
5800
|
+
verified_by?: UserSerializer2;
|
|
5799
5801
|
verified_on?: string;
|
|
5800
5802
|
};
|
|
5801
5803
|
type GetConfigMetadataResponse = {
|
|
@@ -5866,14 +5868,14 @@ type GetLocationSerializer = {
|
|
|
5866
5868
|
code: string;
|
|
5867
5869
|
company?: GetCompanySerializer;
|
|
5868
5870
|
contact_numbers?: SellerPhoneNumber[];
|
|
5869
|
-
created_by?:
|
|
5871
|
+
created_by?: UserSerializer1;
|
|
5870
5872
|
created_on?: string;
|
|
5871
5873
|
display_name: string;
|
|
5872
5874
|
documents?: Document[];
|
|
5873
5875
|
gst_credentials?: InvoiceDetailsSerializer;
|
|
5874
5876
|
integration_type?: LocationIntegrationType;
|
|
5875
5877
|
manager?: LocationManagerSerializer;
|
|
5876
|
-
modified_by?:
|
|
5878
|
+
modified_by?: UserSerializer1;
|
|
5877
5879
|
modified_on?: string;
|
|
5878
5880
|
name: string;
|
|
5879
5881
|
notification_emails?: string[];
|
|
@@ -5883,7 +5885,7 @@ type GetLocationSerializer = {
|
|
|
5883
5885
|
store_type?: string;
|
|
5884
5886
|
timing?: LocationDayWiseSerializer[];
|
|
5885
5887
|
uid?: number;
|
|
5886
|
-
verified_by?:
|
|
5888
|
+
verified_by?: UserSerializer1;
|
|
5887
5889
|
verified_on?: string;
|
|
5888
5890
|
warnings?: any;
|
|
5889
5891
|
};
|
|
@@ -9289,7 +9291,7 @@ type AddProductCart = {
|
|
|
9289
9291
|
extra_meta?: any;
|
|
9290
9292
|
item_id?: number;
|
|
9291
9293
|
item_size?: string;
|
|
9292
|
-
parent_item_identifiers?: any;
|
|
9294
|
+
parent_item_identifiers?: any[];
|
|
9293
9295
|
pos?: boolean;
|
|
9294
9296
|
product_group_tags?: string[];
|
|
9295
9297
|
quantity?: number;
|
|
@@ -9540,7 +9542,7 @@ type LoyaltyPoints = {
|
|
|
9540
9542
|
total?: number;
|
|
9541
9543
|
};
|
|
9542
9544
|
type OpenapiCartDetailsRequest = {
|
|
9543
|
-
cart_items
|
|
9545
|
+
cart_items: CartItem[];
|
|
9544
9546
|
};
|
|
9545
9547
|
type OpenapiCartDetailsResponse = {
|
|
9546
9548
|
breakup_values?: CartBreakup;
|
|
@@ -9549,7 +9551,7 @@ type OpenapiCartDetailsResponse = {
|
|
|
9549
9551
|
message?: string;
|
|
9550
9552
|
};
|
|
9551
9553
|
type OpenApiCartServiceabilityRequest = {
|
|
9552
|
-
cart_items
|
|
9554
|
+
cart_items: CartItem[];
|
|
9553
9555
|
shipping_address: ShippingAddress;
|
|
9554
9556
|
};
|
|
9555
9557
|
type OpenApiCartServiceabilityResponse = {
|
|
@@ -9882,6 +9884,8 @@ type ShippingAddress = {
|
|
|
9882
9884
|
city?: string;
|
|
9883
9885
|
country?: string;
|
|
9884
9886
|
country_code?: string;
|
|
9887
|
+
country_iso_code?: string;
|
|
9888
|
+
country_phone_code?: string;
|
|
9885
9889
|
email?: string;
|
|
9886
9890
|
landmark?: string;
|
|
9887
9891
|
meta?: any;
|
|
@@ -1789,6 +1789,7 @@ class PlatformClient {
|
|
|
1789
1789
|
/**
|
|
1790
1790
|
* @typedef Detail
|
|
1791
1791
|
* @property {string} [description]
|
|
1792
|
+
* @property {string} [image_url]
|
|
1792
1793
|
* @property {string} [title]
|
|
1793
1794
|
*/
|
|
1794
1795
|
/**
|
|
@@ -3929,6 +3930,7 @@ class PlatformClient {
|
|
|
3929
3930
|
* @property {number} [employee_discount]
|
|
3930
3931
|
* @property {boolean} [is_priority]
|
|
3931
3932
|
* @property {number} [loyalty_discount]
|
|
3933
|
+
* @property {string} [marketplace_invoice_id]
|
|
3932
3934
|
* @property {string} [order_item_id]
|
|
3933
3935
|
* @property {number} [quantity]
|
|
3934
3936
|
* @property {number} [size_level_total_qty]
|
|
@@ -6839,15 +6841,15 @@ class PlatformClient {
|
|
|
6839
6841
|
* @property {GetAddressSerializer[]} [addresses]
|
|
6840
6842
|
* @property {string} [business_type]
|
|
6841
6843
|
* @property {string} [company_type]
|
|
6842
|
-
* @property {
|
|
6844
|
+
* @property {UserSerializer2} [created_by]
|
|
6843
6845
|
* @property {string} [created_on]
|
|
6844
|
-
* @property {
|
|
6846
|
+
* @property {UserSerializer2} [modified_by]
|
|
6845
6847
|
* @property {string} [modified_on]
|
|
6846
6848
|
* @property {string} [name]
|
|
6847
6849
|
* @property {string} [reject_reason]
|
|
6848
6850
|
* @property {string} [stage]
|
|
6849
6851
|
* @property {number} [uid]
|
|
6850
|
-
* @property {
|
|
6852
|
+
* @property {UserSerializer2} [verified_by]
|
|
6851
6853
|
* @property {string} [verified_on]
|
|
6852
6854
|
*/
|
|
6853
6855
|
/**
|
|
@@ -6924,14 +6926,14 @@ class PlatformClient {
|
|
|
6924
6926
|
* @property {string} code
|
|
6925
6927
|
* @property {GetCompanySerializer} [company]
|
|
6926
6928
|
* @property {SellerPhoneNumber[]} [contact_numbers]
|
|
6927
|
-
* @property {
|
|
6929
|
+
* @property {UserSerializer1} [created_by]
|
|
6928
6930
|
* @property {string} [created_on]
|
|
6929
6931
|
* @property {string} display_name
|
|
6930
6932
|
* @property {Document[]} [documents]
|
|
6931
6933
|
* @property {InvoiceDetailsSerializer} [gst_credentials]
|
|
6932
6934
|
* @property {LocationIntegrationType} [integration_type]
|
|
6933
6935
|
* @property {LocationManagerSerializer} [manager]
|
|
6934
|
-
* @property {
|
|
6936
|
+
* @property {UserSerializer1} [modified_by]
|
|
6935
6937
|
* @property {string} [modified_on]
|
|
6936
6938
|
* @property {string} name
|
|
6937
6939
|
* @property {string[]} [notification_emails]
|
|
@@ -6941,7 +6943,7 @@ class PlatformClient {
|
|
|
6941
6943
|
* @property {string} [store_type]
|
|
6942
6944
|
* @property {LocationDayWiseSerializer[]} [timing]
|
|
6943
6945
|
* @property {number} [uid]
|
|
6944
|
-
* @property {
|
|
6946
|
+
* @property {UserSerializer1} [verified_by]
|
|
6945
6947
|
* @property {string} [verified_on]
|
|
6946
6948
|
* @property {Object} [warnings]
|
|
6947
6949
|
*/
|
|
@@ -11116,7 +11118,7 @@ class PlatformClient {
|
|
|
11116
11118
|
* @property {Object} [extra_meta]
|
|
11117
11119
|
* @property {number} [item_id]
|
|
11118
11120
|
* @property {string} [item_size]
|
|
11119
|
-
* @property {Object} [parent_item_identifiers]
|
|
11121
|
+
* @property {Object[]} [parent_item_identifiers]
|
|
11120
11122
|
* @property {boolean} [pos]
|
|
11121
11123
|
* @property {string[]} [product_group_tags]
|
|
11122
11124
|
* @property {number} [quantity]
|
|
@@ -11427,7 +11429,7 @@ class PlatformClient {
|
|
|
11427
11429
|
*/
|
|
11428
11430
|
/**
|
|
11429
11431
|
* @typedef OpenapiCartDetailsRequest
|
|
11430
|
-
* @property {CartItem}
|
|
11432
|
+
* @property {CartItem[]} cart_items
|
|
11431
11433
|
*/
|
|
11432
11434
|
/**
|
|
11433
11435
|
* @typedef OpenapiCartDetailsResponse
|
|
@@ -11438,7 +11440,7 @@ class PlatformClient {
|
|
|
11438
11440
|
*/
|
|
11439
11441
|
/**
|
|
11440
11442
|
* @typedef OpenApiCartServiceabilityRequest
|
|
11441
|
-
* @property {CartItem}
|
|
11443
|
+
* @property {CartItem[]} cart_items
|
|
11442
11444
|
* @property {ShippingAddress} shipping_address
|
|
11443
11445
|
*/
|
|
11444
11446
|
/**
|
|
@@ -11830,6 +11832,8 @@ class PlatformClient {
|
|
|
11830
11832
|
* @property {string} [city]
|
|
11831
11833
|
* @property {string} [country]
|
|
11832
11834
|
* @property {string} [country_code]
|
|
11835
|
+
* @property {string} [country_iso_code]
|
|
11836
|
+
* @property {string} [country_phone_code]
|
|
11833
11837
|
* @property {string} [email]
|
|
11834
11838
|
* @property {string} [landmark]
|
|
11835
11839
|
* @property {Object} [meta]
|
|
@@ -33,7 +33,7 @@ declare class Rewards {
|
|
|
33
33
|
* @summary: Get offer by name
|
|
34
34
|
* @description: Use this API to get the offer details and configuration by entering the name of the offer.
|
|
35
35
|
*/
|
|
36
|
-
getOfferByName({ name, cookie }?: {
|
|
36
|
+
getOfferByName({ name, cookie, }?: {
|
|
37
37
|
name: string;
|
|
38
38
|
cookie: string;
|
|
39
39
|
}): Promise<Offer>;
|
|
@@ -54,7 +54,7 @@ declare class Rewards {
|
|
|
54
54
|
* @summary: Get all transactions of reward points
|
|
55
55
|
* @description: Use this API to get a list of points transactions.
|
|
56
56
|
*/
|
|
57
|
-
getUserPointsHistory({ userId, pageId, pageSize }?: {
|
|
57
|
+
getUserPointsHistory({ userId, pageId, pageSize, }?: {
|
|
58
58
|
userId: string;
|
|
59
59
|
pageId?: string;
|
|
60
60
|
pageSize?: number;
|
|
@@ -133,7 +133,7 @@ declare class Rewards {
|
|
|
133
133
|
* @summary: Update offer by name
|
|
134
134
|
* @description: Use this API to update the offer details
|
|
135
135
|
*/
|
|
136
|
-
updateOfferByName({ name, body }?: {
|
|
136
|
+
updateOfferByName({ name, body, }?: {
|
|
137
137
|
name: string;
|
|
138
138
|
body: Offer;
|
|
139
139
|
}): Promise<Offer>;
|
|
@@ -145,7 +145,7 @@ declare class Rewards {
|
|
|
145
145
|
* @summary: Update user status
|
|
146
146
|
* @description: Use this API to update the user status active/archive
|
|
147
147
|
*/
|
|
148
|
-
updateUserStatus({ userId, body }?: {
|
|
148
|
+
updateUserStatus({ userId, body, }?: {
|
|
149
149
|
userId: string;
|
|
150
150
|
body: AppUser;
|
|
151
151
|
}): Promise<AppUser>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
const Paginator = require("../../common/Paginator");
|
|
2
1
|
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
3
2
|
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
3
|
+
const Paginator = require("../../common/Paginator");
|
|
4
4
|
const RewardsValidator = require("./RewardsPlatformApplicationValidator");
|
|
5
5
|
const RewardsModel = require("./RewardsPlatformModel");
|
|
6
6
|
const { Logger } = require("./../../common/Logger");
|
|
7
|
+
const Joi = require("joi");
|
|
7
8
|
|
|
8
9
|
class Rewards {
|
|
9
10
|
constructor(config, applicationId) {
|
|
@@ -20,9 +21,7 @@ class Rewards {
|
|
|
20
21
|
*/
|
|
21
22
|
async getGiveawayAudienceStatus({ audienceId } = {}) {
|
|
22
23
|
const { error } = RewardsValidator.getGiveawayAudienceStatus().validate(
|
|
23
|
-
{
|
|
24
|
-
audienceId,
|
|
25
|
-
},
|
|
24
|
+
{ audienceId },
|
|
26
25
|
{ abortEarly: false, allowUnknown: true }
|
|
27
26
|
);
|
|
28
27
|
if (error) {
|
|
@@ -33,9 +32,7 @@ class Rewards {
|
|
|
33
32
|
const {
|
|
34
33
|
error: warrning,
|
|
35
34
|
} = RewardsValidator.getGiveawayAudienceStatus().validate(
|
|
36
|
-
{
|
|
37
|
-
audienceId,
|
|
38
|
-
},
|
|
35
|
+
{ audienceId },
|
|
39
36
|
{ abortEarly: false, allowUnknown: false }
|
|
40
37
|
);
|
|
41
38
|
if (warrning) {
|
|
@@ -143,10 +140,15 @@ class Rewards {
|
|
|
143
140
|
* @summary: Get offer by name
|
|
144
141
|
* @description: Use this API to get the offer details and configuration by entering the name of the offer.
|
|
145
142
|
*/
|
|
146
|
-
async getOfferByName({
|
|
143
|
+
async getOfferByName({
|
|
144
|
+
name,
|
|
145
|
+
|
|
146
|
+
cookie,
|
|
147
|
+
} = {}) {
|
|
147
148
|
const { error } = RewardsValidator.getOfferByName().validate(
|
|
148
149
|
{
|
|
149
150
|
name,
|
|
151
|
+
|
|
150
152
|
cookie,
|
|
151
153
|
},
|
|
152
154
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -159,6 +161,7 @@ class Rewards {
|
|
|
159
161
|
const { error: warrning } = RewardsValidator.getOfferByName().validate(
|
|
160
162
|
{
|
|
161
163
|
name,
|
|
164
|
+
|
|
162
165
|
cookie,
|
|
163
166
|
},
|
|
164
167
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -265,10 +268,16 @@ class Rewards {
|
|
|
265
268
|
* @summary: Get all transactions of reward points
|
|
266
269
|
* @description: Use this API to get a list of points transactions.
|
|
267
270
|
*/
|
|
268
|
-
async getUserPointsHistory({
|
|
271
|
+
async getUserPointsHistory({
|
|
272
|
+
userId,
|
|
273
|
+
|
|
274
|
+
pageId,
|
|
275
|
+
pageSize,
|
|
276
|
+
} = {}) {
|
|
269
277
|
const { error } = RewardsValidator.getUserPointsHistory().validate(
|
|
270
278
|
{
|
|
271
279
|
userId,
|
|
280
|
+
|
|
272
281
|
pageId,
|
|
273
282
|
pageSize,
|
|
274
283
|
},
|
|
@@ -284,6 +293,7 @@ class Rewards {
|
|
|
284
293
|
} = RewardsValidator.getUserPointsHistory().validate(
|
|
285
294
|
{
|
|
286
295
|
userId,
|
|
296
|
+
|
|
287
297
|
pageId,
|
|
288
298
|
pageSize,
|
|
289
299
|
},
|
|
@@ -673,10 +683,15 @@ class Rewards {
|
|
|
673
683
|
* @summary: Update offer by name
|
|
674
684
|
* @description: Use this API to update the offer details
|
|
675
685
|
*/
|
|
676
|
-
async updateOfferByName({
|
|
686
|
+
async updateOfferByName({
|
|
687
|
+
name,
|
|
688
|
+
|
|
689
|
+
body,
|
|
690
|
+
} = {}) {
|
|
677
691
|
const { error } = RewardsValidator.updateOfferByName().validate(
|
|
678
692
|
{
|
|
679
693
|
name,
|
|
694
|
+
|
|
680
695
|
body,
|
|
681
696
|
},
|
|
682
697
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -689,6 +704,7 @@ class Rewards {
|
|
|
689
704
|
const { error: warrning } = RewardsValidator.updateOfferByName().validate(
|
|
690
705
|
{
|
|
691
706
|
name,
|
|
707
|
+
|
|
692
708
|
body,
|
|
693
709
|
},
|
|
694
710
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -735,10 +751,15 @@ class Rewards {
|
|
|
735
751
|
* @summary: Update user status
|
|
736
752
|
* @description: Use this API to update the user status active/archive
|
|
737
753
|
*/
|
|
738
|
-
async updateUserStatus({
|
|
754
|
+
async updateUserStatus({
|
|
755
|
+
userId,
|
|
756
|
+
|
|
757
|
+
body,
|
|
758
|
+
} = {}) {
|
|
739
759
|
const { error } = RewardsValidator.updateUserStatus().validate(
|
|
740
760
|
{
|
|
741
761
|
userId,
|
|
762
|
+
|
|
742
763
|
body,
|
|
743
764
|
},
|
|
744
765
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -751,6 +772,7 @@ class Rewards {
|
|
|
751
772
|
const { error: warrning } = RewardsValidator.updateUserStatus().validate(
|
|
752
773
|
{
|
|
753
774
|
userId,
|
|
775
|
+
|
|
754
776
|
body,
|
|
755
777
|
},
|
|
756
778
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -798,9 +820,7 @@ class Rewards {
|
|
|
798
820
|
*/
|
|
799
821
|
async user({ userId } = {}) {
|
|
800
822
|
const { error } = RewardsValidator.user().validate(
|
|
801
|
-
{
|
|
802
|
-
userId,
|
|
803
|
-
},
|
|
823
|
+
{ userId },
|
|
804
824
|
{ abortEarly: false, allowUnknown: true }
|
|
805
825
|
);
|
|
806
826
|
if (error) {
|
|
@@ -809,9 +829,7 @@ class Rewards {
|
|
|
809
829
|
|
|
810
830
|
// Showing warrnings if extra unknown parameters are found
|
|
811
831
|
const { error: warrning } = RewardsValidator.user().validate(
|
|
812
|
-
{
|
|
813
|
-
userId,
|
|
814
|
-
},
|
|
832
|
+
{ userId },
|
|
815
833
|
{ abortEarly: false, allowUnknown: false }
|
|
816
834
|
);
|
|
817
835
|
if (warrning) {
|
|
@@ -848,4 +866,5 @@ class Rewards {
|
|
|
848
866
|
return response;
|
|
849
867
|
}
|
|
850
868
|
}
|
|
869
|
+
|
|
851
870
|
module.exports = Rewards;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
const Paginator = require("../../common/Paginator");
|
|
2
1
|
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
3
2
|
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
3
|
+
const Paginator = require("../../common/Paginator");
|
|
4
4
|
const ShareValidator = require("./SharePlatformApplicationValidator");
|
|
5
5
|
const ShareModel = require("./SharePlatformModel");
|
|
6
6
|
const { Logger } = require("./../../common/Logger");
|
|
7
|
+
const Joi = require("joi");
|
|
7
8
|
|
|
8
9
|
class Share {
|
|
9
10
|
constructor(config, applicationId) {
|
|
@@ -310,4 +311,5 @@ class Share {
|
|
|
310
311
|
return response;
|
|
311
312
|
}
|
|
312
313
|
}
|
|
314
|
+
|
|
313
315
|
module.exports = Share;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
const Paginator = require("../../common/Paginator");
|
|
2
1
|
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
3
2
|
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
3
|
+
const Paginator = require("../../common/Paginator");
|
|
4
4
|
const ThemeValidator = require("./ThemePlatformApplicationValidator");
|
|
5
5
|
const ThemeModel = require("./ThemePlatformModel");
|
|
6
6
|
const { Logger } = require("./../../common/Logger");
|
|
7
|
+
const Joi = require("joi");
|
|
7
8
|
|
|
8
9
|
class Theme {
|
|
9
10
|
constructor(config, applicationId) {
|
|
@@ -1469,4 +1470,5 @@ class Theme {
|
|
|
1469
1470
|
return response;
|
|
1470
1471
|
}
|
|
1471
1472
|
}
|
|
1473
|
+
|
|
1472
1474
|
module.exports = Theme;
|