@gofynd/fdk-client-javascript 1.4.6 → 1.4.7
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 +1 -1
- package/package.json +2 -2
- package/sdk/application/ApplicationClient.d.ts +2 -0
- package/sdk/application/ApplicationClient.js +2 -0
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +6 -0
- package/sdk/application/Catalog/CatalogApplicationModel.js +6 -0
- package/sdk/application/Content/ContentApplicationModel.d.ts +2 -0
- package/sdk/application/Content/ContentApplicationModel.js +2 -0
- package/sdk/application/Order/OrderApplicationModel.d.ts +70 -9
- package/sdk/application/Order/OrderApplicationModel.js +43 -7
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +18 -18
- package/sdk/application/Payment/PaymentApplicationModel.js +18 -18
- package/sdk/application/Webhook/WebhookApplicationClient.d.ts +22 -0
- package/sdk/application/Webhook/WebhookApplicationClient.js +115 -0
- package/sdk/application/Webhook/WebhookApplicationModel.d.ts +37 -0
- package/sdk/application/Webhook/WebhookApplicationModel.js +46 -0
- package/sdk/application/Webhook/WebhookApplicationValidator.d.ts +16 -0
- package/sdk/application/Webhook/WebhookApplicationValidator.js +19 -0
- package/sdk/application/index.d.ts +1 -0
- package/sdk/application/index.js +2 -0
- package/sdk/partner/Webhook/WebhookPartnerClient.d.ts +2 -2
- package/sdk/partner/Webhook/WebhookPartnerClient.js +2 -2
- package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +23 -19
- package/sdk/partner/Webhook/WebhookPartnerModel.js +19 -22
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +43 -0
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +257 -0
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +39 -0
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +45 -0
- package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +60 -0
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +57 -0
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +10 -0
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +80 -0
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +13 -1
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +12 -0
- package/sdk/platform/Cart/CartPlatformModel.d.ts +2 -0
- package/sdk/platform/Cart/CartPlatformModel.js +2 -0
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +9 -5
- package/sdk/platform/Catalog/CatalogPlatformClient.js +19 -12
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +118 -17
- package/sdk/platform/Catalog/CatalogPlatformModel.js +137 -15
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +12 -7
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +7 -5
- package/sdk/platform/Content/ContentPlatformModel.d.ts +2 -0
- package/sdk/platform/Content/ContentPlatformModel.js +2 -0
- package/sdk/platform/Order/OrderPlatformClient.d.ts +11 -1
- package/sdk/platform/Order/OrderPlatformClient.js +82 -5
- package/sdk/platform/Order/OrderPlatformModel.d.ts +163 -15
- package/sdk/platform/Order/OrderPlatformModel.js +92 -14
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +58 -17
- package/sdk/platform/Order/OrderPlatformValidator.js +28 -16
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +2 -2
- package/sdk/platform/Payment/PaymentPlatformModel.js +2 -2
- package/sdk/platform/PlatformApplicationClient.d.ts +2 -0
- package/sdk/platform/PlatformApplicationClient.js +4 -0
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +24 -0
- package/sdk/platform/Webhook/WebhookPlatformClient.js +164 -0
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +71 -18
- package/sdk/platform/Webhook/WebhookPlatformModel.js +75 -22
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +19 -1
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +24 -0
- package/sdk/platform/index.d.ts +1 -0
- package/sdk/platform/index.js +2 -0
- package/sdk/public/Webhook/WebhookPublicClient.d.ts +2 -2
- package/sdk/public/Webhook/WebhookPublicClient.js +2 -2
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +2 -0
- package/sdk/public/Webhook/WebhookPublicModel.js +2 -0
package/README.md
CHANGED
|
@@ -214,7 +214,7 @@ console.log("Active Theme: ", response.information.name);
|
|
|
214
214
|
The above code will log the curl command in the console
|
|
215
215
|
|
|
216
216
|
```bash
|
|
217
|
-
curl --request GET "https://api.fynd.com/service/application/theme/v1.0/applied-theme" --header 'authorization: Bearer <authorization-token>' --header 'x-fp-sdk-version: 1.4.
|
|
217
|
+
curl --request GET "https://api.fynd.com/service/application/theme/v1.0/applied-theme" --header 'authorization: Bearer <authorization-token>' --header 'x-fp-sdk-version: 1.4.7' --header 'x-fp-date: 20230222T115108Z' --header 'x-fp-signature: v1.1:1e3ab3b02b5bc626e3c32a37ee844266ade02bbcbaafc28fc7a0e46a76a7a1a8'
|
|
218
218
|
Active Theme: Emerge
|
|
219
219
|
```
|
|
220
220
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gofynd/fdk-client-javascript",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"loglevel": "^1.8.1",
|
|
20
20
|
"query-string": "^7.1.3",
|
|
21
21
|
"@gofynd/fp-signature": "^1.0.1",
|
|
22
|
-
"@gofynd/flick": "^1.0.
|
|
22
|
+
"@gofynd/flick": "^1.0.7"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"axios-cookiejar-support": "^4.0.6",
|
|
@@ -23,6 +23,7 @@ declare class ApplicationClient {
|
|
|
23
23
|
share: Share;
|
|
24
24
|
theme: Theme;
|
|
25
25
|
user: User;
|
|
26
|
+
webhook: Webhook;
|
|
26
27
|
/**
|
|
27
28
|
* Sets the cookie for the application.
|
|
28
29
|
*
|
|
@@ -70,3 +71,4 @@ import Rewards = require("./Rewards/RewardsApplicationClient");
|
|
|
70
71
|
import Share = require("./Share/ShareApplicationClient");
|
|
71
72
|
import Theme = require("./Theme/ThemeApplicationClient");
|
|
72
73
|
import User = require("./User/UserApplicationClient");
|
|
74
|
+
import Webhook = require("./Webhook/WebhookApplicationClient");
|
|
@@ -13,6 +13,7 @@ const Rewards = require("./Rewards/RewardsApplicationClient");
|
|
|
13
13
|
const Share = require("./Share/ShareApplicationClient");
|
|
14
14
|
const Theme = require("./Theme/ThemeApplicationClient");
|
|
15
15
|
const User = require("./User/UserApplicationClient");
|
|
16
|
+
const Webhook = require("./Webhook/WebhookApplicationClient");
|
|
16
17
|
const { FDKClientValidationError } = require("../common/FDKError");
|
|
17
18
|
const { Logger } = require("../common/Logger");
|
|
18
19
|
const { convertStringToBase64 } = require("../common/utils");
|
|
@@ -41,6 +42,7 @@ class ApplicationClient {
|
|
|
41
42
|
this.share = new Share(config);
|
|
42
43
|
this.theme = new Theme(config);
|
|
43
44
|
this.user = new User(config);
|
|
45
|
+
this.webhook = new Webhook(config);
|
|
44
46
|
if (
|
|
45
47
|
typeof window != "undefined" &&
|
|
46
48
|
config.options &&
|
|
@@ -220,6 +220,7 @@ export = CatalogApplicationModel;
|
|
|
220
220
|
* @typedef ProductSizes
|
|
221
221
|
* @property {ProductSize[]} [sizes]
|
|
222
222
|
* @property {ProductSizesPrice} [price]
|
|
223
|
+
* @property {ProductSizesPrice} [price_per_piece]
|
|
223
224
|
* @property {SizeChart} [size_chart]
|
|
224
225
|
* @property {boolean} [sellable]
|
|
225
226
|
* @property {boolean} [multi_size]
|
|
@@ -266,6 +267,7 @@ export = CatalogApplicationModel;
|
|
|
266
267
|
* @property {string} [name]
|
|
267
268
|
* @property {string} [value]
|
|
268
269
|
* @property {string} [slug]
|
|
270
|
+
* @property {Object} [_custom_json]
|
|
269
271
|
* @property {ProductListingAction} [action]
|
|
270
272
|
*/
|
|
271
273
|
/**
|
|
@@ -274,6 +276,7 @@ export = CatalogApplicationModel;
|
|
|
274
276
|
* @property {string} [header]
|
|
275
277
|
* @property {ProductVariantItemResponse[]} [items]
|
|
276
278
|
* @property {string} [key]
|
|
279
|
+
* @property {string} [logo]
|
|
277
280
|
*/
|
|
278
281
|
/**
|
|
279
282
|
* @typedef ProductVariantsResponse
|
|
@@ -1303,6 +1306,7 @@ declare function ProductSizes(): ProductSizes;
|
|
|
1303
1306
|
type ProductSizes = {
|
|
1304
1307
|
sizes?: ProductSize[];
|
|
1305
1308
|
price?: ProductSizesPrice;
|
|
1309
|
+
price_per_piece?: ProductSizesPrice;
|
|
1306
1310
|
size_chart?: SizeChart;
|
|
1307
1311
|
sellable?: boolean;
|
|
1308
1312
|
multi_size?: boolean;
|
|
@@ -1355,6 +1359,7 @@ type ProductVariantItemResponse = {
|
|
|
1355
1359
|
name?: string;
|
|
1356
1360
|
value?: string;
|
|
1357
1361
|
slug?: string;
|
|
1362
|
+
_custom_json?: any;
|
|
1358
1363
|
action?: ProductListingAction;
|
|
1359
1364
|
};
|
|
1360
1365
|
/** @returns {ProductVariantResponse} */
|
|
@@ -1364,6 +1369,7 @@ type ProductVariantResponse = {
|
|
|
1364
1369
|
header?: string;
|
|
1365
1370
|
items?: ProductVariantItemResponse[];
|
|
1366
1371
|
key?: string;
|
|
1372
|
+
logo?: string;
|
|
1367
1373
|
};
|
|
1368
1374
|
/** @returns {ProductVariantsResponse} */
|
|
1369
1375
|
declare function ProductVariantsResponse(): ProductVariantsResponse;
|
|
@@ -249,6 +249,7 @@ const Joi = require("joi");
|
|
|
249
249
|
* @typedef ProductSizes
|
|
250
250
|
* @property {ProductSize[]} [sizes]
|
|
251
251
|
* @property {ProductSizesPrice} [price]
|
|
252
|
+
* @property {ProductSizesPrice} [price_per_piece]
|
|
252
253
|
* @property {SizeChart} [size_chart]
|
|
253
254
|
* @property {boolean} [sellable]
|
|
254
255
|
* @property {boolean} [multi_size]
|
|
@@ -301,6 +302,7 @@ const Joi = require("joi");
|
|
|
301
302
|
* @property {string} [name]
|
|
302
303
|
* @property {string} [value]
|
|
303
304
|
* @property {string} [slug]
|
|
305
|
+
* @property {Object} [_custom_json]
|
|
304
306
|
* @property {ProductListingAction} [action]
|
|
305
307
|
*/
|
|
306
308
|
|
|
@@ -310,6 +312,7 @@ const Joi = require("joi");
|
|
|
310
312
|
* @property {string} [header]
|
|
311
313
|
* @property {ProductVariantItemResponse[]} [items]
|
|
312
314
|
* @property {string} [key]
|
|
315
|
+
* @property {string} [logo]
|
|
313
316
|
*/
|
|
314
317
|
|
|
315
318
|
/**
|
|
@@ -1400,6 +1403,7 @@ class CatalogApplicationModel {
|
|
|
1400
1403
|
return Joi.object({
|
|
1401
1404
|
sizes: Joi.array().items(CatalogApplicationModel.ProductSize()),
|
|
1402
1405
|
price: CatalogApplicationModel.ProductSizesPrice(),
|
|
1406
|
+
price_per_piece: CatalogApplicationModel.ProductSizesPrice(),
|
|
1403
1407
|
size_chart: CatalogApplicationModel.SizeChart(),
|
|
1404
1408
|
sellable: Joi.boolean(),
|
|
1405
1409
|
multi_size: Joi.boolean(),
|
|
@@ -1470,6 +1474,7 @@ class CatalogApplicationModel {
|
|
|
1470
1474
|
name: Joi.string().allow(""),
|
|
1471
1475
|
value: Joi.string().allow(""),
|
|
1472
1476
|
slug: Joi.string().allow(""),
|
|
1477
|
+
_custom_json: Joi.object().pattern(/\S/, Joi.any()),
|
|
1473
1478
|
action: CatalogApplicationModel.ProductListingAction(),
|
|
1474
1479
|
});
|
|
1475
1480
|
}
|
|
@@ -1483,6 +1488,7 @@ class CatalogApplicationModel {
|
|
|
1483
1488
|
CatalogApplicationModel.ProductVariantItemResponse()
|
|
1484
1489
|
),
|
|
1485
1490
|
key: Joi.string().allow(""),
|
|
1491
|
+
logo: Joi.string().allow(""),
|
|
1486
1492
|
});
|
|
1487
1493
|
}
|
|
1488
1494
|
|
|
@@ -119,6 +119,7 @@ export = ContentApplicationModel;
|
|
|
119
119
|
* @property {string} [reading_time]
|
|
120
120
|
* @property {string} [slug]
|
|
121
121
|
* @property {string[]} [tags]
|
|
122
|
+
* @property {string} [publish_date]
|
|
122
123
|
* @property {SEO} [seo]
|
|
123
124
|
* @property {CronSchedule} [_schedule]
|
|
124
125
|
* @property {string} [title]
|
|
@@ -727,6 +728,7 @@ type BlogSchema = {
|
|
|
727
728
|
reading_time?: string;
|
|
728
729
|
slug?: string;
|
|
729
730
|
tags?: string[];
|
|
731
|
+
publish_date?: string;
|
|
730
732
|
seo?: SEO;
|
|
731
733
|
_schedule?: CronSchedule;
|
|
732
734
|
title?: string;
|
|
@@ -136,6 +136,7 @@ const Joi = require("joi");
|
|
|
136
136
|
* @property {string} [reading_time]
|
|
137
137
|
* @property {string} [slug]
|
|
138
138
|
* @property {string[]} [tags]
|
|
139
|
+
* @property {string} [publish_date]
|
|
139
140
|
* @property {SEO} [seo]
|
|
140
141
|
* @property {CronSchedule} [_schedule]
|
|
141
142
|
* @property {string} [title]
|
|
@@ -833,6 +834,7 @@ class ContentApplicationModel {
|
|
|
833
834
|
reading_time: Joi.string().allow(""),
|
|
834
835
|
slug: Joi.string().allow(""),
|
|
835
836
|
tags: Joi.array().items(Joi.string().allow("")),
|
|
837
|
+
publish_date: Joi.string().allow(""),
|
|
836
838
|
seo: ContentApplicationModel.SEO(),
|
|
837
839
|
_schedule: ContentApplicationModel.CronSchedule(),
|
|
838
840
|
title: Joi.string().allow(""),
|
|
@@ -33,6 +33,20 @@ export = OrderApplicationModel;
|
|
|
33
33
|
* @property {string} [logo]
|
|
34
34
|
* @property {string} [display_name]
|
|
35
35
|
*/
|
|
36
|
+
/**
|
|
37
|
+
* @typedef ShipmentPaymentInfo
|
|
38
|
+
* @property {string} [mop] - Stands for "Mode of Payment". This is a short code
|
|
39
|
+
* (like "COD" for Cash On Delivery) that represents the payment method used.
|
|
40
|
+
* @property {string} [payment_mode] - Information about the payment mode,
|
|
41
|
+
* indicates whether COD or PREPAID
|
|
42
|
+
* @property {string} [status] - Indicates the current status of the payment,
|
|
43
|
+
* Paid or Unpaid
|
|
44
|
+
* @property {string} [mode] - Information about the payment source. For eg, NB_ICICI
|
|
45
|
+
* @property {string} [logo] - A URL to an image representing the payment method
|
|
46
|
+
* @property {string} [display_name] - The name of the payment method as it
|
|
47
|
+
* should be displayed to the user
|
|
48
|
+
* @property {number} [amount] - Amount paid using this payment method
|
|
49
|
+
*/
|
|
36
50
|
/**
|
|
37
51
|
* @typedef ShipmentUserInfo
|
|
38
52
|
* @property {string} [first_name]
|
|
@@ -232,7 +246,7 @@ export = OrderApplicationModel;
|
|
|
232
246
|
* @property {string[]} [tags]
|
|
233
247
|
*/
|
|
234
248
|
/**
|
|
235
|
-
* @typedef
|
|
249
|
+
* @typedef Address
|
|
236
250
|
* @property {string} [pincode]
|
|
237
251
|
* @property {string} [phone]
|
|
238
252
|
* @property {number} [latitude]
|
|
@@ -260,7 +274,9 @@ export = OrderApplicationModel;
|
|
|
260
274
|
/**
|
|
261
275
|
* @typedef Shipments
|
|
262
276
|
* @property {ShipmentPayment} [payment]
|
|
263
|
-
* @property {
|
|
277
|
+
* @property {ShipmentPaymentInfo[]} [payment_info] - "Array of objects
|
|
278
|
+
* containing payment methods used for placing an order. Each object will
|
|
279
|
+
* provide information about corresponding payment method with relevant details."
|
|
264
280
|
* @property {string} [order_type]
|
|
265
281
|
* @property {boolean} [show_download_invoice]
|
|
266
282
|
* @property {boolean} [can_cancel]
|
|
@@ -291,7 +307,8 @@ export = OrderApplicationModel;
|
|
|
291
307
|
* @property {boolean} [beneficiary_details]
|
|
292
308
|
* @property {FulfillingCompany} [fulfilling_company]
|
|
293
309
|
* @property {boolean} [can_return]
|
|
294
|
-
* @property {
|
|
310
|
+
* @property {Address} [delivery_address]
|
|
311
|
+
* @property {Address} [billing_address]
|
|
295
312
|
* @property {string} [track_url]
|
|
296
313
|
* @property {string} [order_id]
|
|
297
314
|
* @property {string} [need_help_url]
|
|
@@ -316,6 +333,7 @@ export = OrderApplicationModel;
|
|
|
316
333
|
/**
|
|
317
334
|
* @typedef OrderSchema
|
|
318
335
|
* @property {number} [total_shipments_in_order]
|
|
336
|
+
* @property {string} [gstin_code]
|
|
319
337
|
* @property {UserInfo} [user_info]
|
|
320
338
|
* @property {BreakupValues[]} [breakup_values]
|
|
321
339
|
* @property {string} [order_created_time]
|
|
@@ -536,7 +554,7 @@ export = OrderApplicationModel;
|
|
|
536
554
|
declare class OrderApplicationModel {
|
|
537
555
|
}
|
|
538
556
|
declare namespace OrderApplicationModel {
|
|
539
|
-
export { OrderPage, UserInfo, BreakupValues, ShipmentPayment, ShipmentUserInfo, FulfillingStore, ShipmentStatus, Invoice, NestedTrackingDetails, TrackingDetails, TimeStampData, Promise, ShipmentTotalDetails, Prices, ItemBrand, Item, AppliedFreeArticles, AppliedPromos, Identifiers, FinancialBreakup, CurrentStatus, Bags, FulfillingCompany, Article,
|
|
557
|
+
export { OrderPage, UserInfo, BreakupValues, ShipmentPayment, ShipmentPaymentInfo, ShipmentUserInfo, FulfillingStore, ShipmentStatus, Invoice, NestedTrackingDetails, TrackingDetails, TimeStampData, Promise, ShipmentTotalDetails, Prices, ItemBrand, Item, AppliedFreeArticles, AppliedPromos, Identifiers, FinancialBreakup, CurrentStatus, Bags, FulfillingCompany, Article, Address, Shipments, BagsForReorderArticleAssignment, BagsForReorder, OrderSchema, OrderStatuses, OrderFilters, OrderList, ApefaceApiError, OrderById, ShipmentById, ResponseGetInvoiceShipment, Track, ShipmentTrack, CustomerDetailsResponse, SendOtpToCustomerResponse, VerifyOtp, VerifyOtpResponse, BagReasonMeta, QuestionSet, BagReasons, ShipmentBagReasons, ShipmentReason, ShipmentReasons, ProductsReasonsData, ProductsReasonsFilters, ProductsReasons, EntityReasonData, EntitiesReasons, ReasonsData, Products, ProductsDataUpdatesFilters, ProductsDataUpdates, EntitiesDataUpdates, DataUpdates, ShipmentsRequest, StatuesRequest, OrderRequest, UpdateShipmentStatusRequest, StatusesBodyResponse, ShipmentApplicationStatusResponse, ErrorResponse };
|
|
540
558
|
}
|
|
541
559
|
/** @returns {OrderPage} */
|
|
542
560
|
declare function OrderPage(): OrderPage;
|
|
@@ -576,6 +594,42 @@ type ShipmentPayment = {
|
|
|
576
594
|
logo?: string;
|
|
577
595
|
display_name?: string;
|
|
578
596
|
};
|
|
597
|
+
/** @returns {ShipmentPaymentInfo} */
|
|
598
|
+
declare function ShipmentPaymentInfo(): ShipmentPaymentInfo;
|
|
599
|
+
type ShipmentPaymentInfo = {
|
|
600
|
+
/**
|
|
601
|
+
* - Stands for "Mode of Payment". This is a short code
|
|
602
|
+
* (like "COD" for Cash On Delivery) that represents the payment method used.
|
|
603
|
+
*/
|
|
604
|
+
mop?: string;
|
|
605
|
+
/**
|
|
606
|
+
* - Information about the payment mode,
|
|
607
|
+
* indicates whether COD or PREPAID
|
|
608
|
+
*/
|
|
609
|
+
payment_mode?: string;
|
|
610
|
+
/**
|
|
611
|
+
* - Indicates the current status of the payment,
|
|
612
|
+
* Paid or Unpaid
|
|
613
|
+
*/
|
|
614
|
+
status?: string;
|
|
615
|
+
/**
|
|
616
|
+
* - Information about the payment source. For eg, NB_ICICI
|
|
617
|
+
*/
|
|
618
|
+
mode?: string;
|
|
619
|
+
/**
|
|
620
|
+
* - A URL to an image representing the payment method
|
|
621
|
+
*/
|
|
622
|
+
logo?: string;
|
|
623
|
+
/**
|
|
624
|
+
* - The name of the payment method as it
|
|
625
|
+
* should be displayed to the user
|
|
626
|
+
*/
|
|
627
|
+
display_name?: string;
|
|
628
|
+
/**
|
|
629
|
+
* - Amount paid using this payment method
|
|
630
|
+
*/
|
|
631
|
+
amount?: number;
|
|
632
|
+
};
|
|
579
633
|
/** @returns {ShipmentUserInfo} */
|
|
580
634
|
declare function ShipmentUserInfo(): ShipmentUserInfo;
|
|
581
635
|
type ShipmentUserInfo = {
|
|
@@ -794,9 +848,9 @@ declare function Article(): Article;
|
|
|
794
848
|
type Article = {
|
|
795
849
|
tags?: string[];
|
|
796
850
|
};
|
|
797
|
-
/** @returns {
|
|
798
|
-
declare function
|
|
799
|
-
type
|
|
851
|
+
/** @returns {Address} */
|
|
852
|
+
declare function Address(): Address;
|
|
853
|
+
type Address = {
|
|
800
854
|
pincode?: string;
|
|
801
855
|
phone?: string;
|
|
802
856
|
latitude?: number;
|
|
@@ -825,7 +879,12 @@ type DeliveryAddress = {
|
|
|
825
879
|
declare function Shipments(): Shipments;
|
|
826
880
|
type Shipments = {
|
|
827
881
|
payment?: ShipmentPayment;
|
|
828
|
-
|
|
882
|
+
/**
|
|
883
|
+
* - "Array of objects
|
|
884
|
+
* containing payment methods used for placing an order. Each object will
|
|
885
|
+
* provide information about corresponding payment method with relevant details."
|
|
886
|
+
*/
|
|
887
|
+
payment_info?: ShipmentPaymentInfo[];
|
|
829
888
|
order_type?: string;
|
|
830
889
|
show_download_invoice?: boolean;
|
|
831
890
|
can_cancel?: boolean;
|
|
@@ -856,7 +915,8 @@ type Shipments = {
|
|
|
856
915
|
beneficiary_details?: boolean;
|
|
857
916
|
fulfilling_company?: FulfillingCompany;
|
|
858
917
|
can_return?: boolean;
|
|
859
|
-
delivery_address?:
|
|
918
|
+
delivery_address?: Address;
|
|
919
|
+
billing_address?: Address;
|
|
860
920
|
track_url?: string;
|
|
861
921
|
order_id?: string;
|
|
862
922
|
need_help_url?: string;
|
|
@@ -884,6 +944,7 @@ type BagsForReorder = {
|
|
|
884
944
|
declare function OrderSchema(): OrderSchema;
|
|
885
945
|
type OrderSchema = {
|
|
886
946
|
total_shipments_in_order?: number;
|
|
947
|
+
gstin_code?: string;
|
|
887
948
|
user_info?: UserInfo;
|
|
888
949
|
breakup_values?: BreakupValues[];
|
|
889
950
|
order_created_time?: string;
|
|
@@ -38,6 +38,21 @@ const Joi = require("joi");
|
|
|
38
38
|
* @property {string} [display_name]
|
|
39
39
|
*/
|
|
40
40
|
|
|
41
|
+
/**
|
|
42
|
+
* @typedef ShipmentPaymentInfo
|
|
43
|
+
* @property {string} [mop] - Stands for "Mode of Payment". This is a short code
|
|
44
|
+
* (like "COD" for Cash On Delivery) that represents the payment method used.
|
|
45
|
+
* @property {string} [payment_mode] - Information about the payment mode,
|
|
46
|
+
* indicates whether COD or PREPAID
|
|
47
|
+
* @property {string} [status] - Indicates the current status of the payment,
|
|
48
|
+
* Paid or Unpaid
|
|
49
|
+
* @property {string} [mode] - Information about the payment source. For eg, NB_ICICI
|
|
50
|
+
* @property {string} [logo] - A URL to an image representing the payment method
|
|
51
|
+
* @property {string} [display_name] - The name of the payment method as it
|
|
52
|
+
* should be displayed to the user
|
|
53
|
+
* @property {number} [amount] - Amount paid using this payment method
|
|
54
|
+
*/
|
|
55
|
+
|
|
41
56
|
/**
|
|
42
57
|
* @typedef ShipmentUserInfo
|
|
43
58
|
* @property {string} [first_name]
|
|
@@ -257,7 +272,7 @@ const Joi = require("joi");
|
|
|
257
272
|
*/
|
|
258
273
|
|
|
259
274
|
/**
|
|
260
|
-
* @typedef
|
|
275
|
+
* @typedef Address
|
|
261
276
|
* @property {string} [pincode]
|
|
262
277
|
* @property {string} [phone]
|
|
263
278
|
* @property {number} [latitude]
|
|
@@ -286,7 +301,9 @@ const Joi = require("joi");
|
|
|
286
301
|
/**
|
|
287
302
|
* @typedef Shipments
|
|
288
303
|
* @property {ShipmentPayment} [payment]
|
|
289
|
-
* @property {
|
|
304
|
+
* @property {ShipmentPaymentInfo[]} [payment_info] - "Array of objects
|
|
305
|
+
* containing payment methods used for placing an order. Each object will
|
|
306
|
+
* provide information about corresponding payment method with relevant details."
|
|
290
307
|
* @property {string} [order_type]
|
|
291
308
|
* @property {boolean} [show_download_invoice]
|
|
292
309
|
* @property {boolean} [can_cancel]
|
|
@@ -317,7 +334,8 @@ const Joi = require("joi");
|
|
|
317
334
|
* @property {boolean} [beneficiary_details]
|
|
318
335
|
* @property {FulfillingCompany} [fulfilling_company]
|
|
319
336
|
* @property {boolean} [can_return]
|
|
320
|
-
* @property {
|
|
337
|
+
* @property {Address} [delivery_address]
|
|
338
|
+
* @property {Address} [billing_address]
|
|
321
339
|
* @property {string} [track_url]
|
|
322
340
|
* @property {string} [order_id]
|
|
323
341
|
* @property {string} [need_help_url]
|
|
@@ -345,6 +363,7 @@ const Joi = require("joi");
|
|
|
345
363
|
/**
|
|
346
364
|
* @typedef OrderSchema
|
|
347
365
|
* @property {number} [total_shipments_in_order]
|
|
366
|
+
* @property {string} [gstin_code]
|
|
348
367
|
* @property {UserInfo} [user_info]
|
|
349
368
|
* @property {BreakupValues[]} [breakup_values]
|
|
350
369
|
* @property {string} [order_created_time]
|
|
@@ -647,6 +666,19 @@ class OrderApplicationModel {
|
|
|
647
666
|
});
|
|
648
667
|
}
|
|
649
668
|
|
|
669
|
+
/** @returns {ShipmentPaymentInfo} */
|
|
670
|
+
static ShipmentPaymentInfo() {
|
|
671
|
+
return Joi.object({
|
|
672
|
+
mop: Joi.string().allow(""),
|
|
673
|
+
payment_mode: Joi.string().allow(""),
|
|
674
|
+
status: Joi.string().allow(""),
|
|
675
|
+
mode: Joi.string().allow(""),
|
|
676
|
+
logo: Joi.string().allow(""),
|
|
677
|
+
display_name: Joi.string().allow(""),
|
|
678
|
+
amount: Joi.number(),
|
|
679
|
+
});
|
|
680
|
+
}
|
|
681
|
+
|
|
650
682
|
/** @returns {ShipmentUserInfo} */
|
|
651
683
|
static ShipmentUserInfo() {
|
|
652
684
|
return Joi.object({
|
|
@@ -911,8 +943,8 @@ class OrderApplicationModel {
|
|
|
911
943
|
});
|
|
912
944
|
}
|
|
913
945
|
|
|
914
|
-
/** @returns {
|
|
915
|
-
static
|
|
946
|
+
/** @returns {Address} */
|
|
947
|
+
static Address() {
|
|
916
948
|
return Joi.object({
|
|
917
949
|
pincode: Joi.string().allow(""),
|
|
918
950
|
phone: Joi.string().allow(""),
|
|
@@ -944,7 +976,9 @@ class OrderApplicationModel {
|
|
|
944
976
|
static Shipments() {
|
|
945
977
|
return Joi.object({
|
|
946
978
|
payment: OrderApplicationModel.ShipmentPayment(),
|
|
947
|
-
payment_info: Joi.array().items(
|
|
979
|
+
payment_info: Joi.array().items(
|
|
980
|
+
OrderApplicationModel.ShipmentPaymentInfo()
|
|
981
|
+
),
|
|
948
982
|
order_type: Joi.string().allow("").allow(null),
|
|
949
983
|
show_download_invoice: Joi.boolean(),
|
|
950
984
|
can_cancel: Joi.boolean(),
|
|
@@ -977,7 +1011,8 @@ class OrderApplicationModel {
|
|
|
977
1011
|
beneficiary_details: Joi.boolean(),
|
|
978
1012
|
fulfilling_company: OrderApplicationModel.FulfillingCompany(),
|
|
979
1013
|
can_return: Joi.boolean(),
|
|
980
|
-
delivery_address: OrderApplicationModel.
|
|
1014
|
+
delivery_address: OrderApplicationModel.Address(),
|
|
1015
|
+
billing_address: OrderApplicationModel.Address(),
|
|
981
1016
|
track_url: Joi.string().allow(""),
|
|
982
1017
|
order_id: Joi.string().allow(""),
|
|
983
1018
|
need_help_url: Joi.string().allow(""),
|
|
@@ -1011,6 +1046,7 @@ class OrderApplicationModel {
|
|
|
1011
1046
|
static OrderSchema() {
|
|
1012
1047
|
return Joi.object({
|
|
1013
1048
|
total_shipments_in_order: Joi.number(),
|
|
1049
|
+
gstin_code: Joi.string().allow(""),
|
|
1014
1050
|
user_info: OrderApplicationModel.UserInfo(),
|
|
1015
1051
|
breakup_values: Joi.array().items(OrderApplicationModel.BreakupValues()),
|
|
1016
1052
|
order_created_time: Joi.string().allow(""),
|
|
@@ -169,19 +169,19 @@ export = PaymentApplicationModel;
|
|
|
169
169
|
*/
|
|
170
170
|
/**
|
|
171
171
|
* @typedef PaymentStatusUpdateRequest
|
|
172
|
-
* @property {string} status - Status of payment.
|
|
173
|
-
* @property {string} merchant_transaction_id - Unique fynd transaction id
|
|
172
|
+
* @property {string} [status] - Status of payment.
|
|
173
|
+
* @property {string} [merchant_transaction_id] - Unique fynd transaction id
|
|
174
174
|
* @property {string} method - Payment method
|
|
175
175
|
* @property {string} [device_id] - EDC machine Unique Identifier
|
|
176
176
|
* @property {string} aggregator - Payment gateway name
|
|
177
|
-
* @property {string} customer_id - Payment gateway customer id.
|
|
178
|
-
* @property {string} contact - Customer valid mobile number
|
|
177
|
+
* @property {string} [customer_id] - Payment gateway customer id.
|
|
178
|
+
* @property {string} [contact] - Customer valid mobile number
|
|
179
179
|
* @property {string} merchant_order_id - Unique fynd order id
|
|
180
180
|
* @property {string} [vpa] - Customer vpa address
|
|
181
|
-
* @property {string} order_id - Payment gateway order id
|
|
182
|
-
* @property {string} currency - Currency code.
|
|
183
|
-
* @property {number} amount - Payable amount.
|
|
184
|
-
* @property {string} email - Customer valid email
|
|
181
|
+
* @property {string} [order_id] - Payment gateway order id
|
|
182
|
+
* @property {string} [currency] - Currency code.
|
|
183
|
+
* @property {number} [amount] - Payable amount.
|
|
184
|
+
* @property {string} [email] - Customer valid email
|
|
185
185
|
*/
|
|
186
186
|
/**
|
|
187
187
|
* @typedef PaymentStatusUpdateResponse
|
|
@@ -263,7 +263,7 @@ export = PaymentApplicationModel;
|
|
|
263
263
|
/**
|
|
264
264
|
* @typedef AggregatorRoute
|
|
265
265
|
* @property {Object} [data] - Data
|
|
266
|
-
* @property {
|
|
266
|
+
* @property {Object} [payment_flow_data] - Payment_flow_data
|
|
267
267
|
* @property {string} [payment_flow] - Payment_flow
|
|
268
268
|
* @property {string} [api_link] - Api_link
|
|
269
269
|
*/
|
|
@@ -1544,11 +1544,11 @@ type PaymentStatusUpdateRequest = {
|
|
|
1544
1544
|
/**
|
|
1545
1545
|
* - Status of payment.
|
|
1546
1546
|
*/
|
|
1547
|
-
status
|
|
1547
|
+
status?: string;
|
|
1548
1548
|
/**
|
|
1549
1549
|
* - Unique fynd transaction id
|
|
1550
1550
|
*/
|
|
1551
|
-
merchant_transaction_id
|
|
1551
|
+
merchant_transaction_id?: string;
|
|
1552
1552
|
/**
|
|
1553
1553
|
* - Payment method
|
|
1554
1554
|
*/
|
|
@@ -1564,11 +1564,11 @@ type PaymentStatusUpdateRequest = {
|
|
|
1564
1564
|
/**
|
|
1565
1565
|
* - Payment gateway customer id.
|
|
1566
1566
|
*/
|
|
1567
|
-
customer_id
|
|
1567
|
+
customer_id?: string;
|
|
1568
1568
|
/**
|
|
1569
1569
|
* - Customer valid mobile number
|
|
1570
1570
|
*/
|
|
1571
|
-
contact
|
|
1571
|
+
contact?: string;
|
|
1572
1572
|
/**
|
|
1573
1573
|
* - Unique fynd order id
|
|
1574
1574
|
*/
|
|
@@ -1580,19 +1580,19 @@ type PaymentStatusUpdateRequest = {
|
|
|
1580
1580
|
/**
|
|
1581
1581
|
* - Payment gateway order id
|
|
1582
1582
|
*/
|
|
1583
|
-
order_id
|
|
1583
|
+
order_id?: string;
|
|
1584
1584
|
/**
|
|
1585
1585
|
* - Currency code.
|
|
1586
1586
|
*/
|
|
1587
|
-
currency
|
|
1587
|
+
currency?: string;
|
|
1588
1588
|
/**
|
|
1589
1589
|
* - Payable amount.
|
|
1590
1590
|
*/
|
|
1591
|
-
amount
|
|
1591
|
+
amount?: number;
|
|
1592
1592
|
/**
|
|
1593
1593
|
* - Customer valid email
|
|
1594
1594
|
*/
|
|
1595
|
-
email
|
|
1595
|
+
email?: string;
|
|
1596
1596
|
};
|
|
1597
1597
|
/** @returns {PaymentStatusUpdateResponse} */
|
|
1598
1598
|
declare function PaymentStatusUpdateResponse(): PaymentStatusUpdateResponse;
|
|
@@ -1849,7 +1849,7 @@ type AggregatorRoute = {
|
|
|
1849
1849
|
/**
|
|
1850
1850
|
* - Payment_flow_data
|
|
1851
1851
|
*/
|
|
1852
|
-
payment_flow_data?:
|
|
1852
|
+
payment_flow_data?: any;
|
|
1853
1853
|
/**
|
|
1854
1854
|
* - Payment_flow
|
|
1855
1855
|
*/
|
|
@@ -188,19 +188,19 @@ const Joi = require("joi");
|
|
|
188
188
|
|
|
189
189
|
/**
|
|
190
190
|
* @typedef PaymentStatusUpdateRequest
|
|
191
|
-
* @property {string} status - Status of payment.
|
|
192
|
-
* @property {string} merchant_transaction_id - Unique fynd transaction id
|
|
191
|
+
* @property {string} [status] - Status of payment.
|
|
192
|
+
* @property {string} [merchant_transaction_id] - Unique fynd transaction id
|
|
193
193
|
* @property {string} method - Payment method
|
|
194
194
|
* @property {string} [device_id] - EDC machine Unique Identifier
|
|
195
195
|
* @property {string} aggregator - Payment gateway name
|
|
196
|
-
* @property {string} customer_id - Payment gateway customer id.
|
|
197
|
-
* @property {string} contact - Customer valid mobile number
|
|
196
|
+
* @property {string} [customer_id] - Payment gateway customer id.
|
|
197
|
+
* @property {string} [contact] - Customer valid mobile number
|
|
198
198
|
* @property {string} merchant_order_id - Unique fynd order id
|
|
199
199
|
* @property {string} [vpa] - Customer vpa address
|
|
200
|
-
* @property {string} order_id - Payment gateway order id
|
|
201
|
-
* @property {string} currency - Currency code.
|
|
202
|
-
* @property {number} amount - Payable amount.
|
|
203
|
-
* @property {string} email - Customer valid email
|
|
200
|
+
* @property {string} [order_id] - Payment gateway order id
|
|
201
|
+
* @property {string} [currency] - Currency code.
|
|
202
|
+
* @property {number} [amount] - Payable amount.
|
|
203
|
+
* @property {string} [email] - Customer valid email
|
|
204
204
|
*/
|
|
205
205
|
|
|
206
206
|
/**
|
|
@@ -289,7 +289,7 @@ const Joi = require("joi");
|
|
|
289
289
|
/**
|
|
290
290
|
* @typedef AggregatorRoute
|
|
291
291
|
* @property {Object} [data] - Data
|
|
292
|
-
* @property {
|
|
292
|
+
* @property {Object} [payment_flow_data] - Payment_flow_data
|
|
293
293
|
* @property {string} [payment_flow] - Payment_flow
|
|
294
294
|
* @property {string} [api_link] - Api_link
|
|
295
295
|
*/
|
|
@@ -1399,19 +1399,19 @@ class PaymentApplicationModel {
|
|
|
1399
1399
|
/** @returns {PaymentStatusUpdateRequest} */
|
|
1400
1400
|
static PaymentStatusUpdateRequest() {
|
|
1401
1401
|
return Joi.object({
|
|
1402
|
-
status: Joi.string().allow("")
|
|
1403
|
-
merchant_transaction_id: Joi.string().allow("")
|
|
1402
|
+
status: Joi.string().allow(""),
|
|
1403
|
+
merchant_transaction_id: Joi.string().allow(""),
|
|
1404
1404
|
method: Joi.string().allow("").required(),
|
|
1405
1405
|
device_id: Joi.string().allow("").allow(null),
|
|
1406
1406
|
aggregator: Joi.string().allow("").required(),
|
|
1407
|
-
customer_id: Joi.string().allow("")
|
|
1408
|
-
contact: Joi.string().allow("")
|
|
1407
|
+
customer_id: Joi.string().allow(""),
|
|
1408
|
+
contact: Joi.string().allow(""),
|
|
1409
1409
|
merchant_order_id: Joi.string().allow("").required(),
|
|
1410
1410
|
vpa: Joi.string().allow(""),
|
|
1411
|
-
order_id: Joi.string().allow("")
|
|
1412
|
-
currency: Joi.string().allow("")
|
|
1413
|
-
amount: Joi.number().allow(null)
|
|
1414
|
-
email: Joi.string().allow("")
|
|
1411
|
+
order_id: Joi.string().allow(""),
|
|
1412
|
+
currency: Joi.string().allow(""),
|
|
1413
|
+
amount: Joi.number().allow(null),
|
|
1414
|
+
email: Joi.string().allow(""),
|
|
1415
1415
|
});
|
|
1416
1416
|
}
|
|
1417
1417
|
|
|
@@ -1517,7 +1517,7 @@ class PaymentApplicationModel {
|
|
|
1517
1517
|
static AggregatorRoute() {
|
|
1518
1518
|
return Joi.object({
|
|
1519
1519
|
data: Joi.any().allow(null),
|
|
1520
|
-
payment_flow_data: Joi.
|
|
1520
|
+
payment_flow_data: Joi.any().allow(null),
|
|
1521
1521
|
payment_flow: Joi.string().allow("").allow(null),
|
|
1522
1522
|
api_link: Joi.string().allow("").allow(null),
|
|
1523
1523
|
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export = Webhook;
|
|
2
|
+
declare class Webhook {
|
|
3
|
+
constructor(_conf: any);
|
|
4
|
+
_conf: any;
|
|
5
|
+
_relativeUrls: {
|
|
6
|
+
saveClickEvent: string;
|
|
7
|
+
};
|
|
8
|
+
_urls: {};
|
|
9
|
+
updateUrls(urls: any): void;
|
|
10
|
+
/**
|
|
11
|
+
* @param {WebhookApplicationValidator.SaveClickEventParam} arg - Arg object.
|
|
12
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
13
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
14
|
+
* @returns {Promise<WebhookApplicationModel.ClickEventResponse>} - Success response
|
|
15
|
+
* @name saveClickEvent
|
|
16
|
+
* @summary: Endpoint to capture click events from sales channels and persist them in database.
|
|
17
|
+
* @description: Endpoint to capture click events from sales channels. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/webhook/saveClickEvent/).
|
|
18
|
+
*/
|
|
19
|
+
saveClickEvent({ body, requestHeaders }?: WebhookApplicationValidator.SaveClickEventParam, { responseHeaders }?: object): Promise<WebhookApplicationModel.ClickEventResponse>;
|
|
20
|
+
}
|
|
21
|
+
import WebhookApplicationValidator = require("./WebhookApplicationValidator");
|
|
22
|
+
import WebhookApplicationModel = require("./WebhookApplicationModel");
|