@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,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 ConfigurationValidator = require("./ConfigurationPlatformApplicationValidator");
|
|
5
5
|
const ConfigurationModel = require("./ConfigurationPlatformModel");
|
|
6
6
|
const { Logger } = require("./../../common/Logger");
|
|
7
|
+
const Joi = require("joi");
|
|
7
8
|
|
|
8
9
|
class Configuration {
|
|
9
10
|
constructor(config, applicationId) {
|
|
@@ -1966,4 +1967,5 @@ class Configuration {
|
|
|
1966
1967
|
return response;
|
|
1967
1968
|
}
|
|
1968
1969
|
}
|
|
1970
|
+
|
|
1969
1971
|
module.exports = Configuration;
|
|
@@ -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 ConfigurationValidator = require("./ConfigurationPlatformValidator");
|
|
5
5
|
const ConfigurationModel = require("./ConfigurationPlatformModel");
|
|
6
6
|
const { Logger } = require("./../../common/Logger");
|
|
7
|
+
const Joi = require("joi");
|
|
7
8
|
|
|
8
9
|
class Configuration {
|
|
9
10
|
constructor(config) {
|
|
@@ -175,7 +176,7 @@ class Configuration {
|
|
|
175
176
|
});
|
|
176
177
|
return data;
|
|
177
178
|
};
|
|
178
|
-
paginator.setCallback(callback);
|
|
179
|
+
paginator.setCallback(callback.bind(this));
|
|
179
180
|
return paginator;
|
|
180
181
|
}
|
|
181
182
|
|
|
@@ -272,7 +273,7 @@ class Configuration {
|
|
|
272
273
|
});
|
|
273
274
|
return data;
|
|
274
275
|
};
|
|
275
|
-
paginator.setCallback(callback);
|
|
276
|
+
paginator.setCallback(callback.bind(this));
|
|
276
277
|
return paginator;
|
|
277
278
|
}
|
|
278
279
|
|
|
@@ -441,7 +442,7 @@ class Configuration {
|
|
|
441
442
|
});
|
|
442
443
|
return data;
|
|
443
444
|
};
|
|
444
|
-
paginator.setCallback(callback);
|
|
445
|
+
paginator.setCallback(callback.bind(this));
|
|
445
446
|
return paginator;
|
|
446
447
|
}
|
|
447
448
|
|
|
@@ -1028,7 +1029,7 @@ class Configuration {
|
|
|
1028
1029
|
});
|
|
1029
1030
|
return data;
|
|
1030
1031
|
};
|
|
1031
|
-
paginator.setCallback(callback);
|
|
1032
|
+
paginator.setCallback(callback.bind(this));
|
|
1032
1033
|
return paginator;
|
|
1033
1034
|
}
|
|
1034
1035
|
|
|
@@ -1135,7 +1136,7 @@ class Configuration {
|
|
|
1135
1136
|
});
|
|
1136
1137
|
return data;
|
|
1137
1138
|
};
|
|
1138
|
-
paginator.setCallback(callback);
|
|
1139
|
+
paginator.setCallback(callback.bind(this));
|
|
1139
1140
|
return paginator;
|
|
1140
1141
|
}
|
|
1141
1142
|
|
|
@@ -1237,7 +1238,7 @@ class Configuration {
|
|
|
1237
1238
|
});
|
|
1238
1239
|
return data;
|
|
1239
1240
|
};
|
|
1240
|
-
paginator.setCallback(callback);
|
|
1241
|
+
paginator.setCallback(callback.bind(this));
|
|
1241
1242
|
return paginator;
|
|
1242
1243
|
}
|
|
1243
1244
|
|
|
@@ -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 ContentValidator = require("./ContentPlatformApplicationValidator");
|
|
5
5
|
const ContentModel = require("./ContentPlatformModel");
|
|
6
6
|
const { Logger } = require("./../../common/Logger");
|
|
7
|
+
const Joi = require("joi");
|
|
7
8
|
|
|
8
9
|
class Content {
|
|
9
10
|
constructor(config, applicationId) {
|
|
@@ -4511,4 +4512,5 @@ class Content {
|
|
|
4511
4512
|
return response;
|
|
4512
4513
|
}
|
|
4513
4514
|
}
|
|
4515
|
+
|
|
4514
4516
|
module.exports = Content;
|
|
@@ -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 DiscountValidator = require("./DiscountPlatformValidator");
|
|
5
5
|
const DiscountModel = require("./DiscountPlatformModel");
|
|
6
6
|
const { Logger } = require("./../../common/Logger");
|
|
7
|
+
const Joi = require("joi");
|
|
7
8
|
|
|
8
9
|
class Discount {
|
|
9
10
|
constructor(config) {
|
|
@@ -28,7 +28,7 @@ declare class FileStorage {
|
|
|
28
28
|
* After successfully upload, call `appCompleteUpload` api to complete the upload process.
|
|
29
29
|
* This operation will return the url for the uploaded file.
|
|
30
30
|
*/
|
|
31
|
-
appCompleteUpload({ namespace, body }?: {
|
|
31
|
+
appCompleteUpload({ namespace, body, }?: {
|
|
32
32
|
namespace: string;
|
|
33
33
|
body: StartResponse;
|
|
34
34
|
}): Promise<CompleteResponse>;
|
|
@@ -69,7 +69,7 @@ declare class FileStorage {
|
|
|
69
69
|
* After successfully upload, call `appCompleteUpload` api to complete the upload process.
|
|
70
70
|
* This operation will return the url for the uploaded file.
|
|
71
71
|
*/
|
|
72
|
-
appStartUpload({ namespace, body }?: {
|
|
72
|
+
appStartUpload({ namespace, body, }?: {
|
|
73
73
|
namespace: string;
|
|
74
74
|
body: StartRequest;
|
|
75
75
|
}): Promise<StartResponse>;
|
|
@@ -81,7 +81,7 @@ declare class FileStorage {
|
|
|
81
81
|
* @summary: Browse Files
|
|
82
82
|
* @description: Browse Files
|
|
83
83
|
*/
|
|
84
|
-
browse({ namespace, pageNo }?: {
|
|
84
|
+
browse({ namespace, pageNo, }?: {
|
|
85
85
|
namespace: string;
|
|
86
86
|
pageNo?: number;
|
|
87
87
|
}): Promise<BrowseResponse>;
|
|
@@ -1,9 +1,12 @@
|
|
|
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 FileStorageValidator = require("./FileStoragePlatformApplicationValidator");
|
|
5
5
|
const FileStorageModel = require("./FileStoragePlatformModel");
|
|
6
6
|
const { Logger } = require("./../../common/Logger");
|
|
7
|
+
const Joi = require("joi");
|
|
8
|
+
|
|
9
|
+
const axios = require("axios");
|
|
7
10
|
|
|
8
11
|
class FileStorage {
|
|
9
12
|
constructor(config, applicationId) {
|
|
@@ -36,10 +39,15 @@ class FileStorage {
|
|
|
36
39
|
* After successfully upload, call `appCompleteUpload` api to complete the upload process.
|
|
37
40
|
* This operation will return the url for the uploaded file.
|
|
38
41
|
*/
|
|
39
|
-
async appCompleteUpload({
|
|
42
|
+
async appCompleteUpload({
|
|
43
|
+
namespace,
|
|
44
|
+
|
|
45
|
+
body,
|
|
46
|
+
} = {}) {
|
|
40
47
|
const { error } = FileStorageValidator.appCompleteUpload().validate(
|
|
41
48
|
{
|
|
42
49
|
namespace,
|
|
50
|
+
|
|
43
51
|
body,
|
|
44
52
|
},
|
|
45
53
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -54,6 +62,7 @@ class FileStorage {
|
|
|
54
62
|
} = FileStorageValidator.appCompleteUpload().validate(
|
|
55
63
|
{
|
|
56
64
|
namespace,
|
|
65
|
+
|
|
57
66
|
body,
|
|
58
67
|
},
|
|
59
68
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -184,10 +193,15 @@ class FileStorage {
|
|
|
184
193
|
* After successfully upload, call `appCompleteUpload` api to complete the upload process.
|
|
185
194
|
* This operation will return the url for the uploaded file.
|
|
186
195
|
*/
|
|
187
|
-
async appStartUpload({
|
|
196
|
+
async appStartUpload({
|
|
197
|
+
namespace,
|
|
198
|
+
|
|
199
|
+
body,
|
|
200
|
+
} = {}) {
|
|
188
201
|
const { error } = FileStorageValidator.appStartUpload().validate(
|
|
189
202
|
{
|
|
190
203
|
namespace,
|
|
204
|
+
|
|
191
205
|
body,
|
|
192
206
|
},
|
|
193
207
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -200,6 +214,7 @@ class FileStorage {
|
|
|
200
214
|
const { error: warrning } = FileStorageValidator.appStartUpload().validate(
|
|
201
215
|
{
|
|
202
216
|
namespace,
|
|
217
|
+
|
|
203
218
|
body,
|
|
204
219
|
},
|
|
205
220
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -248,10 +263,15 @@ class FileStorage {
|
|
|
248
263
|
* @summary: Browse Files
|
|
249
264
|
* @description: Browse Files
|
|
250
265
|
*/
|
|
251
|
-
async browse({
|
|
266
|
+
async browse({
|
|
267
|
+
namespace,
|
|
268
|
+
|
|
269
|
+
pageNo,
|
|
270
|
+
} = {}) {
|
|
252
271
|
const { error } = FileStorageValidator.browse().validate(
|
|
253
272
|
{
|
|
254
273
|
namespace,
|
|
274
|
+
|
|
255
275
|
pageNo,
|
|
256
276
|
},
|
|
257
277
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -264,6 +284,7 @@ class FileStorage {
|
|
|
264
284
|
const { error: warrning } = FileStorageValidator.browse().validate(
|
|
265
285
|
{
|
|
266
286
|
namespace,
|
|
287
|
+
|
|
267
288
|
pageNo,
|
|
268
289
|
},
|
|
269
290
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -335,7 +356,6 @@ class FileStorage {
|
|
|
335
356
|
return paginator;
|
|
336
357
|
}
|
|
337
358
|
}
|
|
338
|
-
module.exports = FileStorage;
|
|
339
359
|
|
|
340
360
|
/**
|
|
341
361
|
* @param data
|
|
@@ -385,3 +405,5 @@ FileStorage.prototype.upload = function ({
|
|
|
385
405
|
}
|
|
386
406
|
});
|
|
387
407
|
};
|
|
408
|
+
|
|
409
|
+
module.exports = FileStorage;
|
|
@@ -10,7 +10,7 @@ declare class FileStorage {
|
|
|
10
10
|
* @summary: Browse Files
|
|
11
11
|
* @description: Browse Files
|
|
12
12
|
*/
|
|
13
|
-
browse({ namespace, pageNo }?: {
|
|
13
|
+
browse({ namespace, pageNo, }?: {
|
|
14
14
|
namespace: string;
|
|
15
15
|
pageNo?: number;
|
|
16
16
|
}): Promise<BrowseResponse>;
|
|
@@ -48,7 +48,7 @@ declare class FileStorage {
|
|
|
48
48
|
* After successfully upload, call `completeUpload` api to complete the upload process.
|
|
49
49
|
* This operation will return the url for the uploaded file.
|
|
50
50
|
*/
|
|
51
|
-
completeUpload({ namespace, body }?: {
|
|
51
|
+
completeUpload({ namespace, body, }?: {
|
|
52
52
|
namespace: string;
|
|
53
53
|
body: StartResponse;
|
|
54
54
|
}): Promise<CompleteResponse>;
|
|
@@ -109,7 +109,7 @@ declare class FileStorage {
|
|
|
109
109
|
* After successfully upload, call `completeUpload` api to complete the upload process.
|
|
110
110
|
* This operation will return the url for the uploaded file.
|
|
111
111
|
*/
|
|
112
|
-
startUpload({ namespace, body }?: {
|
|
112
|
+
startUpload({ namespace, body, }?: {
|
|
113
113
|
namespace: string;
|
|
114
114
|
body: StartRequest;
|
|
115
115
|
}): Promise<StartResponse>;
|
|
@@ -1,9 +1,12 @@
|
|
|
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 FileStorageValidator = require("./FileStoragePlatformValidator");
|
|
5
5
|
const FileStorageModel = require("./FileStoragePlatformModel");
|
|
6
6
|
const { Logger } = require("./../../common/Logger");
|
|
7
|
+
const Joi = require("joi");
|
|
8
|
+
|
|
9
|
+
const axios = require("axios");
|
|
7
10
|
|
|
8
11
|
class FileStorage {
|
|
9
12
|
constructor(config) {
|
|
@@ -18,10 +21,15 @@ class FileStorage {
|
|
|
18
21
|
* @summary: Browse Files
|
|
19
22
|
* @description: Browse Files
|
|
20
23
|
*/
|
|
21
|
-
async browse({
|
|
24
|
+
async browse({
|
|
25
|
+
namespace,
|
|
26
|
+
|
|
27
|
+
pageNo,
|
|
28
|
+
} = {}) {
|
|
22
29
|
const { error } = FileStorageValidator.browse().validate(
|
|
23
30
|
{
|
|
24
31
|
namespace,
|
|
32
|
+
|
|
25
33
|
pageNo,
|
|
26
34
|
},
|
|
27
35
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -34,6 +42,7 @@ class FileStorage {
|
|
|
34
42
|
const { error: warrning } = FileStorageValidator.browse().validate(
|
|
35
43
|
{
|
|
36
44
|
namespace,
|
|
45
|
+
|
|
37
46
|
pageNo,
|
|
38
47
|
},
|
|
39
48
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -92,6 +101,7 @@ class FileStorage {
|
|
|
92
101
|
const pageType = "number";
|
|
93
102
|
const data = await this.browse({
|
|
94
103
|
namespace: namespace,
|
|
104
|
+
|
|
95
105
|
pageNo: pageNo,
|
|
96
106
|
});
|
|
97
107
|
paginator.setPaginator({
|
|
@@ -100,7 +110,7 @@ class FileStorage {
|
|
|
100
110
|
});
|
|
101
111
|
return data;
|
|
102
112
|
};
|
|
103
|
-
paginator.setCallback(callback);
|
|
113
|
+
paginator.setCallback(callback.bind(this));
|
|
104
114
|
return paginator;
|
|
105
115
|
}
|
|
106
116
|
|
|
@@ -129,10 +139,15 @@ class FileStorage {
|
|
|
129
139
|
* After successfully upload, call `completeUpload` api to complete the upload process.
|
|
130
140
|
* This operation will return the url for the uploaded file.
|
|
131
141
|
*/
|
|
132
|
-
async completeUpload({
|
|
142
|
+
async completeUpload({
|
|
143
|
+
namespace,
|
|
144
|
+
|
|
145
|
+
body,
|
|
146
|
+
} = {}) {
|
|
133
147
|
const { error } = FileStorageValidator.completeUpload().validate(
|
|
134
148
|
{
|
|
135
149
|
namespace,
|
|
150
|
+
|
|
136
151
|
body,
|
|
137
152
|
},
|
|
138
153
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -145,6 +160,7 @@ class FileStorage {
|
|
|
145
160
|
const { error: warrning } = FileStorageValidator.completeUpload().validate(
|
|
146
161
|
{
|
|
147
162
|
namespace,
|
|
163
|
+
|
|
148
164
|
body,
|
|
149
165
|
},
|
|
150
166
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -407,10 +423,15 @@ class FileStorage {
|
|
|
407
423
|
* After successfully upload, call `completeUpload` api to complete the upload process.
|
|
408
424
|
* This operation will return the url for the uploaded file.
|
|
409
425
|
*/
|
|
410
|
-
async startUpload({
|
|
426
|
+
async startUpload({
|
|
427
|
+
namespace,
|
|
428
|
+
|
|
429
|
+
body,
|
|
430
|
+
} = {}) {
|
|
411
431
|
const { error } = FileStorageValidator.startUpload().validate(
|
|
412
432
|
{
|
|
413
433
|
namespace,
|
|
434
|
+
|
|
414
435
|
body,
|
|
415
436
|
},
|
|
416
437
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -423,6 +444,7 @@ class FileStorage {
|
|
|
423
444
|
const { error: warrning } = FileStorageValidator.startUpload().validate(
|
|
424
445
|
{
|
|
425
446
|
namespace,
|
|
447
|
+
|
|
426
448
|
body,
|
|
427
449
|
},
|
|
428
450
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -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 InventoryValidator = require("./InventoryPlatformValidator");
|
|
5
5
|
const InventoryModel = require("./InventoryPlatformModel");
|
|
6
6
|
const { Logger } = require("./../../common/Logger");
|
|
7
|
+
const Joi = require("joi");
|
|
7
8
|
|
|
8
9
|
class Inventory {
|
|
9
10
|
constructor(config) {
|
|
@@ -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 LeadValidator = require("./LeadPlatformApplicationValidator");
|
|
5
5
|
const LeadModel = require("./LeadPlatformModel");
|
|
6
6
|
const { Logger } = require("./../../common/Logger");
|
|
7
|
+
const Joi = require("joi");
|
|
7
8
|
|
|
8
9
|
class Lead {
|
|
9
10
|
constructor(config, applicationId) {
|
|
@@ -815,4 +816,5 @@ class Lead {
|
|
|
815
816
|
return response;
|
|
816
817
|
}
|
|
817
818
|
}
|
|
819
|
+
|
|
818
820
|
module.exports = Lead;
|
|
@@ -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 LeadValidator = require("./LeadPlatformValidator");
|
|
5
5
|
const LeadModel = require("./LeadPlatformModel");
|
|
6
6
|
const { Logger } = require("./../../common/Logger");
|
|
7
|
+
const Joi = require("joi");
|
|
7
8
|
|
|
8
9
|
class Lead {
|
|
9
10
|
constructor(config) {
|
|
@@ -600,7 +601,7 @@ class Lead {
|
|
|
600
601
|
});
|
|
601
602
|
return data;
|
|
602
603
|
};
|
|
603
|
-
paginator.setCallback(callback);
|
|
604
|
+
paginator.setCallback(callback.bind(this));
|
|
604
605
|
return paginator;
|
|
605
606
|
}
|
|
606
607
|
|
|
@@ -3,6 +3,7 @@ const { fdkAxios } = require("../common/AxiosHelper");
|
|
|
3
3
|
const { sign } = require("../common/RequestSigner");
|
|
4
4
|
const { FDKTokenIssueError, FDKOAuthCodeError } = require("../common/FDKError");
|
|
5
5
|
const { Logger } = require("../common/Logger");
|
|
6
|
+
const { btoa } = require("isomorphic-base64");
|
|
6
7
|
|
|
7
8
|
const refreshTokenRequestCache = {};
|
|
8
9
|
class OAuthClient {
|
|
@@ -158,11 +159,7 @@ class OAuthClient {
|
|
|
158
159
|
} else if (grant_type === "authorization_code") {
|
|
159
160
|
reqData = { ...reqData, code };
|
|
160
161
|
}
|
|
161
|
-
|
|
162
|
-
const token = Buffer.from(
|
|
163
|
-
`${this.config.apiKey}:${this.config.apiSecret}`,
|
|
164
|
-
"utf8"
|
|
165
|
-
).toString("base64");
|
|
162
|
+
const token = btoa(`${this.config.apiKey}:${this.config.apiSecret}`);
|
|
166
163
|
let url = `${this.config.domain}/service/panel/authentication/v1.0/company/${this.config.companyId}/oauth/token`;
|
|
167
164
|
const rawRequest = {
|
|
168
165
|
method: "post",
|
|
@@ -201,10 +198,7 @@ class OAuthClient {
|
|
|
201
198
|
scope: scopes,
|
|
202
199
|
code: code,
|
|
203
200
|
};
|
|
204
|
-
const token =
|
|
205
|
-
`${this.config.apiKey}:${this.config.apiSecret}`,
|
|
206
|
-
"utf8"
|
|
207
|
-
).toString("base64");
|
|
201
|
+
const token = btoa(`${this.config.apiKey}:${this.config.apiSecret}`);
|
|
208
202
|
const rawRequest = {
|
|
209
203
|
method: "post",
|
|
210
204
|
url: url,
|
|
@@ -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 OrderValidator = require("./OrderPlatformApplicationValidator");
|
|
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, applicationId) {
|
|
@@ -268,4 +269,5 @@ class Order {
|
|
|
268
269
|
return response;
|
|
269
270
|
}
|
|
270
271
|
}
|
|
272
|
+
|
|
271
273
|
module.exports = Order;
|
|
@@ -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;
|