@gofynd/fdk-client-javascript 0.1.35
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/.github/workflows/on_create_release.yml +23 -0
- package/.github/workflows/on_merge_main.yml +38 -0
- package/.github/workflows/on_pull_request.yml +35 -0
- package/.prettierrc +5 -0
- package/LICENSE +21 -0
- package/README.md +118 -0
- package/application.d.ts +3 -0
- package/application.js +6 -0
- package/common.d.ts +4 -0
- package/common.js +9 -0
- package/documentation/application/CART.md +7290 -0
- package/documentation/application/CATALOG.md +9570 -0
- package/documentation/application/COMMON.md +448 -0
- package/documentation/application/COMMUNICATION.md +463 -0
- package/documentation/application/CONFIGURATION.md +2902 -0
- package/documentation/application/CONTENT.md +3350 -0
- package/documentation/application/FILESTORAGE.md +491 -0
- package/documentation/application/LEAD.md +1891 -0
- package/documentation/application/LOGISTIC.md +439 -0
- package/documentation/application/ORDER.md +3428 -0
- package/documentation/application/PAYMENT.md +5035 -0
- package/documentation/application/POSCART.md +7889 -0
- package/documentation/application/README.md +21 -0
- package/documentation/application/REWARDS.md +714 -0
- package/documentation/application/SHARE.md +729 -0
- package/documentation/application/THEME.md +5796 -0
- package/documentation/application/USER.md +4326 -0
- package/documentation/platform/ANALYTICS.md +1150 -0
- package/documentation/platform/AUDITTRAIL.md +572 -0
- package/documentation/platform/BILLING.md +2396 -0
- package/documentation/platform/CART.md +5539 -0
- package/documentation/platform/CATALOG.md +21624 -0
- package/documentation/platform/COMMON.md +448 -0
- package/documentation/platform/COMMUNICATION.md +5714 -0
- package/documentation/platform/COMPANYPROFILE.md +2141 -0
- package/documentation/platform/CONFIGURATION.md +7335 -0
- package/documentation/platform/CONTENT.md +8989 -0
- package/documentation/platform/DISCOUNT.md +773 -0
- package/documentation/platform/FILESTORAGE.md +994 -0
- package/documentation/platform/INVENTORY.md +1775 -0
- package/documentation/platform/LEAD.md +4736 -0
- package/documentation/platform/ORDER.md +3764 -0
- package/documentation/platform/PARTNER.md +216 -0
- package/documentation/platform/PAYMENT.md +3444 -0
- package/documentation/platform/README.md +27 -0
- package/documentation/platform/REWARDS.md +871 -0
- package/documentation/platform/SHARE.md +602 -0
- package/documentation/platform/THEME.md +35725 -0
- package/documentation/platform/USER.md +2305 -0
- package/documentation/platform/WEBHOOK.md +587 -0
- package/documentation/public/CONFIGURATION.md +448 -0
- package/documentation/public/INVENTORY.md +686 -0
- package/documentation/public/WEBHOOK.md +348 -0
- package/index.d.ts +10 -0
- package/index.js +18 -0
- package/jest.config.d.ts +4 -0
- package/jest.config.js +6 -0
- package/package.json +35 -0
- package/platform.d.ts +3 -0
- package/platform.js +6 -0
- package/public.d.ts +3 -0
- package/public.js +6 -0
- package/sdk/application/ApplicationAPIClient.d.ts +11 -0
- package/sdk/application/ApplicationAPIClient.js +44 -0
- package/sdk/application/ApplicationClient.d.ts +40 -0
- package/sdk/application/ApplicationClient.js +84 -0
- package/sdk/application/ApplicationConfig.d.ts +19 -0
- package/sdk/application/ApplicationConfig.js +55 -0
- package/sdk/application/ApplicationModels.d.ts +826 -0
- package/sdk/application/ApplicationModels.js +10474 -0
- package/sdk/application/client/CartApplicationClient.d.ts +432 -0
- package/sdk/application/client/CartApplicationClient.js +1066 -0
- package/sdk/application/client/CatalogApplicationClient.d.ts +694 -0
- package/sdk/application/client/CatalogApplicationClient.js +1629 -0
- package/sdk/application/client/CommonApplicationClient.d.ts +38 -0
- package/sdk/application/client/CommonApplicationClient.js +105 -0
- package/sdk/application/client/CommunicationApplicationClient.d.ts +39 -0
- package/sdk/application/client/CommunicationApplicationClient.js +131 -0
- package/sdk/application/client/ConfigurationApplicationClient.d.ts +210 -0
- package/sdk/application/client/ConfigurationApplicationClient.js +649 -0
- package/sdk/application/client/ContentApplicationClient.d.ts +256 -0
- package/sdk/application/client/ContentApplicationClient.js +785 -0
- package/sdk/application/client/FileStorageApplicationClient.d.ts +88 -0
- package/sdk/application/client/FileStorageApplicationClient.js +214 -0
- package/sdk/application/client/LeadApplicationClient.d.ts +90 -0
- package/sdk/application/client/LeadApplicationClient.js +264 -0
- package/sdk/application/client/LogisticApplicationClient.d.ts +42 -0
- package/sdk/application/client/LogisticApplicationClient.js +128 -0
- package/sdk/application/client/OrderApplicationClient.d.ts +190 -0
- package/sdk/application/client/OrderApplicationClient.js +479 -0
- package/sdk/application/client/PaymentApplicationClient.d.ts +454 -0
- package/sdk/application/client/PaymentApplicationClient.js +1378 -0
- package/sdk/application/client/PosCartApplicationClient.d.ts +449 -0
- package/sdk/application/client/PosCartApplicationClient.js +1123 -0
- package/sdk/application/client/RewardsApplicationClient.d.ts +93 -0
- package/sdk/application/client/RewardsApplicationClient.js +293 -0
- package/sdk/application/client/ShareApplicationClient.d.ts +87 -0
- package/sdk/application/client/ShareApplicationClient.js +268 -0
- package/sdk/application/client/ThemeApplicationClient.d.ts +52 -0
- package/sdk/application/client/ThemeApplicationClient.js +161 -0
- package/sdk/application/client/UserApplicationClient.d.ts +446 -0
- package/sdk/application/client/UserApplicationClient.js +1275 -0
- package/sdk/application/constructUrl.d.ts +5 -0
- package/sdk/application/constructUrl.js +13 -0
- package/sdk/application/index.d.ts +2 -0
- package/sdk/application/index.js +4 -0
- package/sdk/application/models/CartValidator.d.ts +29 -0
- package/sdk/application/models/CartValidator.js +223 -0
- package/sdk/application/models/CatalogValidator.d.ts +33 -0
- package/sdk/application/models/CatalogValidator.js +233 -0
- package/sdk/application/models/CommonValidator.d.ts +5 -0
- package/sdk/application/models/CommonValidator.js +18 -0
- package/sdk/application/models/CommunicationValidator.d.ts +6 -0
- package/sdk/application/models/CommunicationValidator.js +20 -0
- package/sdk/application/models/ConfigurationValidator.d.ts +19 -0
- package/sdk/application/models/ConfigurationValidator.js +88 -0
- package/sdk/application/models/ContentValidator.d.ts +22 -0
- package/sdk/application/models/ContentValidator.js +106 -0
- package/sdk/application/models/FileStorageValidator.d.ts +6 -0
- package/sdk/application/models/FileStorageValidator.js +24 -0
- package/sdk/application/models/LeadValidator.d.ts +10 -0
- package/sdk/application/models/LeadValidator.js +48 -0
- package/sdk/application/models/LogisticValidator.d.ts +6 -0
- package/sdk/application/models/LogisticValidator.js +22 -0
- package/sdk/application/models/OrderValidator.d.ts +15 -0
- package/sdk/application/models/OrderValidator.js +87 -0
- package/sdk/application/models/PaymentValidator.d.ts +40 -0
- package/sdk/application/models/PaymentValidator.js +235 -0
- package/sdk/application/models/PosCartValidator.d.ts +30 -0
- package/sdk/application/models/PosCartValidator.js +232 -0
- package/sdk/application/models/RewardsValidator.d.ts +10 -0
- package/sdk/application/models/RewardsValidator.js +43 -0
- package/sdk/application/models/ShareValidator.d.ts +10 -0
- package/sdk/application/models/ShareValidator.js +44 -0
- package/sdk/application/models/ThemeValidator.d.ts +7 -0
- package/sdk/application/models/ThemeValidator.js +27 -0
- package/sdk/application/models/UserValidator.d.ts +38 -0
- package/sdk/application/models/UserValidator.js +233 -0
- package/sdk/common/AxiosHelper.d.ts +1 -0
- package/sdk/common/AxiosHelper.js +141 -0
- package/sdk/common/Constant.d.ts +294 -0
- package/sdk/common/Constant.js +332 -0
- package/sdk/common/FDKError.d.ts +26 -0
- package/sdk/common/FDKError.js +51 -0
- package/sdk/common/Logger.d.ts +2 -0
- package/sdk/common/Logger.js +85 -0
- package/sdk/common/Paginator.d.ts +16 -0
- package/sdk/common/Paginator.js +26 -0
- package/sdk/common/RequestSigner.d.ts +1 -0
- package/sdk/common/RequestSigner.js +306 -0
- package/sdk/common/Utility.d.ts +9 -0
- package/sdk/common/Utility.js +86 -0
- package/sdk/common/utils.d.ts +14 -0
- package/sdk/common/utils.js +165 -0
- package/sdk/platform/OAuthClient.d.ts +26 -0
- package/sdk/platform/OAuthClient.js +221 -0
- package/sdk/platform/PlatformAPIClient.d.ts +12 -0
- package/sdk/platform/PlatformAPIClient.js +43 -0
- package/sdk/platform/PlatformApplicationClient.d.ts +24398 -0
- package/sdk/platform/PlatformApplicationClient.js +23185 -0
- package/sdk/platform/PlatformApplicationModels.d.ts +333 -0
- package/sdk/platform/PlatformApplicationModels.js +21262 -0
- package/sdk/platform/PlatformClient.d.ts +9535 -0
- package/sdk/platform/PlatformClient.js +12336 -0
- package/sdk/platform/PlatformConfig.d.ts +29 -0
- package/sdk/platform/PlatformConfig.js +36 -0
- package/sdk/platform/PlatformModels.d.ts +1396 -0
- package/sdk/platform/PlatformModels.js +19222 -0
- package/sdk/platform/client/AnalyticsPlatformClient.d.ts +84 -0
- package/sdk/platform/client/AnalyticsPlatformClient.js +215 -0
- package/sdk/platform/client/AuditTrailPlatformClient.d.ts +38 -0
- package/sdk/platform/client/AuditTrailPlatformClient.js +133 -0
- package/sdk/platform/client/BillingPlatformClient.d.ts +109 -0
- package/sdk/platform/client/BillingPlatformClient.js +381 -0
- package/sdk/platform/client/CatalogPlatformClient.d.ts +806 -0
- package/sdk/platform/client/CatalogPlatformClient.js +2462 -0
- package/sdk/platform/client/CommonPlatformClient.d.ts +30 -0
- package/sdk/platform/client/CommonPlatformClient.js +84 -0
- package/sdk/platform/client/CommunicationPlatformClient.d.ts +26 -0
- package/sdk/platform/client/CommunicationPlatformClient.js +72 -0
- package/sdk/platform/client/CompanyProfilePlatformClient.d.ts +182 -0
- package/sdk/platform/client/CompanyProfilePlatformClient.js +540 -0
- package/sdk/platform/client/ConfigurationPlatformClient.d.ts +277 -0
- package/sdk/platform/client/ConfigurationPlatformClient.js +806 -0
- package/sdk/platform/client/DiscountPlatformClient.d.ts +118 -0
- package/sdk/platform/client/DiscountPlatformClient.js +364 -0
- package/sdk/platform/client/FileStoragePlatformClient.d.ts +111 -0
- package/sdk/platform/client/FileStoragePlatformClient.js +268 -0
- package/sdk/platform/client/InventoryPlatformClient.d.ts +125 -0
- package/sdk/platform/client/InventoryPlatformClient.js +409 -0
- package/sdk/platform/client/LeadPlatformClient.d.ts +150 -0
- package/sdk/platform/client/LeadPlatformClient.js +439 -0
- package/sdk/platform/client/OrderPlatformClient.d.ts +190 -0
- package/sdk/platform/client/OrderPlatformClient.js +521 -0
- package/sdk/platform/client/PaymentPlatformClient.d.ts +98 -0
- package/sdk/platform/client/PaymentPlatformClient.js +331 -0
- package/sdk/platform/client/WebhookPlatformClient.d.ts +64 -0
- package/sdk/platform/client/WebhookPlatformClient.js +207 -0
- package/sdk/platform/index.d.ts +2 -0
- package/sdk/platform/index.js +4 -0
- package/sdk/platform/models/AnalyticsValidator.d.ts +7 -0
- package/sdk/platform/models/AnalyticsValidator.js +36 -0
- package/sdk/platform/models/AuditTrailValidator.d.ts +7 -0
- package/sdk/platform/models/AuditTrailValidator.js +26 -0
- package/sdk/platform/models/BillingValidator.d.ts +15 -0
- package/sdk/platform/models/BillingValidator.js +72 -0
- package/sdk/platform/models/CartValidator.d.ts +0 -0
- package/sdk/platform/models/CartValidator.js +0 -0
- package/sdk/platform/models/CatalogValidator.d.ts +74 -0
- package/sdk/platform/models/CatalogValidator.js +484 -0
- package/sdk/platform/models/CommonValidator.d.ts +5 -0
- package/sdk/platform/models/CommonValidator.js +18 -0
- package/sdk/platform/models/CommunicationValidator.d.ts +4 -0
- package/sdk/platform/models/CommunicationValidator.js +11 -0
- package/sdk/platform/models/CompanyProfileValidator.d.ts +17 -0
- package/sdk/platform/models/CompanyProfileValidator.js +93 -0
- package/sdk/platform/models/ConfigurationValidator.d.ts +21 -0
- package/sdk/platform/models/ConfigurationValidator.js +134 -0
- package/sdk/platform/models/ContentValidator.d.ts +0 -0
- package/sdk/platform/models/ContentValidator.js +0 -0
- package/sdk/platform/models/DiscountValidator.d.ts +13 -0
- package/sdk/platform/models/DiscountValidator.js +75 -0
- package/sdk/platform/models/FileStorageValidator.d.ts +9 -0
- package/sdk/platform/models/FileStorageValidator.js +44 -0
- package/sdk/platform/models/InventoryValidator.d.ts +15 -0
- package/sdk/platform/models/InventoryValidator.js +81 -0
- package/sdk/platform/models/LeadValidator.d.ts +14 -0
- package/sdk/platform/models/LeadValidator.js +78 -0
- package/sdk/platform/models/OrderValidator.d.ts +14 -0
- package/sdk/platform/models/OrderValidator.js +110 -0
- package/sdk/platform/models/PartnerValidator.d.ts +0 -0
- package/sdk/platform/models/PartnerValidator.js +0 -0
- package/sdk/platform/models/PaymentValidator.d.ts +13 -0
- package/sdk/platform/models/PaymentValidator.js +65 -0
- package/sdk/platform/models/RewardsValidator.d.ts +0 -0
- package/sdk/platform/models/RewardsValidator.js +0 -0
- package/sdk/platform/models/ShareValidator.d.ts +0 -0
- package/sdk/platform/models/ShareValidator.js +0 -0
- package/sdk/platform/models/ThemeValidator.d.ts +0 -0
- package/sdk/platform/models/ThemeValidator.js +0 -0
- package/sdk/platform/models/UserValidator.d.ts +0 -0
- package/sdk/platform/models/UserValidator.js +0 -0
- package/sdk/platform/models/WebhookValidator.d.ts +9 -0
- package/sdk/platform/models/WebhookValidator.js +42 -0
- package/sdk/public/PublicAPIClient.d.ts +11 -0
- package/sdk/public/PublicAPIClient.js +38 -0
- package/sdk/public/PublicClient.d.ts +12 -0
- package/sdk/public/PublicClient.js +24 -0
- package/sdk/public/PublicConfig.d.ts +10 -0
- package/sdk/public/PublicConfig.js +12 -0
- package/sdk/public/PublicModels.d.ts +50 -0
- package/sdk/public/PublicModels.js +712 -0
- package/sdk/public/client/ConfigurationPublicClient.d.ts +38 -0
- package/sdk/public/client/ConfigurationPublicClient.js +102 -0
- package/sdk/public/client/InventoryPublicClient.d.ts +81 -0
- package/sdk/public/client/InventoryPublicClient.js +239 -0
- package/sdk/public/client/WebhookPublicClient.d.ts +28 -0
- package/sdk/public/client/WebhookPublicClient.js +92 -0
- package/sdk/public/constructUrl.d.ts +5 -0
- package/sdk/public/constructUrl.js +13 -0
- package/sdk/public/index.d.ts +2 -0
- package/sdk/public/index.js +4 -0
- package/sdk/public/models/ConfigurationValidator.d.ts +5 -0
- package/sdk/public/models/ConfigurationValidator.js +18 -0
- package/sdk/public/models/InventoryValidator.d.ts +9 -0
- package/sdk/public/models/InventoryValidator.js +43 -0
- package/sdk/public/models/WebhookValidator.d.ts +5 -0
- package/sdk/public/models/WebhookValidator.js +14 -0
- package/tests/application/catalog.spec.js +47 -0
- package/tests/common/action-url.spec.js +35 -0
- package/tests/common/schema/action-url.json +163 -0
- package/tests/common/schema/url-action.json +667 -0
- package/tests/common/url-action.spec.js +48 -0
- package/tests/helpers/cookie.helper.js +31 -0
- package/tests/helpers/oauth.helper.js +43 -0
- package/tests/platform/catalog.spec.js +49 -0
- package/tests/public/location.spec.js +39 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
const Joi = require("joi");
|
|
2
|
+
const Validator = require("../PlatformModels");
|
|
3
|
+
class OrderValidator {
|
|
4
|
+
static shipmentStatusUpdate() {
|
|
5
|
+
return Joi.object({
|
|
6
|
+
body: Validator.UpdateShipmentStatusBody().required(),
|
|
7
|
+
}).required();
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
static activityStatus() {
|
|
11
|
+
return Joi.object({
|
|
12
|
+
bagId: Joi.string().allow("").required(),
|
|
13
|
+
}).required();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
static storeProcessShipmentUpdate() {
|
|
17
|
+
return Joi.object({
|
|
18
|
+
body: Validator.UpdateProcessShipmenstRequestBody().required(),
|
|
19
|
+
}).required();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
static checkRefund() {
|
|
23
|
+
return Joi.object({
|
|
24
|
+
shipmentId: Joi.string().allow("").required(),
|
|
25
|
+
}).required();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
static shipmentBagsCanBreak() {
|
|
29
|
+
return Joi.object({
|
|
30
|
+
body: Validator.CanBreakRequestBody().required(),
|
|
31
|
+
}).required();
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
static getOrdersByCompanyId() {
|
|
35
|
+
return Joi.object({
|
|
36
|
+
pageNo: Joi.string().allow(""),
|
|
37
|
+
pageSize: Joi.string().allow(""),
|
|
38
|
+
fromDate: Joi.string().allow(""),
|
|
39
|
+
toDate: Joi.string().allow(""),
|
|
40
|
+
isPrioritySort: Joi.boolean(),
|
|
41
|
+
lockStatus: Joi.boolean(),
|
|
42
|
+
userId: Joi.string().allow(""),
|
|
43
|
+
q: Joi.string().allow(""),
|
|
44
|
+
stage: Joi.string().allow(""),
|
|
45
|
+
salesChannels: Joi.string().allow(""),
|
|
46
|
+
orderId: Joi.string().allow(""),
|
|
47
|
+
stores: Joi.string().allow(""),
|
|
48
|
+
deploymentStores: Joi.string().allow(""),
|
|
49
|
+
status: Joi.string().allow(""),
|
|
50
|
+
dp: Joi.string().allow(""),
|
|
51
|
+
filterType: Joi.string().allow(""),
|
|
52
|
+
}).required();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
static getOrderLanesCountByCompanyId() {
|
|
56
|
+
return Joi.object({
|
|
57
|
+
pageNo: Joi.string().allow(""),
|
|
58
|
+
pageSize: Joi.string().allow(""),
|
|
59
|
+
fromDate: Joi.string().allow(""),
|
|
60
|
+
toDate: Joi.string().allow(""),
|
|
61
|
+
q: Joi.string().allow(""),
|
|
62
|
+
stage: Joi.string().allow(""),
|
|
63
|
+
salesChannels: Joi.string().allow(""),
|
|
64
|
+
orderId: Joi.string().allow(""),
|
|
65
|
+
stores: Joi.string().allow(""),
|
|
66
|
+
status: Joi.string().allow(""),
|
|
67
|
+
filterType: Joi.string().allow(""),
|
|
68
|
+
}).required();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
static getOrderDetails() {
|
|
72
|
+
return Joi.object({
|
|
73
|
+
orderId: Joi.string().allow(""),
|
|
74
|
+
next: Joi.string().allow(""),
|
|
75
|
+
previous: Joi.string().allow(""),
|
|
76
|
+
}).required();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
static getPicklistOrdersByCompanyId() {
|
|
80
|
+
return Joi.object({
|
|
81
|
+
pageNo: Joi.string().allow(""),
|
|
82
|
+
pageSize: Joi.string().allow(""),
|
|
83
|
+
fromDate: Joi.string().allow(""),
|
|
84
|
+
toDate: Joi.string().allow(""),
|
|
85
|
+
q: Joi.string().allow(""),
|
|
86
|
+
stage: Joi.string().allow(""),
|
|
87
|
+
salesChannels: Joi.string().allow(""),
|
|
88
|
+
orderId: Joi.string().allow(""),
|
|
89
|
+
stores: Joi.string().allow(""),
|
|
90
|
+
status: Joi.string().allow(""),
|
|
91
|
+
filterType: Joi.string().allow(""),
|
|
92
|
+
}).required();
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
static getShipmentAddress() {
|
|
96
|
+
return Joi.object({
|
|
97
|
+
shipmentId: Joi.string().allow("").required(),
|
|
98
|
+
addressCategory: Joi.string().allow("").required(),
|
|
99
|
+
}).required();
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
static updateShipmentAddress() {
|
|
103
|
+
return Joi.object({
|
|
104
|
+
shipmentId: Joi.string().allow("").required(),
|
|
105
|
+
addressCategory: Joi.string().allow("").required(),
|
|
106
|
+
body: Validator.UpdateShipmentAddressRequest().required(),
|
|
107
|
+
}).required();
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
module.exports = OrderValidator;
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export = PaymentValidator;
|
|
2
|
+
declare class PaymentValidator {
|
|
3
|
+
static getAllPayouts(): any;
|
|
4
|
+
static savePayout(): any;
|
|
5
|
+
static updatePayout(): any;
|
|
6
|
+
static activateAndDectivatePayout(): any;
|
|
7
|
+
static deletePayout(): any;
|
|
8
|
+
static getSubscriptionPaymentMethod(): any;
|
|
9
|
+
static deleteSubscriptionPaymentMethod(): any;
|
|
10
|
+
static getSubscriptionConfig(): any;
|
|
11
|
+
static saveSubscriptionSetupIntent(): any;
|
|
12
|
+
static verifyIfscCode(): any;
|
|
13
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
const Joi = require("joi");
|
|
2
|
+
const Validator = require("../PlatformModels");
|
|
3
|
+
class PaymentValidator {
|
|
4
|
+
static getAllPayouts() {
|
|
5
|
+
return Joi.object({
|
|
6
|
+
uniqueExternalId: Joi.string().allow(""),
|
|
7
|
+
}).required();
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
static savePayout() {
|
|
11
|
+
return Joi.object({
|
|
12
|
+
body: Validator.PayoutRequest().required(),
|
|
13
|
+
}).required();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
static updatePayout() {
|
|
17
|
+
return Joi.object({
|
|
18
|
+
uniqueTransferNo: Joi.string().allow("").required(),
|
|
19
|
+
body: Validator.PayoutRequest().required(),
|
|
20
|
+
}).required();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
static activateAndDectivatePayout() {
|
|
24
|
+
return Joi.object({
|
|
25
|
+
uniqueTransferNo: Joi.string().allow("").required(),
|
|
26
|
+
body: Validator.UpdatePayoutRequest().required(),
|
|
27
|
+
}).required();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
static deletePayout() {
|
|
31
|
+
return Joi.object({
|
|
32
|
+
uniqueTransferNo: Joi.string().allow("").required(),
|
|
33
|
+
}).required();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
static getSubscriptionPaymentMethod() {
|
|
37
|
+
return Joi.object({
|
|
38
|
+
uniqueExternalId: Joi.string().allow(""),
|
|
39
|
+
}).required();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
static deleteSubscriptionPaymentMethod() {
|
|
43
|
+
return Joi.object({
|
|
44
|
+
uniqueExternalId: Joi.string().allow("").required(),
|
|
45
|
+
paymentMethodId: Joi.string().allow("").required(),
|
|
46
|
+
}).required();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
static getSubscriptionConfig() {
|
|
50
|
+
return Joi.object({}).required();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
static saveSubscriptionSetupIntent() {
|
|
54
|
+
return Joi.object({
|
|
55
|
+
body: Validator.SaveSubscriptionSetupIntentRequest().required(),
|
|
56
|
+
}).required();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
static verifyIfscCode() {
|
|
60
|
+
return Joi.object({
|
|
61
|
+
ifscCode: Joi.string().allow(""),
|
|
62
|
+
}).required();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
module.exports = PaymentValidator;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export = WebhookValidator;
|
|
2
|
+
declare class WebhookValidator {
|
|
3
|
+
static getSubscribersByCompany(): any;
|
|
4
|
+
static registerSubscriberToEvent(): any;
|
|
5
|
+
static updateSubscriberConfig(): any;
|
|
6
|
+
static getSubscribersByExtensionId(): any;
|
|
7
|
+
static getSubscriberById(): any;
|
|
8
|
+
static fetchAllEventConfigurations(): any;
|
|
9
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const Joi = require("joi");
|
|
2
|
+
const Validator = require("../PlatformModels");
|
|
3
|
+
class WebhookValidator {
|
|
4
|
+
static getSubscribersByCompany() {
|
|
5
|
+
return Joi.object({
|
|
6
|
+
pageNo: Joi.number(),
|
|
7
|
+
pageSize: Joi.number(),
|
|
8
|
+
extensionId: Joi.string().allow(""),
|
|
9
|
+
}).required();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
static registerSubscriberToEvent() {
|
|
13
|
+
return Joi.object({
|
|
14
|
+
body: Validator.SubscriberConfig().required(),
|
|
15
|
+
}).required();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
static updateSubscriberConfig() {
|
|
19
|
+
return Joi.object({
|
|
20
|
+
body: Validator.SubscriberConfig().required(),
|
|
21
|
+
}).required();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
static getSubscribersByExtensionId() {
|
|
25
|
+
return Joi.object({
|
|
26
|
+
pageNo: Joi.number(),
|
|
27
|
+
pageSize: Joi.number(),
|
|
28
|
+
extensionId: Joi.string().allow("").required(),
|
|
29
|
+
}).required();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
static getSubscriberById() {
|
|
33
|
+
return Joi.object({
|
|
34
|
+
subscriberId: Joi.number().required(),
|
|
35
|
+
}).required();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
static fetchAllEventConfigurations() {
|
|
39
|
+
return Joi.object({}).required();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
module.exports = WebhookValidator;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export = PublicAPIClient;
|
|
2
|
+
declare class PublicAPIClient {
|
|
3
|
+
/**
|
|
4
|
+
* @param {object} conf
|
|
5
|
+
* @param {string} method
|
|
6
|
+
* @param {string} url
|
|
7
|
+
* @param {object} query
|
|
8
|
+
* @param {object} body
|
|
9
|
+
*/
|
|
10
|
+
static execute(conf: object, method: string, url: string, query: object, body: object, xHeaders: any): any;
|
|
11
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const { fdkAxios } = require("../common/AxiosHelper");
|
|
2
|
+
|
|
3
|
+
class PublicAPIClient {
|
|
4
|
+
/**
|
|
5
|
+
* @param {object} conf
|
|
6
|
+
* @param {string} method
|
|
7
|
+
* @param {string} url
|
|
8
|
+
* @param {object} query
|
|
9
|
+
* @param {object} body
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
static execute(conf, method, url, query, body, xHeaders) {
|
|
13
|
+
let headers = {};
|
|
14
|
+
headers["User-Agent"] = conf.userAgent ? conf.userAgent : "";
|
|
15
|
+
headers["Accept-Language"] = conf.language ? conf.language : "en-IN";
|
|
16
|
+
headers["x-currency-code"] = conf.currency ? conf.currency : "INR";
|
|
17
|
+
|
|
18
|
+
const extraHeaders = conf.extraHeaders.reduce((acc, curr) => {
|
|
19
|
+
acc = { ...acc, ...curr };
|
|
20
|
+
return acc;
|
|
21
|
+
}, {});
|
|
22
|
+
|
|
23
|
+
const rawRequest = {
|
|
24
|
+
method: method,
|
|
25
|
+
url: url,
|
|
26
|
+
params: query,
|
|
27
|
+
data: body,
|
|
28
|
+
headers: {
|
|
29
|
+
...headers,
|
|
30
|
+
...extraHeaders,
|
|
31
|
+
...xHeaders,
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
return fdkAxios.request(rawRequest);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
module.exports = PublicAPIClient;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export = PublicClient;
|
|
2
|
+
declare class PublicClient {
|
|
3
|
+
constructor(config: any);
|
|
4
|
+
config: any;
|
|
5
|
+
configuration: Configuration;
|
|
6
|
+
webhook: Webhook;
|
|
7
|
+
inventory: Inventory;
|
|
8
|
+
setExtraHeaders(header: any): void;
|
|
9
|
+
}
|
|
10
|
+
import Configuration = require("./client/ConfigurationPublicClient");
|
|
11
|
+
import Webhook = require("./client/WebhookPublicClient");
|
|
12
|
+
import Inventory = require("./client/InventoryPublicClient");
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const Configuration = require("./client/ConfigurationPublicClient");
|
|
2
|
+
const Webhook = require("./client/WebhookPublicClient");
|
|
3
|
+
const Inventory = require("./client/InventoryPublicClient");
|
|
4
|
+
|
|
5
|
+
const { FDKClientValidationError } = require("../common/FDKError");
|
|
6
|
+
|
|
7
|
+
class PublicClient {
|
|
8
|
+
constructor(config) {
|
|
9
|
+
this.config = config;
|
|
10
|
+
this.configuration = new Configuration(config);
|
|
11
|
+
this.webhook = new Webhook(config);
|
|
12
|
+
this.inventory = new Inventory(config);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
setExtraHeaders(header) {
|
|
16
|
+
if (typeof header === "object") {
|
|
17
|
+
this.config.extraHeaders.push(header);
|
|
18
|
+
} else {
|
|
19
|
+
throw new FDKClientValidationError("Context value should be an object");
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
module.exports = PublicClient;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
class PublicConfig {
|
|
2
|
+
/** @param {object} _conf */
|
|
3
|
+
constructor(_conf, _opts) {
|
|
4
|
+
this.domain = _conf.domain || "https://api.fynd.com";
|
|
5
|
+
this.userAgent = _conf.userAgent || "";
|
|
6
|
+
this.language = _conf.language;
|
|
7
|
+
this.currency = _conf.currency;
|
|
8
|
+
this.extraHeaders = [];
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
module.exports = PublicConfig;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export = Validator;
|
|
2
|
+
declare class Validator {
|
|
3
|
+
static ApplicationResponse(): any;
|
|
4
|
+
static Currency(): any;
|
|
5
|
+
static Domain(): any;
|
|
6
|
+
static ApplicationWebsite(): any;
|
|
7
|
+
static ApplicationCors(): any;
|
|
8
|
+
static ApplicationAuth(): any;
|
|
9
|
+
static ApplicationRedirections(): any;
|
|
10
|
+
static ApplicationMeta(): any;
|
|
11
|
+
static SecureUrl(): any;
|
|
12
|
+
static Application(): any;
|
|
13
|
+
static NotFound(): any;
|
|
14
|
+
static BadRequest(): any;
|
|
15
|
+
static Page(): any;
|
|
16
|
+
static LocationDefaultLanguage(): any;
|
|
17
|
+
static LocationDefaultCurrency(): any;
|
|
18
|
+
static LocationCountry(): any;
|
|
19
|
+
static Locations(): any;
|
|
20
|
+
static EventConfig(): any;
|
|
21
|
+
static EventConfigList(): any;
|
|
22
|
+
static EventConfigResponse(): any;
|
|
23
|
+
static SubscriberConfigList(): any;
|
|
24
|
+
static EventProcessedStatus(): any;
|
|
25
|
+
static EventPayload(): any;
|
|
26
|
+
static SubscriberConfig(): any;
|
|
27
|
+
static SubscriberResponse(): any;
|
|
28
|
+
static SubscriberEvent(): any;
|
|
29
|
+
static AuthMeta(): any;
|
|
30
|
+
static Association(): any;
|
|
31
|
+
static EventConfigBase(): any;
|
|
32
|
+
static EmailJobMetrics(): any;
|
|
33
|
+
static ResponseEnvelopeEmailJobMetrics(): any;
|
|
34
|
+
static GCompany(): any;
|
|
35
|
+
static GStore(): any;
|
|
36
|
+
static Metum(): any;
|
|
37
|
+
static ResponseEnvelopeSlingshotConfigurationDetail(): any;
|
|
38
|
+
static SlingshotConfigurationDetail(): any;
|
|
39
|
+
static SlingshotIntegration(): any;
|
|
40
|
+
static StoreData(): any;
|
|
41
|
+
static ApikeyModel(): any;
|
|
42
|
+
static ResponseEnvelopeApikeyModel(): any;
|
|
43
|
+
static DataTresholdDTO(): any;
|
|
44
|
+
static GenericDTO(): any;
|
|
45
|
+
static JobConfigDTO(): any;
|
|
46
|
+
static ResponseEnvelopeJobConfigDTO(): any;
|
|
47
|
+
static TaskDTO(): any;
|
|
48
|
+
static ResponseEnvelopeListJobConfigDTO(): any;
|
|
49
|
+
static ResponseEnvelopeObject(): any;
|
|
50
|
+
}
|