@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,521 @@
|
|
|
1
|
+
const Paginator = require("../../common/Paginator");
|
|
2
|
+
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
3
|
+
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
4
|
+
const OrderValidator = require("../models/OrderValidator");
|
|
5
|
+
class Order {
|
|
6
|
+
constructor(config) {
|
|
7
|
+
this.config = config;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @param {Object} arg - Arg object.
|
|
12
|
+
* @param {UpdateShipmentStatusBody} arg.body
|
|
13
|
+
* @summary: Update status of Shipment
|
|
14
|
+
* @description: Update Shipment Status
|
|
15
|
+
*/
|
|
16
|
+
shipmentStatusUpdate({ body } = {}) {
|
|
17
|
+
const { error } = OrderValidator.shipmentStatusUpdate().validate(
|
|
18
|
+
{
|
|
19
|
+
body,
|
|
20
|
+
},
|
|
21
|
+
{ abortEarly: false, allowUnknown: true }
|
|
22
|
+
);
|
|
23
|
+
if (error) {
|
|
24
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const query_params = {};
|
|
28
|
+
|
|
29
|
+
const xHeaders = {};
|
|
30
|
+
|
|
31
|
+
return PlatformAPIClient.execute(
|
|
32
|
+
this.config,
|
|
33
|
+
"post",
|
|
34
|
+
`/service/platform/order/v1.0/company/${this.config.companyId}/actions/status`,
|
|
35
|
+
query_params,
|
|
36
|
+
body,
|
|
37
|
+
xHeaders
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @param {Object} arg - Arg object.
|
|
43
|
+
* @param {string} arg.bagId - Bag Id
|
|
44
|
+
* @summary: Get Activity Status
|
|
45
|
+
* @description: Get Activity Status
|
|
46
|
+
*/
|
|
47
|
+
activityStatus({ bagId } = {}) {
|
|
48
|
+
const { error } = OrderValidator.activityStatus().validate(
|
|
49
|
+
{
|
|
50
|
+
bagId,
|
|
51
|
+
},
|
|
52
|
+
{ abortEarly: false, allowUnknown: true }
|
|
53
|
+
);
|
|
54
|
+
if (error) {
|
|
55
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const query_params = {};
|
|
59
|
+
query_params["bag_id"] = bagId;
|
|
60
|
+
|
|
61
|
+
const xHeaders = {};
|
|
62
|
+
|
|
63
|
+
return PlatformAPIClient.execute(
|
|
64
|
+
this.config,
|
|
65
|
+
"get",
|
|
66
|
+
`/service/platform/order/v1.0/company/${this.config.companyId}/actions/activity/status`,
|
|
67
|
+
query_params,
|
|
68
|
+
undefined,
|
|
69
|
+
xHeaders
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* @param {Object} arg - Arg object.
|
|
75
|
+
* @param {UpdateProcessShipmenstRequestBody} arg.body
|
|
76
|
+
* @summary: Update Store Process-Shipment
|
|
77
|
+
* @description: Update Store Process-Shipment
|
|
78
|
+
*/
|
|
79
|
+
storeProcessShipmentUpdate({ body } = {}) {
|
|
80
|
+
const { error } = OrderValidator.storeProcessShipmentUpdate().validate(
|
|
81
|
+
{
|
|
82
|
+
body,
|
|
83
|
+
},
|
|
84
|
+
{ abortEarly: false, allowUnknown: true }
|
|
85
|
+
);
|
|
86
|
+
if (error) {
|
|
87
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const query_params = {};
|
|
91
|
+
|
|
92
|
+
const xHeaders = {};
|
|
93
|
+
|
|
94
|
+
return PlatformAPIClient.execute(
|
|
95
|
+
this.config,
|
|
96
|
+
"post",
|
|
97
|
+
`/service/platform/order/v1.0/company/${this.config.companyId}/actions/store/process-shipments`,
|
|
98
|
+
query_params,
|
|
99
|
+
body,
|
|
100
|
+
xHeaders
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* @param {Object} arg - Arg object.
|
|
106
|
+
* @param {string} arg.shipmentId - Shipment Id
|
|
107
|
+
* @summary: Check Refund is available or not
|
|
108
|
+
* @description: Check Refund is available or not
|
|
109
|
+
*/
|
|
110
|
+
checkRefund({ shipmentId } = {}) {
|
|
111
|
+
const { error } = OrderValidator.checkRefund().validate(
|
|
112
|
+
{
|
|
113
|
+
shipmentId,
|
|
114
|
+
},
|
|
115
|
+
{ abortEarly: false, allowUnknown: true }
|
|
116
|
+
);
|
|
117
|
+
if (error) {
|
|
118
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const query_params = {};
|
|
122
|
+
|
|
123
|
+
const xHeaders = {};
|
|
124
|
+
|
|
125
|
+
return PlatformAPIClient.execute(
|
|
126
|
+
this.config,
|
|
127
|
+
"get",
|
|
128
|
+
`/service/platform/order/v1.0/company/${this.config.companyId}/actions/check-refund/${shipmentId}`,
|
|
129
|
+
query_params,
|
|
130
|
+
undefined,
|
|
131
|
+
xHeaders
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* @param {Object} arg - Arg object.
|
|
137
|
+
* @param {CanBreakRequestBody} arg.body
|
|
138
|
+
* @summary: Decides if Shipment bags can break
|
|
139
|
+
* @description: Decides if Shipment bags can break
|
|
140
|
+
*/
|
|
141
|
+
shipmentBagsCanBreak({ body } = {}) {
|
|
142
|
+
const { error } = OrderValidator.shipmentBagsCanBreak().validate(
|
|
143
|
+
{
|
|
144
|
+
body,
|
|
145
|
+
},
|
|
146
|
+
{ abortEarly: false, allowUnknown: true }
|
|
147
|
+
);
|
|
148
|
+
if (error) {
|
|
149
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const query_params = {};
|
|
153
|
+
|
|
154
|
+
const xHeaders = {};
|
|
155
|
+
|
|
156
|
+
return PlatformAPIClient.execute(
|
|
157
|
+
this.config,
|
|
158
|
+
"post",
|
|
159
|
+
`/service/platform/order/v1.0/company/${this.config.companyId}/actions/can-break`,
|
|
160
|
+
query_params,
|
|
161
|
+
body,
|
|
162
|
+
xHeaders
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* @param {Object} arg - Arg object.
|
|
168
|
+
* @param {string} [arg.pageNo] - Current page number
|
|
169
|
+
* @param {string} [arg.pageSize] - Page limit
|
|
170
|
+
* @param {string} [arg.fromDate] - From Date
|
|
171
|
+
* @param {string} [arg.toDate] - To Date
|
|
172
|
+
* @param {boolean} [arg.isPrioritySort] - Sorting Order
|
|
173
|
+
* @param {boolean} [arg.lockStatus] - Hide Lock Status
|
|
174
|
+
* @param {string} [arg.userId] - User Id
|
|
175
|
+
* @param {string} [arg.q] - Keyword for Search
|
|
176
|
+
* @param {string} [arg.stage] - Specefic Order Stage
|
|
177
|
+
* @param {string} [arg.salesChannels] - Selected Sales Channel
|
|
178
|
+
* @param {string} [arg.orderId] - Order Id
|
|
179
|
+
* @param {string} [arg.stores] - Selected Stores
|
|
180
|
+
* @param {string} [arg.deploymentStores] - Selected Deployment Stores
|
|
181
|
+
* @param {string} [arg.status] - Status of order
|
|
182
|
+
* @param {string} [arg.dp] - Delivery Partners
|
|
183
|
+
* @param {string} [arg.filterType] - Filters
|
|
184
|
+
* @summary: Get Orders for company based on Company Id
|
|
185
|
+
* @description: Get Orders
|
|
186
|
+
*/
|
|
187
|
+
getOrdersByCompanyId({
|
|
188
|
+
pageNo,
|
|
189
|
+
pageSize,
|
|
190
|
+
fromDate,
|
|
191
|
+
toDate,
|
|
192
|
+
isPrioritySort,
|
|
193
|
+
lockStatus,
|
|
194
|
+
userId,
|
|
195
|
+
q,
|
|
196
|
+
stage,
|
|
197
|
+
salesChannels,
|
|
198
|
+
orderId,
|
|
199
|
+
stores,
|
|
200
|
+
deploymentStores,
|
|
201
|
+
status,
|
|
202
|
+
dp,
|
|
203
|
+
filterType,
|
|
204
|
+
} = {}) {
|
|
205
|
+
const { error } = OrderValidator.getOrdersByCompanyId().validate(
|
|
206
|
+
{
|
|
207
|
+
pageNo,
|
|
208
|
+
pageSize,
|
|
209
|
+
fromDate,
|
|
210
|
+
toDate,
|
|
211
|
+
isPrioritySort,
|
|
212
|
+
lockStatus,
|
|
213
|
+
userId,
|
|
214
|
+
q,
|
|
215
|
+
stage,
|
|
216
|
+
salesChannels,
|
|
217
|
+
orderId,
|
|
218
|
+
stores,
|
|
219
|
+
deploymentStores,
|
|
220
|
+
status,
|
|
221
|
+
dp,
|
|
222
|
+
filterType,
|
|
223
|
+
},
|
|
224
|
+
{ abortEarly: false, allowUnknown: true }
|
|
225
|
+
);
|
|
226
|
+
if (error) {
|
|
227
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
const query_params = {};
|
|
231
|
+
query_params["page_no"] = pageNo;
|
|
232
|
+
query_params["page_size"] = pageSize;
|
|
233
|
+
query_params["from_date"] = fromDate;
|
|
234
|
+
query_params["to_date"] = toDate;
|
|
235
|
+
query_params["is_priority_sort"] = isPrioritySort;
|
|
236
|
+
query_params["lock_status"] = lockStatus;
|
|
237
|
+
query_params["user_id"] = userId;
|
|
238
|
+
query_params["q"] = q;
|
|
239
|
+
query_params["stage"] = stage;
|
|
240
|
+
query_params["sales_channels"] = salesChannels;
|
|
241
|
+
query_params["order_id"] = orderId;
|
|
242
|
+
query_params["stores"] = stores;
|
|
243
|
+
query_params["deployment_stores"] = deploymentStores;
|
|
244
|
+
query_params["status"] = status;
|
|
245
|
+
query_params["dp"] = dp;
|
|
246
|
+
query_params["filter_type"] = filterType;
|
|
247
|
+
|
|
248
|
+
const xHeaders = {};
|
|
249
|
+
|
|
250
|
+
return PlatformAPIClient.execute(
|
|
251
|
+
this.config,
|
|
252
|
+
"get",
|
|
253
|
+
`/service/platform/order/v1.0/company/${this.config.companyId}/orders`,
|
|
254
|
+
query_params,
|
|
255
|
+
undefined,
|
|
256
|
+
xHeaders
|
|
257
|
+
);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* @param {Object} arg - Arg object.
|
|
262
|
+
* @param {string} [arg.pageNo] - Current page number
|
|
263
|
+
* @param {string} [arg.pageSize] - Page limit
|
|
264
|
+
* @param {string} [arg.fromDate] - From Date
|
|
265
|
+
* @param {string} [arg.toDate] - To Date
|
|
266
|
+
* @param {string} [arg.q] - Keyword for Search
|
|
267
|
+
* @param {string} [arg.stage] - Specefic Order Stage
|
|
268
|
+
* @param {string} [arg.salesChannels] - Selected Sales Channel
|
|
269
|
+
* @param {string} [arg.orderId] - Order Id
|
|
270
|
+
* @param {string} [arg.stores] - Selected Stores
|
|
271
|
+
* @param {string} [arg.status] - Status of order
|
|
272
|
+
* @param {string} [arg.filterType] - Filters
|
|
273
|
+
* @summary: Get Order Lanes Count for company based on Company Id
|
|
274
|
+
* @description: Get Orders Seperate Lane Count
|
|
275
|
+
*/
|
|
276
|
+
getOrderLanesCountByCompanyId({
|
|
277
|
+
pageNo,
|
|
278
|
+
pageSize,
|
|
279
|
+
fromDate,
|
|
280
|
+
toDate,
|
|
281
|
+
q,
|
|
282
|
+
stage,
|
|
283
|
+
salesChannels,
|
|
284
|
+
orderId,
|
|
285
|
+
stores,
|
|
286
|
+
status,
|
|
287
|
+
filterType,
|
|
288
|
+
} = {}) {
|
|
289
|
+
const { error } = OrderValidator.getOrderLanesCountByCompanyId().validate(
|
|
290
|
+
{
|
|
291
|
+
pageNo,
|
|
292
|
+
pageSize,
|
|
293
|
+
fromDate,
|
|
294
|
+
toDate,
|
|
295
|
+
q,
|
|
296
|
+
stage,
|
|
297
|
+
salesChannels,
|
|
298
|
+
orderId,
|
|
299
|
+
stores,
|
|
300
|
+
status,
|
|
301
|
+
filterType,
|
|
302
|
+
},
|
|
303
|
+
{ abortEarly: false, allowUnknown: true }
|
|
304
|
+
);
|
|
305
|
+
if (error) {
|
|
306
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
const query_params = {};
|
|
310
|
+
query_params["page_no"] = pageNo;
|
|
311
|
+
query_params["page_size"] = pageSize;
|
|
312
|
+
query_params["from_date"] = fromDate;
|
|
313
|
+
query_params["to_date"] = toDate;
|
|
314
|
+
query_params["q"] = q;
|
|
315
|
+
query_params["stage"] = stage;
|
|
316
|
+
query_params["sales_channels"] = salesChannels;
|
|
317
|
+
query_params["order_id"] = orderId;
|
|
318
|
+
query_params["stores"] = stores;
|
|
319
|
+
query_params["status"] = status;
|
|
320
|
+
query_params["filter_type"] = filterType;
|
|
321
|
+
|
|
322
|
+
const xHeaders = {};
|
|
323
|
+
|
|
324
|
+
return PlatformAPIClient.execute(
|
|
325
|
+
this.config,
|
|
326
|
+
"get",
|
|
327
|
+
`/service/platform/order/v1.0/company/${this.config.companyId}/orders/lane-count`,
|
|
328
|
+
query_params,
|
|
329
|
+
undefined,
|
|
330
|
+
xHeaders
|
|
331
|
+
);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* @param {Object} arg - Arg object.
|
|
336
|
+
* @param {string} [arg.orderId] - Order Id
|
|
337
|
+
* @param {string} [arg.next] - Next
|
|
338
|
+
* @param {string} [arg.previous] - Previous
|
|
339
|
+
* @summary: Get Order Details for company based on Company Id and Order Id
|
|
340
|
+
* @description: Get Orders
|
|
341
|
+
*/
|
|
342
|
+
getOrderDetails({ orderId, next, previous } = {}) {
|
|
343
|
+
const { error } = OrderValidator.getOrderDetails().validate(
|
|
344
|
+
{
|
|
345
|
+
orderId,
|
|
346
|
+
next,
|
|
347
|
+
previous,
|
|
348
|
+
},
|
|
349
|
+
{ abortEarly: false, allowUnknown: true }
|
|
350
|
+
);
|
|
351
|
+
if (error) {
|
|
352
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
const query_params = {};
|
|
356
|
+
query_params["order_id"] = orderId;
|
|
357
|
+
query_params["next"] = next;
|
|
358
|
+
query_params["previous"] = previous;
|
|
359
|
+
|
|
360
|
+
const xHeaders = {};
|
|
361
|
+
|
|
362
|
+
return PlatformAPIClient.execute(
|
|
363
|
+
this.config,
|
|
364
|
+
"get",
|
|
365
|
+
`/service/platform/order/v1.0/company/${this.config.companyId}/orders/details`,
|
|
366
|
+
query_params,
|
|
367
|
+
undefined,
|
|
368
|
+
xHeaders
|
|
369
|
+
);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* @param {Object} arg - Arg object.
|
|
374
|
+
* @param {string} [arg.pageNo] - Current page number
|
|
375
|
+
* @param {string} [arg.pageSize] - Page limit
|
|
376
|
+
* @param {string} [arg.fromDate] - From Date
|
|
377
|
+
* @param {string} [arg.toDate] - To Date
|
|
378
|
+
* @param {string} [arg.q] - Keyword for Search
|
|
379
|
+
* @param {string} [arg.stage] - Specefic Order Stage
|
|
380
|
+
* @param {string} [arg.salesChannels] - Selected Sales Channel
|
|
381
|
+
* @param {string} [arg.orderId] - Order Id
|
|
382
|
+
* @param {string} [arg.stores] - Selected Stores
|
|
383
|
+
* @param {string} [arg.status] - Status of order
|
|
384
|
+
* @param {string} [arg.filterType] - Filters
|
|
385
|
+
* @summary: Get Orders for company based on Company Id
|
|
386
|
+
* @description: Get Orders
|
|
387
|
+
*/
|
|
388
|
+
getPicklistOrdersByCompanyId({
|
|
389
|
+
pageNo,
|
|
390
|
+
pageSize,
|
|
391
|
+
fromDate,
|
|
392
|
+
toDate,
|
|
393
|
+
q,
|
|
394
|
+
stage,
|
|
395
|
+
salesChannels,
|
|
396
|
+
orderId,
|
|
397
|
+
stores,
|
|
398
|
+
status,
|
|
399
|
+
filterType,
|
|
400
|
+
} = {}) {
|
|
401
|
+
const { error } = OrderValidator.getPicklistOrdersByCompanyId().validate(
|
|
402
|
+
{
|
|
403
|
+
pageNo,
|
|
404
|
+
pageSize,
|
|
405
|
+
fromDate,
|
|
406
|
+
toDate,
|
|
407
|
+
q,
|
|
408
|
+
stage,
|
|
409
|
+
salesChannels,
|
|
410
|
+
orderId,
|
|
411
|
+
stores,
|
|
412
|
+
status,
|
|
413
|
+
filterType,
|
|
414
|
+
},
|
|
415
|
+
{ abortEarly: false, allowUnknown: true }
|
|
416
|
+
);
|
|
417
|
+
if (error) {
|
|
418
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
const query_params = {};
|
|
422
|
+
query_params["page_no"] = pageNo;
|
|
423
|
+
query_params["page_size"] = pageSize;
|
|
424
|
+
query_params["from_date"] = fromDate;
|
|
425
|
+
query_params["to_date"] = toDate;
|
|
426
|
+
query_params["q"] = q;
|
|
427
|
+
query_params["stage"] = stage;
|
|
428
|
+
query_params["sales_channels"] = salesChannels;
|
|
429
|
+
query_params["order_id"] = orderId;
|
|
430
|
+
query_params["stores"] = stores;
|
|
431
|
+
query_params["status"] = status;
|
|
432
|
+
query_params["filter_type"] = filterType;
|
|
433
|
+
|
|
434
|
+
const xHeaders = {};
|
|
435
|
+
|
|
436
|
+
return PlatformAPIClient.execute(
|
|
437
|
+
this.config,
|
|
438
|
+
"get",
|
|
439
|
+
`/service/platform/order/v1.0/company/${this.config.companyId}/orders/picklist`,
|
|
440
|
+
query_params,
|
|
441
|
+
undefined,
|
|
442
|
+
xHeaders
|
|
443
|
+
);
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* @param {Object} arg - Arg object.
|
|
448
|
+
* @param {string} arg.shipmentId - ID of the shipment. An order may contain
|
|
449
|
+
* multiple items and may get divided into one or more shipment, each
|
|
450
|
+
* having its own ID.
|
|
451
|
+
* @param {string} arg.addressCategory - Category of the address it falls
|
|
452
|
+
* into(billing or delivery).
|
|
453
|
+
* @summary: Use this API to get address of a shipment using its shipment ID and Address Category.
|
|
454
|
+
* @description: Get Shipment Address
|
|
455
|
+
*/
|
|
456
|
+
getShipmentAddress({ shipmentId, addressCategory } = {}) {
|
|
457
|
+
const { error } = OrderValidator.getShipmentAddress().validate(
|
|
458
|
+
{
|
|
459
|
+
shipmentId,
|
|
460
|
+
addressCategory,
|
|
461
|
+
},
|
|
462
|
+
{ abortEarly: false, allowUnknown: true }
|
|
463
|
+
);
|
|
464
|
+
if (error) {
|
|
465
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
const query_params = {};
|
|
469
|
+
|
|
470
|
+
const xHeaders = {};
|
|
471
|
+
|
|
472
|
+
return PlatformAPIClient.execute(
|
|
473
|
+
this.config,
|
|
474
|
+
"get",
|
|
475
|
+
`/service/platform/order/v1.0/company/${this.config.companyId}/orders/shipments/${shipmentId}/address/${addressCategory}`,
|
|
476
|
+
query_params,
|
|
477
|
+
undefined,
|
|
478
|
+
xHeaders
|
|
479
|
+
);
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
/**
|
|
483
|
+
* @param {Object} arg - Arg object.
|
|
484
|
+
* @param {string} arg.shipmentId - ID of the shipment. An order may contain
|
|
485
|
+
* multiple items and may get divided into one or more shipment, each
|
|
486
|
+
* having its own ID.
|
|
487
|
+
* @param {string} arg.addressCategory - Category of the address it falls
|
|
488
|
+
* into(billing or delivery).
|
|
489
|
+
* @param {UpdateShipmentAddressRequest} arg.body
|
|
490
|
+
* @summary: Use this API to update address of a shipment using its shipment ID and Address Category.
|
|
491
|
+
* @description: Update Shipment Address
|
|
492
|
+
*/
|
|
493
|
+
updateShipmentAddress({ shipmentId, addressCategory, body } = {}) {
|
|
494
|
+
const { error } = OrderValidator.updateShipmentAddress().validate(
|
|
495
|
+
{
|
|
496
|
+
shipmentId,
|
|
497
|
+
addressCategory,
|
|
498
|
+
body,
|
|
499
|
+
},
|
|
500
|
+
{ abortEarly: false, allowUnknown: true }
|
|
501
|
+
);
|
|
502
|
+
if (error) {
|
|
503
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
const query_params = {};
|
|
507
|
+
|
|
508
|
+
const xHeaders = {};
|
|
509
|
+
|
|
510
|
+
return PlatformAPIClient.execute(
|
|
511
|
+
this.config,
|
|
512
|
+
"post",
|
|
513
|
+
`/service/platform/order/v1.0/company/${this.config.companyId}/orders/shipments/${shipmentId}/address/${addressCategory}`,
|
|
514
|
+
query_params,
|
|
515
|
+
body,
|
|
516
|
+
xHeaders
|
|
517
|
+
);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
module.exports = Order;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
export = Payment;
|
|
2
|
+
declare class Payment {
|
|
3
|
+
constructor(config: any);
|
|
4
|
+
config: any;
|
|
5
|
+
/**
|
|
6
|
+
* @param {Object} arg - Arg object.
|
|
7
|
+
* @param {string} [arg.uniqueExternalId] - Fetch payouts using unique external id
|
|
8
|
+
* @summary: Get All Payouts
|
|
9
|
+
* @description: Get All Payouts
|
|
10
|
+
*/
|
|
11
|
+
getAllPayouts({ uniqueExternalId }?: {
|
|
12
|
+
uniqueExternalId?: string;
|
|
13
|
+
}): Promise<any>;
|
|
14
|
+
/**
|
|
15
|
+
* @param {Object} arg - Arg object.
|
|
16
|
+
* @param {PayoutRequest} arg.body
|
|
17
|
+
* @summary: Save Payout
|
|
18
|
+
* @description: Save Payout
|
|
19
|
+
*/
|
|
20
|
+
savePayout({ body }?: {
|
|
21
|
+
body: any;
|
|
22
|
+
}): Promise<any>;
|
|
23
|
+
/**
|
|
24
|
+
* @param {Object} arg - Arg object.
|
|
25
|
+
* @param {string} arg.uniqueTransferNo - Unique transfer id
|
|
26
|
+
* @param {PayoutRequest} arg.body
|
|
27
|
+
* @summary: Update Payout
|
|
28
|
+
* @description: Update Payout
|
|
29
|
+
*/
|
|
30
|
+
updatePayout({ uniqueTransferNo, body }?: {
|
|
31
|
+
uniqueTransferNo: string;
|
|
32
|
+
body: any;
|
|
33
|
+
}): Promise<any>;
|
|
34
|
+
/**
|
|
35
|
+
* @param {Object} arg - Arg object.
|
|
36
|
+
* @param {string} arg.uniqueTransferNo - Unique transfer id
|
|
37
|
+
* @param {UpdatePayoutRequest} arg.body
|
|
38
|
+
* @summary: Partial Update Payout
|
|
39
|
+
* @description: Partial Update Payout
|
|
40
|
+
*/
|
|
41
|
+
activateAndDectivatePayout({ uniqueTransferNo, body }?: {
|
|
42
|
+
uniqueTransferNo: string;
|
|
43
|
+
body: any;
|
|
44
|
+
}): Promise<any>;
|
|
45
|
+
/**
|
|
46
|
+
* @param {Object} arg - Arg object.
|
|
47
|
+
* @param {string} arg.uniqueTransferNo - Unique transfer id
|
|
48
|
+
* @summary: Delete Payout
|
|
49
|
+
* @description: Delete Payout
|
|
50
|
+
*/
|
|
51
|
+
deletePayout({ uniqueTransferNo }?: {
|
|
52
|
+
uniqueTransferNo: string;
|
|
53
|
+
}): Promise<any>;
|
|
54
|
+
/**
|
|
55
|
+
* @param {Object} arg - Arg object.
|
|
56
|
+
* @param {string} [arg.uniqueExternalId] - Unique external id
|
|
57
|
+
* @summary: List Subscription Payment Method
|
|
58
|
+
* @description: Get all Subscription Payment Method
|
|
59
|
+
*/
|
|
60
|
+
getSubscriptionPaymentMethod({ uniqueExternalId }?: {
|
|
61
|
+
uniqueExternalId?: string;
|
|
62
|
+
}): Promise<any>;
|
|
63
|
+
/**
|
|
64
|
+
* @param {Object} arg - Arg object.
|
|
65
|
+
* @param {string} arg.uniqueExternalId -
|
|
66
|
+
* @param {string} arg.paymentMethodId -
|
|
67
|
+
* @summary: Delete Subscription Payment Method
|
|
68
|
+
* @description: Uses this api to Delete Subscription Payment Method
|
|
69
|
+
*/
|
|
70
|
+
deleteSubscriptionPaymentMethod({ uniqueExternalId, paymentMethodId }?: {
|
|
71
|
+
uniqueExternalId: string;
|
|
72
|
+
paymentMethodId: string;
|
|
73
|
+
}): Promise<any>;
|
|
74
|
+
/**
|
|
75
|
+
* @param {Object} arg - Arg object.
|
|
76
|
+
* @summary: List Subscription Config
|
|
77
|
+
* @description: Get all Subscription Config details
|
|
78
|
+
*/
|
|
79
|
+
getSubscriptionConfig({}?: any): Promise<any>;
|
|
80
|
+
/**
|
|
81
|
+
* @param {Object} arg - Arg object.
|
|
82
|
+
* @param {SaveSubscriptionSetupIntentRequest} arg.body
|
|
83
|
+
* @summary: Save Subscription Setup Intent
|
|
84
|
+
* @description: Uses this api to Save Subscription Setup Intent
|
|
85
|
+
*/
|
|
86
|
+
saveSubscriptionSetupIntent({ body }?: {
|
|
87
|
+
body: any;
|
|
88
|
+
}): Promise<any>;
|
|
89
|
+
/**
|
|
90
|
+
* @param {Object} arg - Arg object.
|
|
91
|
+
* @param {string} [arg.ifscCode] -
|
|
92
|
+
* @summary: Ifsc Code Verification
|
|
93
|
+
* @description: Get True/False for correct IFSC Code for adding bank details for refund
|
|
94
|
+
*/
|
|
95
|
+
verifyIfscCode({ ifscCode }?: {
|
|
96
|
+
ifscCode?: string;
|
|
97
|
+
}): Promise<any>;
|
|
98
|
+
}
|