@gofynd/fdk-client-javascript 1.0.1 → 1.0.2
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/documentation/application/CART.md +251 -251
- package/documentation/application/CATALOG.md +414 -414
- package/documentation/application/CONTENT.md +15 -1
- package/documentation/application/ORDER.md +290 -290
- package/documentation/application/PAYMENT.md +255 -255
- package/documentation/application/POSCART.md +297 -297
- package/documentation/platform/CART.md +499 -499
- package/documentation/platform/CATALOG.md +3088 -2702
- package/documentation/platform/COMPANYPROFILE.md +201 -201
- package/documentation/platform/CONTENT.md +123 -1
- package/documentation/platform/ORDER.md +1233 -1158
- package/documentation/platform/PARTNER.md +7 -7
- package/documentation/platform/PAYMENT.md +83 -83
- package/package.json +1 -1
- package/sdk/application/ApplicationConfig.js +1 -1
- package/sdk/application/Cart/CartApplicationClient.js +619 -108
- package/sdk/application/Cart/CartApplicationModel.d.ts +7 -7
- package/sdk/application/Cart/CartApplicationModel.js +335 -335
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +1 -1
- package/sdk/application/Catalog/CatalogApplicationClient.js +730 -134
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +21 -21
- package/sdk/application/Catalog/CatalogApplicationModel.js +547 -547
- package/sdk/application/Common/CommonApplicationClient.js +48 -8
- package/sdk/application/Communication/CommunicationApplicationClient.js +75 -14
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +1 -1
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +392 -66
- package/sdk/application/Content/ContentApplicationClient.js +444 -76
- package/sdk/application/Content/ContentApplicationModel.d.ts +1 -0
- package/sdk/application/Content/ContentApplicationModel.js +11 -1
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +74 -12
- package/sdk/application/Lead/LeadApplicationClient.js +164 -30
- package/sdk/application/Logistic/LogisticApplicationClient.js +98 -16
- package/sdk/application/Order/OrderApplicationClient.d.ts +1 -1
- package/sdk/application/Order/OrderApplicationClient.js +287 -54
- package/sdk/application/Order/OrderApplicationModel.d.ts +19 -19
- package/sdk/application/Order/OrderApplicationModel.js +357 -357
- package/sdk/application/Payment/PaymentApplicationClient.js +961 -186
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +3 -3
- package/sdk/application/Payment/PaymentApplicationModel.js +352 -352
- package/sdk/application/PosCart/PosCartApplicationClient.js +645 -114
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +15 -15
- package/sdk/application/PosCart/PosCartApplicationModel.js +389 -389
- package/sdk/application/Rewards/RewardsApplicationClient.js +168 -28
- package/sdk/application/Share/ShareApplicationClient.js +157 -32
- package/sdk/application/Theme/ThemeApplicationClient.js +94 -16
- package/sdk/application/User/UserApplicationClient.js +806 -148
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +16 -8
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +191 -34
- package/sdk/platform/Analytics/AnalyticsPlatformClient.d.ts +8 -4
- package/sdk/platform/Analytics/AnalyticsPlatformClient.js +103 -16
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +8 -4
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +103 -16
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +24 -12
- package/sdk/platform/Billing/BillingPlatformClient.js +299 -54
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +34 -17
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +409 -72
- package/sdk/platform/Cart/CartPlatformModel.d.ts +35 -35
- package/sdk/platform/Cart/CartPlatformModel.js +617 -617
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +167 -114
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1562 -453
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +8 -8
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +39 -39
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +314 -196
- package/sdk/platform/Catalog/CatalogPlatformClient.js +2459 -718
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +103 -94
- package/sdk/platform/Catalog/CatalogPlatformModel.js +2063 -1797
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +17 -15
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +95 -76
- package/sdk/platform/Common/CommonPlatformClient.d.ts +4 -2
- package/sdk/platform/Common/CommonPlatformClient.js +51 -8
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +80 -40
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +1000 -168
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +2 -1
- package/sdk/platform/Communication/CommunicationPlatformClient.js +28 -4
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +27 -14
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +335 -54
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +10 -10
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +278 -278
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +56 -28
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +702 -118
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +36 -18
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +457 -82
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +148 -67
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +1724 -284
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +1 -0
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +7 -0
- package/sdk/platform/Content/ContentPlatformModel.d.ts +4 -0
- package/sdk/platform/Content/ContentPlatformModel.js +43 -1
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +21 -10
- package/sdk/platform/Discount/DiscountPlatformClient.js +270 -44
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +8 -4
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +102 -16
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +12 -6
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +150 -24
- package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +27 -14
- package/sdk/platform/Inventory/InventoryPlatformClient.js +316 -52
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +26 -13
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +311 -52
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +22 -11
- package/sdk/platform/Lead/LeadPlatformClient.js +266 -44
- package/sdk/platform/OAuthClient.js +8 -8
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +6 -3
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +78 -14
- package/sdk/platform/Order/OrderPlatformClient.d.ts +95 -43
- package/sdk/platform/Order/OrderPlatformClient.js +1062 -180
- package/sdk/platform/Order/OrderPlatformModel.d.ts +64 -60
- package/sdk/platform/Order/OrderPlatformModel.js +1481 -1425
- package/sdk/platform/Order/OrderPlatformValidator.js +5 -0
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -2
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +52 -8
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -1
- package/sdk/platform/Partner/PartnerPlatformModel.js +8 -8
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +22 -11
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +287 -56
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +21 -11
- package/sdk/platform/Payment/PaymentPlatformClient.js +263 -48
- package/sdk/platform/Payment/PaymentPlatformModel.js +122 -122
- package/sdk/platform/PlatformApplicationClient.d.ts +2959 -2787
- package/sdk/platform/PlatformApplicationClient.js +3420 -3212
- package/sdk/platform/PlatformClient.d.ts +2959 -2787
- package/sdk/platform/PlatformClient.js +3420 -3212
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +26 -13
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +308 -54
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +8 -4
- package/sdk/platform/Share/SharePlatformApplicationClient.js +94 -16
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +47 -23
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +571 -96
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +24 -12
- package/sdk/platform/User/UserPlatformApplicationClient.js +296 -48
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +12 -6
- package/sdk/platform/Webhook/WebhookPlatformClient.js +157 -30
- package/sdk/public/Configuration/ConfigurationPublicClient.js +51 -8
- package/sdk/public/Inventory/InventoryPublicClient.js +149 -26
- package/sdk/public/Webhook/WebhookPublicClient.js +51 -10
|
@@ -19,6 +19,7 @@ declare class Order {
|
|
|
19
19
|
* @param {number} [arg.pageSize] -
|
|
20
20
|
* @param {string} [arg.customerId] -
|
|
21
21
|
* @param {boolean} [arg.isPrioritySort] -
|
|
22
|
+
* @returns {Promise<ShipmentInternalPlatformViewResponse>} - Success response
|
|
22
23
|
* @summary:
|
|
23
24
|
* @description:
|
|
24
25
|
*/
|
|
@@ -37,23 +38,25 @@ declare class Order {
|
|
|
37
38
|
pageSize?: number;
|
|
38
39
|
customerId?: string;
|
|
39
40
|
isPrioritySort?: boolean;
|
|
40
|
-
}): Promise<
|
|
41
|
+
}): Promise<ShipmentInternalPlatformViewResponse>;
|
|
41
42
|
/**
|
|
42
43
|
* @param {Object} arg - Arg object.
|
|
43
44
|
* @param {string} arg.orderId -
|
|
45
|
+
* @returns {Promise<ShipmentDetailsResponse>} - Success response
|
|
44
46
|
* @summary:
|
|
45
47
|
* @description:
|
|
46
48
|
*/
|
|
47
49
|
getAppOrderShipmentDetails({ orderId }?: {
|
|
48
50
|
orderId: string;
|
|
49
|
-
}): Promise<
|
|
51
|
+
}): Promise<ShipmentDetailsResponse>;
|
|
50
52
|
/**
|
|
51
53
|
* @param {Object} arg - Arg object.
|
|
52
54
|
* @param {string} arg.shipmentId -
|
|
55
|
+
* @returns {Promise<PlatformShipmentTrack>} - Success response
|
|
53
56
|
* @summary: Track shipment
|
|
54
57
|
* @description: Track Shipment by shipment id, for application based on application Id
|
|
55
58
|
*/
|
|
56
59
|
trackPlatformShipment({ shipmentId }?: {
|
|
57
60
|
shipmentId: string;
|
|
58
|
-
}): Promise<
|
|
61
|
+
}): Promise<PlatformShipmentTrack>;
|
|
59
62
|
}
|
|
@@ -2,6 +2,8 @@ const Paginator = require("../../common/Paginator");
|
|
|
2
2
|
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
3
3
|
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
4
4
|
const OrderValidator = require("./OrderPlatformApplicationValidator");
|
|
5
|
+
const OrderModel = require("./OrderPlatformModel");
|
|
6
|
+
const { Logger } = require("./../../common/Logger");
|
|
5
7
|
|
|
6
8
|
class Order {
|
|
7
9
|
constructor(config, applicationId) {
|
|
@@ -25,10 +27,11 @@ class Order {
|
|
|
25
27
|
* @param {number} [arg.pageSize] -
|
|
26
28
|
* @param {string} [arg.customerId] -
|
|
27
29
|
* @param {boolean} [arg.isPrioritySort] -
|
|
30
|
+
* @returns {Promise<ShipmentInternalPlatformViewResponse>} - Success response
|
|
28
31
|
* @summary:
|
|
29
32
|
* @description:
|
|
30
33
|
*/
|
|
31
|
-
getApplicationShipments({
|
|
34
|
+
async getApplicationShipments({
|
|
32
35
|
lane,
|
|
33
36
|
searchType,
|
|
34
37
|
searchId,
|
|
@@ -90,8 +93,11 @@ class Order {
|
|
|
90
93
|
{ abortEarly: false, allowUnknown: false }
|
|
91
94
|
);
|
|
92
95
|
if (warrning) {
|
|
93
|
-
|
|
94
|
-
|
|
96
|
+
Logger({
|
|
97
|
+
level: "WARN",
|
|
98
|
+
message: "Parameter Validation warrnings for getApplicationShipments",
|
|
99
|
+
});
|
|
100
|
+
Logger({ level: "WARN", message: warrning });
|
|
95
101
|
}
|
|
96
102
|
|
|
97
103
|
const query_params = {};
|
|
@@ -110,22 +116,40 @@ class Order {
|
|
|
110
116
|
query_params["customer_id"] = customerId;
|
|
111
117
|
query_params["is_priority_sort"] = isPrioritySort;
|
|
112
118
|
|
|
113
|
-
|
|
119
|
+
const response = await PlatformAPIClient.execute(
|
|
114
120
|
this.config,
|
|
115
121
|
"get",
|
|
116
122
|
`/service/platform/orders/v1.0/company/${this.config.companyId}/application/${this.applicationId}/shipments/`,
|
|
117
123
|
query_params,
|
|
118
124
|
undefined
|
|
119
125
|
);
|
|
126
|
+
|
|
127
|
+
const {
|
|
128
|
+
error: res_error,
|
|
129
|
+
} = OrderModel.ShipmentInternalPlatformViewResponse().validate(response, {
|
|
130
|
+
abortEarly: false,
|
|
131
|
+
allowUnknown: false,
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
if (res_error) {
|
|
135
|
+
Logger({
|
|
136
|
+
level: "WARN",
|
|
137
|
+
message: "Response Validation Warnnings for getApplicationShipments",
|
|
138
|
+
});
|
|
139
|
+
Logger({ level: "WARN", message: res_error });
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return response;
|
|
120
143
|
}
|
|
121
144
|
|
|
122
145
|
/**
|
|
123
146
|
* @param {Object} arg - Arg object.
|
|
124
147
|
* @param {string} arg.orderId -
|
|
148
|
+
* @returns {Promise<ShipmentDetailsResponse>} - Success response
|
|
125
149
|
* @summary:
|
|
126
150
|
* @description:
|
|
127
151
|
*/
|
|
128
|
-
getAppOrderShipmentDetails({ orderId } = {}) {
|
|
152
|
+
async getAppOrderShipmentDetails({ orderId } = {}) {
|
|
129
153
|
const { error } = OrderValidator.getAppOrderShipmentDetails().validate(
|
|
130
154
|
{
|
|
131
155
|
orderId,
|
|
@@ -146,31 +170,51 @@ class Order {
|
|
|
146
170
|
{ abortEarly: false, allowUnknown: false }
|
|
147
171
|
);
|
|
148
172
|
if (warrning) {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
173
|
+
Logger({
|
|
174
|
+
level: "WARN",
|
|
175
|
+
message:
|
|
176
|
+
"Parameter Validation warrnings for getAppOrderShipmentDetails",
|
|
177
|
+
});
|
|
178
|
+
Logger({ level: "WARN", message: warrning });
|
|
153
179
|
}
|
|
154
180
|
|
|
155
181
|
const query_params = {};
|
|
156
182
|
query_params["order_id"] = orderId;
|
|
157
183
|
|
|
158
|
-
|
|
184
|
+
const response = await PlatformAPIClient.execute(
|
|
159
185
|
this.config,
|
|
160
186
|
"get",
|
|
161
187
|
`/service/platform/orders/v1.0/company/${this.config.companyId}/application/${this.applicationId}/order-details`,
|
|
162
188
|
query_params,
|
|
163
189
|
undefined
|
|
164
190
|
);
|
|
191
|
+
|
|
192
|
+
const {
|
|
193
|
+
error: res_error,
|
|
194
|
+
} = OrderModel.ShipmentDetailsResponse().validate(response, {
|
|
195
|
+
abortEarly: false,
|
|
196
|
+
allowUnknown: false,
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
if (res_error) {
|
|
200
|
+
Logger({
|
|
201
|
+
level: "WARN",
|
|
202
|
+
message: "Response Validation Warnnings for getAppOrderShipmentDetails",
|
|
203
|
+
});
|
|
204
|
+
Logger({ level: "WARN", message: res_error });
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
return response;
|
|
165
208
|
}
|
|
166
209
|
|
|
167
210
|
/**
|
|
168
211
|
* @param {Object} arg - Arg object.
|
|
169
212
|
* @param {string} arg.shipmentId -
|
|
213
|
+
* @returns {Promise<PlatformShipmentTrack>} - Success response
|
|
170
214
|
* @summary: Track shipment
|
|
171
215
|
* @description: Track Shipment by shipment id, for application based on application Id
|
|
172
216
|
*/
|
|
173
|
-
trackPlatformShipment({ shipmentId } = {}) {
|
|
217
|
+
async trackPlatformShipment({ shipmentId } = {}) {
|
|
174
218
|
const { error } = OrderValidator.trackPlatformShipment().validate(
|
|
175
219
|
{
|
|
176
220
|
shipmentId,
|
|
@@ -189,19 +233,39 @@ class Order {
|
|
|
189
233
|
{ abortEarly: false, allowUnknown: false }
|
|
190
234
|
);
|
|
191
235
|
if (warrning) {
|
|
192
|
-
|
|
193
|
-
|
|
236
|
+
Logger({
|
|
237
|
+
level: "WARN",
|
|
238
|
+
message: "Parameter Validation warrnings for trackPlatformShipment",
|
|
239
|
+
});
|
|
240
|
+
Logger({ level: "WARN", message: warrning });
|
|
194
241
|
}
|
|
195
242
|
|
|
196
243
|
const query_params = {};
|
|
197
244
|
|
|
198
|
-
|
|
245
|
+
const response = await PlatformAPIClient.execute(
|
|
199
246
|
this.config,
|
|
200
247
|
"get",
|
|
201
248
|
`/service/platform/orders/v1.0/company/${this.config.companyId}/application/${this.applicationId}/orders/shipments/${shipmentId}/track`,
|
|
202
249
|
query_params,
|
|
203
250
|
undefined
|
|
204
251
|
);
|
|
252
|
+
|
|
253
|
+
const {
|
|
254
|
+
error: res_error,
|
|
255
|
+
} = OrderModel.PlatformShipmentTrack().validate(response, {
|
|
256
|
+
abortEarly: false,
|
|
257
|
+
allowUnknown: false,
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
if (res_error) {
|
|
261
|
+
Logger({
|
|
262
|
+
level: "WARN",
|
|
263
|
+
message: "Response Validation Warnnings for trackPlatformShipment",
|
|
264
|
+
});
|
|
265
|
+
Logger({ level: "WARN", message: res_error });
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
return response;
|
|
205
269
|
}
|
|
206
270
|
}
|
|
207
271
|
module.exports = Order;
|