@gofynd/fdk-client-javascript 1.0.3 → 1.1.0
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 +51 -2
- package/index.d.ts +7 -4
- package/index.js +22 -7
- package/package.json +23 -14
- package/partner.d.ts +4 -0
- package/partner.js +7 -0
- package/sdk/application/ApplicationAPIClient.js +2 -4
- 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 +5 -3
- 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/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/common/BaseOAuthClient.d.ts +17 -0
- package/sdk/common/BaseOAuthClient.js +67 -0
- package/sdk/common/RequestSigner.js +0 -5
- package/sdk/partner/OAuthClient.d.ts +14 -0
- package/sdk/partner/OAuthClient.js +112 -0
- package/sdk/partner/PartnerAPIClient.d.ts +12 -0
- package/sdk/partner/PartnerAPIClient.js +42 -0
- package/sdk/partner/PartnerClient.d.ts +6 -0
- package/sdk/partner/PartnerClient.js +17 -0
- package/sdk/partner/PartnerConfig.d.ts +30 -0
- package/sdk/partner/PartnerConfig.js +39 -0
- package/sdk/partner/index.d.ts +3 -0
- package/sdk/partner/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.d.ts +24 -0
- package/sdk/platform/Billing/BillingPlatformClient.js +137 -2
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +4 -0
- package/sdk/platform/Billing/BillingPlatformModel.js +44 -0
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +2 -0
- package/sdk/platform/Billing/BillingPlatformValidator.js +15 -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 +9 -9
- 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.js +3 -1
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +1 -1
- 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/OAuthClient.js +3 -9
- 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/PlatformApplicationClient.d.ts +5 -1
- package/sdk/platform/PlatformApplicationClient.js +4 -0
- package/sdk/platform/PlatformClient.d.ts +51 -12
- package/sdk/platform/PlatformClient.js +54 -11
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +17 -19
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +88 -83
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +8 -9
- 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,10 +1,11 @@
|
|
|
1
|
-
const
|
|
1
|
+
const ApplicationAPIClient = require("../ApplicationAPIClient");
|
|
2
|
+
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
2
3
|
const constructUrl = require("../constructUrl");
|
|
3
4
|
const Paginator = require("../../common/Paginator");
|
|
4
|
-
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
5
5
|
const ContentValidator = require("./ContentApplicationValidator");
|
|
6
6
|
const ContentModel = require("./ContentApplicationModel");
|
|
7
7
|
const { Logger } = require("./../../common/Logger");
|
|
8
|
+
const Joi = require("joi");
|
|
8
9
|
|
|
9
10
|
class Content {
|
|
10
11
|
constructor(_conf) {
|
|
@@ -80,7 +81,7 @@ class Content {
|
|
|
80
81
|
|
|
81
82
|
const xHeaders = {};
|
|
82
83
|
|
|
83
|
-
const response = await
|
|
84
|
+
const response = await ApplicationAPIClient.execute(
|
|
84
85
|
this._conf,
|
|
85
86
|
"get",
|
|
86
87
|
constructUrl({
|
|
@@ -147,7 +148,7 @@ class Content {
|
|
|
147
148
|
|
|
148
149
|
const xHeaders = {};
|
|
149
150
|
|
|
150
|
-
const response = await
|
|
151
|
+
const response = await ApplicationAPIClient.execute(
|
|
151
152
|
this._conf,
|
|
152
153
|
"get",
|
|
153
154
|
constructUrl({
|
|
@@ -212,7 +213,7 @@ class Content {
|
|
|
212
213
|
|
|
213
214
|
const xHeaders = {};
|
|
214
215
|
|
|
215
|
-
const response = await
|
|
216
|
+
const response = await ApplicationAPIClient.execute(
|
|
216
217
|
this._conf,
|
|
217
218
|
"get",
|
|
218
219
|
constructUrl({
|
|
@@ -264,7 +265,7 @@ class Content {
|
|
|
264
265
|
});
|
|
265
266
|
return data;
|
|
266
267
|
};
|
|
267
|
-
paginator.setCallback(callback);
|
|
268
|
+
paginator.setCallback(callback.bind(this));
|
|
268
269
|
return paginator;
|
|
269
270
|
}
|
|
270
271
|
|
|
@@ -300,7 +301,7 @@ class Content {
|
|
|
300
301
|
|
|
301
302
|
const xHeaders = {};
|
|
302
303
|
|
|
303
|
-
const response = await
|
|
304
|
+
const response = await ApplicationAPIClient.execute(
|
|
304
305
|
this._conf,
|
|
305
306
|
"get",
|
|
306
307
|
constructUrl({
|
|
@@ -365,7 +366,7 @@ class Content {
|
|
|
365
366
|
|
|
366
367
|
const xHeaders = {};
|
|
367
368
|
|
|
368
|
-
const response = await
|
|
369
|
+
const response = await ApplicationAPIClient.execute(
|
|
369
370
|
this._conf,
|
|
370
371
|
"get",
|
|
371
372
|
constructUrl({
|
|
@@ -425,7 +426,7 @@ class Content {
|
|
|
425
426
|
|
|
426
427
|
const xHeaders = {};
|
|
427
428
|
|
|
428
|
-
const response = await
|
|
429
|
+
const response = await ApplicationAPIClient.execute(
|
|
429
430
|
this._conf,
|
|
430
431
|
"get",
|
|
431
432
|
constructUrl({
|
|
@@ -492,7 +493,7 @@ class Content {
|
|
|
492
493
|
|
|
493
494
|
const xHeaders = {};
|
|
494
495
|
|
|
495
|
-
const response = await
|
|
496
|
+
const response = await ApplicationAPIClient.execute(
|
|
496
497
|
this._conf,
|
|
497
498
|
"get",
|
|
498
499
|
constructUrl({
|
|
@@ -554,7 +555,7 @@ class Content {
|
|
|
554
555
|
|
|
555
556
|
const xHeaders = {};
|
|
556
557
|
|
|
557
|
-
const response = await
|
|
558
|
+
const response = await ApplicationAPIClient.execute(
|
|
558
559
|
this._conf,
|
|
559
560
|
"get",
|
|
560
561
|
constructUrl({
|
|
@@ -621,7 +622,7 @@ class Content {
|
|
|
621
622
|
|
|
622
623
|
const xHeaders = {};
|
|
623
624
|
|
|
624
|
-
const response = await
|
|
625
|
+
const response = await ApplicationAPIClient.execute(
|
|
625
626
|
this._conf,
|
|
626
627
|
"get",
|
|
627
628
|
constructUrl({
|
|
@@ -681,7 +682,7 @@ class Content {
|
|
|
681
682
|
|
|
682
683
|
const xHeaders = {};
|
|
683
684
|
|
|
684
|
-
const response = await
|
|
685
|
+
const response = await ApplicationAPIClient.execute(
|
|
685
686
|
this._conf,
|
|
686
687
|
"get",
|
|
687
688
|
constructUrl({
|
|
@@ -743,7 +744,7 @@ class Content {
|
|
|
743
744
|
|
|
744
745
|
const xHeaders = {};
|
|
745
746
|
|
|
746
|
-
const response = await
|
|
747
|
+
const response = await ApplicationAPIClient.execute(
|
|
747
748
|
this._conf,
|
|
748
749
|
"get",
|
|
749
750
|
constructUrl({
|
|
@@ -810,7 +811,7 @@ class Content {
|
|
|
810
811
|
|
|
811
812
|
const xHeaders = {};
|
|
812
813
|
|
|
813
|
-
const response = await
|
|
814
|
+
const response = await ApplicationAPIClient.execute(
|
|
814
815
|
this._conf,
|
|
815
816
|
"get",
|
|
816
817
|
constructUrl({
|
|
@@ -862,7 +863,7 @@ class Content {
|
|
|
862
863
|
});
|
|
863
864
|
return data;
|
|
864
865
|
};
|
|
865
|
-
paginator.setCallback(callback);
|
|
866
|
+
paginator.setCallback(callback.bind(this));
|
|
866
867
|
return paginator;
|
|
867
868
|
}
|
|
868
869
|
|
|
@@ -903,7 +904,7 @@ class Content {
|
|
|
903
904
|
|
|
904
905
|
const xHeaders = {};
|
|
905
906
|
|
|
906
|
-
const response = await
|
|
907
|
+
const response = await ApplicationAPIClient.execute(
|
|
907
908
|
this._conf,
|
|
908
909
|
"get",
|
|
909
910
|
constructUrl({
|
|
@@ -968,7 +969,7 @@ class Content {
|
|
|
968
969
|
|
|
969
970
|
const xHeaders = {};
|
|
970
971
|
|
|
971
|
-
const response = await
|
|
972
|
+
const response = await ApplicationAPIClient.execute(
|
|
972
973
|
this._conf,
|
|
973
974
|
"get",
|
|
974
975
|
constructUrl({
|
|
@@ -1020,7 +1021,7 @@ class Content {
|
|
|
1020
1021
|
});
|
|
1021
1022
|
return data;
|
|
1022
1023
|
};
|
|
1023
|
-
paginator.setCallback(callback);
|
|
1024
|
+
paginator.setCallback(callback.bind(this));
|
|
1024
1025
|
return paginator;
|
|
1025
1026
|
}
|
|
1026
1027
|
|
|
@@ -1056,7 +1057,7 @@ class Content {
|
|
|
1056
1057
|
|
|
1057
1058
|
const xHeaders = {};
|
|
1058
1059
|
|
|
1059
|
-
const response = await
|
|
1060
|
+
const response = await ApplicationAPIClient.execute(
|
|
1060
1061
|
this._conf,
|
|
1061
1062
|
"get",
|
|
1062
1063
|
constructUrl({
|
|
@@ -1119,7 +1120,7 @@ class Content {
|
|
|
1119
1120
|
|
|
1120
1121
|
const xHeaders = {};
|
|
1121
1122
|
|
|
1122
|
-
const response = await
|
|
1123
|
+
const response = await ApplicationAPIClient.execute(
|
|
1123
1124
|
this._conf,
|
|
1124
1125
|
"get",
|
|
1125
1126
|
constructUrl({
|
|
@@ -1186,7 +1187,7 @@ class Content {
|
|
|
1186
1187
|
|
|
1187
1188
|
const xHeaders = {};
|
|
1188
1189
|
|
|
1189
|
-
const response = await
|
|
1190
|
+
const response = await ApplicationAPIClient.execute(
|
|
1190
1191
|
this._conf,
|
|
1191
1192
|
"get",
|
|
1192
1193
|
constructUrl({
|
|
@@ -1238,7 +1239,7 @@ class Content {
|
|
|
1238
1239
|
});
|
|
1239
1240
|
return data;
|
|
1240
1241
|
};
|
|
1241
|
-
paginator.setCallback(callback);
|
|
1242
|
+
paginator.setCallback(callback.bind(this));
|
|
1242
1243
|
return paginator;
|
|
1243
1244
|
}
|
|
1244
1245
|
|
|
@@ -1276,7 +1277,7 @@ class Content {
|
|
|
1276
1277
|
|
|
1277
1278
|
const xHeaders = {};
|
|
1278
1279
|
|
|
1279
|
-
const response = await
|
|
1280
|
+
const response = await ApplicationAPIClient.execute(
|
|
1280
1281
|
this._conf,
|
|
1281
1282
|
"get",
|
|
1282
1283
|
constructUrl({
|
|
@@ -1336,7 +1337,7 @@ class Content {
|
|
|
1336
1337
|
|
|
1337
1338
|
const xHeaders = {};
|
|
1338
1339
|
|
|
1339
|
-
const response = await
|
|
1340
|
+
const response = await ApplicationAPIClient.execute(
|
|
1340
1341
|
this._conf,
|
|
1341
1342
|
"get",
|
|
1342
1343
|
constructUrl({
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
const
|
|
1
|
+
const ApplicationAPIClient = require("../ApplicationAPIClient");
|
|
2
|
+
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
2
3
|
const constructUrl = require("../constructUrl");
|
|
3
4
|
const Paginator = require("../../common/Paginator");
|
|
4
|
-
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
5
5
|
const FileStorageValidator = require("./FileStorageApplicationValidator");
|
|
6
6
|
const FileStorageModel = require("./FileStorageApplicationModel");
|
|
7
7
|
const { Logger } = require("./../../common/Logger");
|
|
8
|
+
const Joi = require("joi");
|
|
8
9
|
const axios = require("axios");
|
|
9
10
|
|
|
10
11
|
class FileStorage {
|
|
@@ -84,7 +85,7 @@ class FileStorage {
|
|
|
84
85
|
|
|
85
86
|
const xHeaders = {};
|
|
86
87
|
|
|
87
|
-
const response = await
|
|
88
|
+
const response = await ApplicationAPIClient.execute(
|
|
88
89
|
this._conf,
|
|
89
90
|
"post",
|
|
90
91
|
constructUrl({
|
|
@@ -147,7 +148,7 @@ class FileStorage {
|
|
|
147
148
|
|
|
148
149
|
const xHeaders = {};
|
|
149
150
|
|
|
150
|
-
const response = await
|
|
151
|
+
const response = await ApplicationAPIClient.execute(
|
|
151
152
|
this._conf,
|
|
152
153
|
"post",
|
|
153
154
|
constructUrl({
|
|
@@ -228,7 +229,7 @@ class FileStorage {
|
|
|
228
229
|
|
|
229
230
|
const xHeaders = {};
|
|
230
231
|
|
|
231
|
-
const response = await
|
|
232
|
+
const response = await ApplicationAPIClient.execute(
|
|
232
233
|
this._conf,
|
|
233
234
|
"post",
|
|
234
235
|
constructUrl({
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
const
|
|
1
|
+
const ApplicationAPIClient = require("../ApplicationAPIClient");
|
|
2
|
+
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
2
3
|
const constructUrl = require("../constructUrl");
|
|
3
4
|
const Paginator = require("../../common/Paginator");
|
|
4
|
-
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
5
5
|
const LeadValidator = require("./LeadApplicationValidator");
|
|
6
6
|
const LeadModel = require("./LeadApplicationModel");
|
|
7
7
|
const { Logger } = require("./../../common/Logger");
|
|
8
|
+
const Joi = require("joi");
|
|
8
9
|
|
|
9
10
|
class Lead {
|
|
10
11
|
constructor(_conf) {
|
|
@@ -70,7 +71,7 @@ class Lead {
|
|
|
70
71
|
|
|
71
72
|
const xHeaders = {};
|
|
72
73
|
|
|
73
|
-
const response = await
|
|
74
|
+
const response = await ApplicationAPIClient.execute(
|
|
74
75
|
this._conf,
|
|
75
76
|
"post",
|
|
76
77
|
constructUrl({
|
|
@@ -131,7 +132,7 @@ class Lead {
|
|
|
131
132
|
|
|
132
133
|
const xHeaders = {};
|
|
133
134
|
|
|
134
|
-
const response = await
|
|
135
|
+
const response = await ApplicationAPIClient.execute(
|
|
135
136
|
this._conf,
|
|
136
137
|
"post",
|
|
137
138
|
constructUrl({
|
|
@@ -192,7 +193,7 @@ class Lead {
|
|
|
192
193
|
|
|
193
194
|
const xHeaders = {};
|
|
194
195
|
|
|
195
|
-
const response = await
|
|
196
|
+
const response = await ApplicationAPIClient.execute(
|
|
196
197
|
this._conf,
|
|
197
198
|
"get",
|
|
198
199
|
constructUrl({
|
|
@@ -256,7 +257,7 @@ class Lead {
|
|
|
256
257
|
|
|
257
258
|
const xHeaders = {};
|
|
258
259
|
|
|
259
|
-
const response = await
|
|
260
|
+
const response = await ApplicationAPIClient.execute(
|
|
260
261
|
this._conf,
|
|
261
262
|
"get",
|
|
262
263
|
constructUrl({
|
|
@@ -320,7 +321,7 @@ class Lead {
|
|
|
320
321
|
|
|
321
322
|
const xHeaders = {};
|
|
322
323
|
|
|
323
|
-
const response = await
|
|
324
|
+
const response = await ApplicationAPIClient.execute(
|
|
324
325
|
this._conf,
|
|
325
326
|
"get",
|
|
326
327
|
constructUrl({
|
|
@@ -381,7 +382,7 @@ class Lead {
|
|
|
381
382
|
|
|
382
383
|
const xHeaders = {};
|
|
383
384
|
|
|
384
|
-
const response = await
|
|
385
|
+
const response = await ApplicationAPIClient.execute(
|
|
385
386
|
this._conf,
|
|
386
387
|
"get",
|
|
387
388
|
constructUrl({
|
|
@@ -445,7 +446,7 @@ class Lead {
|
|
|
445
446
|
|
|
446
447
|
const xHeaders = {};
|
|
447
448
|
|
|
448
|
-
const response = await
|
|
449
|
+
const response = await ApplicationAPIClient.execute(
|
|
449
450
|
this._conf,
|
|
450
451
|
"post",
|
|
451
452
|
constructUrl({
|
|
@@ -32,14 +32,12 @@ declare class Logistic {
|
|
|
32
32
|
* @param {Object} arg - Arg object.
|
|
33
33
|
* @param {string} arg.pincode - A `pincode` contains a specific address of
|
|
34
34
|
* a location.
|
|
35
|
-
* @param {string} [arg.countryCode] - A 3 alphabetic country code
|
|
36
35
|
* @returns {Promise<PincodeApiResponse>} - Success response
|
|
37
36
|
* @summary: Get Pincode API
|
|
38
37
|
* @description: Get pincode data
|
|
39
38
|
*/
|
|
40
|
-
getPincodeCity({ pincode
|
|
39
|
+
getPincodeCity({ pincode }?: {
|
|
41
40
|
pincode: string;
|
|
42
|
-
countryCode?: string;
|
|
43
41
|
}): Promise<PincodeApiResponse>;
|
|
44
42
|
/**
|
|
45
43
|
* @param {Object} arg - Arg object.
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
const
|
|
1
|
+
const ApplicationAPIClient = require("../ApplicationAPIClient");
|
|
2
|
+
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
2
3
|
const constructUrl = require("../constructUrl");
|
|
3
4
|
const Paginator = require("../../common/Paginator");
|
|
4
|
-
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
5
5
|
const LogisticValidator = require("./LogisticApplicationValidator");
|
|
6
6
|
const LogisticModel = require("./LogisticApplicationModel");
|
|
7
7
|
const { Logger } = require("./../../common/Logger");
|
|
8
|
+
const Joi = require("joi");
|
|
8
9
|
|
|
9
10
|
class Logistic {
|
|
10
11
|
constructor(_conf) {
|
|
@@ -65,7 +66,7 @@ class Logistic {
|
|
|
65
66
|
|
|
66
67
|
const xHeaders = {};
|
|
67
68
|
|
|
68
|
-
const response = await
|
|
69
|
+
const response = await ApplicationAPIClient.execute(
|
|
69
70
|
this._conf,
|
|
70
71
|
"get",
|
|
71
72
|
constructUrl({
|
|
@@ -130,7 +131,7 @@ class Logistic {
|
|
|
130
131
|
|
|
131
132
|
const xHeaders = {};
|
|
132
133
|
|
|
133
|
-
const response = await
|
|
134
|
+
const response = await ApplicationAPIClient.execute(
|
|
134
135
|
this._conf,
|
|
135
136
|
"post",
|
|
136
137
|
constructUrl({
|
|
@@ -164,14 +165,13 @@ class Logistic {
|
|
|
164
165
|
* @param {Object} arg - Arg object.
|
|
165
166
|
* @param {string} arg.pincode - A `pincode` contains a specific address of
|
|
166
167
|
* a location.
|
|
167
|
-
* @param {string} [arg.countryCode] - A 3 alphabetic country code
|
|
168
168
|
* @returns {Promise<PincodeApiResponse>} - Success response
|
|
169
169
|
* @summary: Get Pincode API
|
|
170
170
|
* @description: Get pincode data
|
|
171
171
|
*/
|
|
172
|
-
async getPincodeCity({ pincode
|
|
172
|
+
async getPincodeCity({ pincode } = {}) {
|
|
173
173
|
const { error } = LogisticValidator.getPincodeCity().validate(
|
|
174
|
-
{ pincode
|
|
174
|
+
{ pincode },
|
|
175
175
|
{ abortEarly: false, allowUnknown: true }
|
|
176
176
|
);
|
|
177
177
|
if (error) {
|
|
@@ -180,7 +180,7 @@ class Logistic {
|
|
|
180
180
|
|
|
181
181
|
// Showing warrnings if extra unknown parameters are found
|
|
182
182
|
const { error: warrning } = LogisticValidator.getPincodeCity().validate(
|
|
183
|
-
{ pincode
|
|
183
|
+
{ pincode },
|
|
184
184
|
{ abortEarly: false, allowUnknown: false }
|
|
185
185
|
);
|
|
186
186
|
if (warrning) {
|
|
@@ -192,11 +192,10 @@ class Logistic {
|
|
|
192
192
|
}
|
|
193
193
|
|
|
194
194
|
const query_params = {};
|
|
195
|
-
query_params["country_code"] = countryCode;
|
|
196
195
|
|
|
197
196
|
const xHeaders = {};
|
|
198
197
|
|
|
199
|
-
const response = await
|
|
198
|
+
const response = await ApplicationAPIClient.execute(
|
|
200
199
|
this._conf,
|
|
201
200
|
"get",
|
|
202
201
|
constructUrl({
|
|
@@ -259,7 +258,7 @@ class Logistic {
|
|
|
259
258
|
|
|
260
259
|
const xHeaders = {};
|
|
261
260
|
|
|
262
|
-
const response = await
|
|
261
|
+
const response = await ApplicationAPIClient.execute(
|
|
263
262
|
this._conf,
|
|
264
263
|
"post",
|
|
265
264
|
constructUrl({
|
|
@@ -322,7 +321,7 @@ class Logistic {
|
|
|
322
321
|
|
|
323
322
|
const xHeaders = {};
|
|
324
323
|
|
|
325
|
-
const response = await
|
|
324
|
+
const response = await ApplicationAPIClient.execute(
|
|
326
325
|
this._conf,
|
|
327
326
|
"post",
|
|
328
327
|
constructUrl({
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
const
|
|
1
|
+
const ApplicationAPIClient = require("../ApplicationAPIClient");
|
|
2
|
+
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
2
3
|
const constructUrl = require("../constructUrl");
|
|
3
4
|
const Paginator = require("../../common/Paginator");
|
|
4
|
-
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
5
5
|
const OrderValidator = require("./OrderApplicationValidator");
|
|
6
6
|
const OrderModel = require("./OrderApplicationModel");
|
|
7
7
|
const { Logger } = require("./../../common/Logger");
|
|
8
|
+
const Joi = require("joi");
|
|
8
9
|
|
|
9
10
|
class Order {
|
|
10
11
|
constructor(_conf) {
|
|
@@ -89,7 +90,7 @@ class Order {
|
|
|
89
90
|
|
|
90
91
|
const xHeaders = {};
|
|
91
92
|
|
|
92
|
-
const response = await
|
|
93
|
+
const response = await ApplicationAPIClient.execute(
|
|
93
94
|
this._conf,
|
|
94
95
|
"get",
|
|
95
96
|
constructUrl({
|
|
@@ -155,7 +156,7 @@ class Order {
|
|
|
155
156
|
|
|
156
157
|
const xHeaders = {};
|
|
157
158
|
|
|
158
|
-
const response = await
|
|
159
|
+
const response = await ApplicationAPIClient.execute(
|
|
159
160
|
this._conf,
|
|
160
161
|
"get",
|
|
161
162
|
constructUrl({
|
|
@@ -219,7 +220,7 @@ class Order {
|
|
|
219
220
|
|
|
220
221
|
const xHeaders = {};
|
|
221
222
|
|
|
222
|
-
const response = await
|
|
223
|
+
const response = await ApplicationAPIClient.execute(
|
|
223
224
|
this._conf,
|
|
224
225
|
"get",
|
|
225
226
|
constructUrl({
|
|
@@ -303,7 +304,7 @@ class Order {
|
|
|
303
304
|
|
|
304
305
|
const xHeaders = {};
|
|
305
306
|
|
|
306
|
-
const response = await
|
|
307
|
+
const response = await ApplicationAPIClient.execute(
|
|
307
308
|
this._conf,
|
|
308
309
|
"get",
|
|
309
310
|
constructUrl({
|
|
@@ -365,7 +366,7 @@ class Order {
|
|
|
365
366
|
|
|
366
367
|
const xHeaders = {};
|
|
367
368
|
|
|
368
|
-
const response = await
|
|
369
|
+
const response = await ApplicationAPIClient.execute(
|
|
369
370
|
this._conf,
|
|
370
371
|
"get",
|
|
371
372
|
constructUrl({
|
|
@@ -430,7 +431,7 @@ class Order {
|
|
|
430
431
|
|
|
431
432
|
const xHeaders = {};
|
|
432
433
|
|
|
433
|
-
const response = await
|
|
434
|
+
const response = await ApplicationAPIClient.execute(
|
|
434
435
|
this._conf,
|
|
435
436
|
"get",
|
|
436
437
|
constructUrl({
|
|
@@ -495,7 +496,7 @@ class Order {
|
|
|
495
496
|
|
|
496
497
|
const xHeaders = {};
|
|
497
498
|
|
|
498
|
-
const response = await
|
|
499
|
+
const response = await ApplicationAPIClient.execute(
|
|
499
500
|
this._conf,
|
|
500
501
|
"get",
|
|
501
502
|
constructUrl({
|
|
@@ -558,7 +559,7 @@ class Order {
|
|
|
558
559
|
|
|
559
560
|
const xHeaders = {};
|
|
560
561
|
|
|
561
|
-
const response = await
|
|
562
|
+
const response = await ApplicationAPIClient.execute(
|
|
562
563
|
this._conf,
|
|
563
564
|
"get",
|
|
564
565
|
constructUrl({
|
|
@@ -625,7 +626,7 @@ class Order {
|
|
|
625
626
|
|
|
626
627
|
const xHeaders = {};
|
|
627
628
|
|
|
628
|
-
const response = await
|
|
629
|
+
const response = await ApplicationAPIClient.execute(
|
|
629
630
|
this._conf,
|
|
630
631
|
"post",
|
|
631
632
|
constructUrl({
|
|
@@ -690,7 +691,7 @@ class Order {
|
|
|
690
691
|
|
|
691
692
|
const xHeaders = {};
|
|
692
693
|
|
|
693
|
-
const response = await
|
|
694
|
+
const response = await ApplicationAPIClient.execute(
|
|
694
695
|
this._conf,
|
|
695
696
|
"get",
|
|
696
697
|
constructUrl({
|
|
@@ -754,7 +755,7 @@ class Order {
|
|
|
754
755
|
|
|
755
756
|
const xHeaders = {};
|
|
756
757
|
|
|
757
|
-
const response = await
|
|
758
|
+
const response = await ApplicationAPIClient.execute(
|
|
758
759
|
this._conf,
|
|
759
760
|
"put",
|
|
760
761
|
constructUrl({
|
|
@@ -824,7 +825,7 @@ class Order {
|
|
|
824
825
|
|
|
825
826
|
const xHeaders = {};
|
|
826
827
|
|
|
827
|
-
const response = await
|
|
828
|
+
const response = await ApplicationAPIClient.execute(
|
|
828
829
|
this._conf,
|
|
829
830
|
"post",
|
|
830
831
|
constructUrl({
|
|
@@ -48,6 +48,8 @@ class OrderModel {
|
|
|
48
48
|
applied_promos: Joi.array().items(OrderModel.AppliedPromos()),
|
|
49
49
|
can_cancel: Joi.boolean(),
|
|
50
50
|
can_return: Joi.boolean(),
|
|
51
|
+
currency_code: Joi.string().allow(""),
|
|
52
|
+
currency_symbol: Joi.string().allow(""),
|
|
51
53
|
current_status: OrderModel.CurrentStatus(),
|
|
52
54
|
delivery_date: Joi.string().allow(""),
|
|
53
55
|
financial_breakup: Joi.array().items(OrderModel.FinancialBreakup()),
|
|
@@ -79,6 +81,8 @@ class OrderModel {
|
|
|
79
81
|
}
|
|
80
82
|
static BreakupValues() {
|
|
81
83
|
return Joi.object({
|
|
84
|
+
currency_code: Joi.string().allow(""),
|
|
85
|
+
currency_symbol: Joi.string().allow(""),
|
|
82
86
|
display: Joi.string().allow(""),
|
|
83
87
|
name: Joi.string().allow(""),
|
|
84
88
|
value: Joi.number(),
|
|
@@ -118,6 +122,8 @@ class OrderModel {
|
|
|
118
122
|
city: Joi.string().allow(""),
|
|
119
123
|
contact_person: Joi.string().allow(""),
|
|
120
124
|
country: Joi.string().allow(""),
|
|
125
|
+
country_iso_code: Joi.string().allow(""),
|
|
126
|
+
country_phone_code: Joi.string().allow(""),
|
|
121
127
|
created_at: Joi.string().allow(""),
|
|
122
128
|
email: Joi.string().allow(""),
|
|
123
129
|
landmark: Joi.string().allow(""),
|
|
@@ -298,6 +304,8 @@ class OrderModel {
|
|
|
298
304
|
cod_charges: Joi.number(),
|
|
299
305
|
coupon_effective_discount: Joi.number(),
|
|
300
306
|
coupon_value: Joi.number(),
|
|
307
|
+
currency_code: Joi.string().allow(""),
|
|
308
|
+
currency_symbol: Joi.string().allow(""),
|
|
301
309
|
delivery_charge: Joi.number(),
|
|
302
310
|
discount: Joi.number(),
|
|
303
311
|
fynd_credits: Joi.number(),
|
|
@@ -448,6 +456,7 @@ class OrderModel {
|
|
|
448
456
|
prices: OrderModel.Prices(),
|
|
449
457
|
promise: OrderModel.Promise(),
|
|
450
458
|
refund_details: Joi.any(),
|
|
459
|
+
return_meta: Joi.any(),
|
|
451
460
|
returnable_date: Joi.string().allow(""),
|
|
452
461
|
shipment_created_at: Joi.string().allow(""),
|
|
453
462
|
shipment_id: Joi.string().allow(""),
|