@gofynd/fdk-client-javascript 1.4.6 → 1.4.8-beta.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.
Files changed (140) hide show
  1. package/README.md +1 -1
  2. package/package.json +2 -2
  3. package/sdk/application/ApplicationClient.d.ts +2 -0
  4. package/sdk/application/ApplicationClient.js +2 -0
  5. package/sdk/application/Cart/CartApplicationClient.d.ts +16 -3
  6. package/sdk/application/Cart/CartApplicationClient.js +118 -13
  7. package/sdk/application/Cart/CartApplicationModel.d.ts +121 -45
  8. package/sdk/application/Cart/CartApplicationModel.js +98 -26
  9. package/sdk/application/Cart/CartApplicationValidator.d.ts +45 -1
  10. package/sdk/application/Cart/CartApplicationValidator.js +26 -0
  11. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +10 -2
  12. package/sdk/application/Catalog/CatalogApplicationModel.js +10 -2
  13. package/sdk/application/Content/ContentApplicationClient.d.ts +1 -1
  14. package/sdk/application/Content/ContentApplicationClient.js +5 -3
  15. package/sdk/application/Content/ContentApplicationModel.d.ts +7 -18
  16. package/sdk/application/Content/ContentApplicationModel.js +6 -20
  17. package/sdk/application/Content/ContentApplicationValidator.d.ts +10 -0
  18. package/sdk/application/Content/ContentApplicationValidator.js +4 -0
  19. package/sdk/application/Lead/LeadApplicationClient.d.ts +0 -27
  20. package/sdk/application/Lead/LeadApplicationClient.js +0 -167
  21. package/sdk/application/Lead/LeadApplicationModel.d.ts +1 -146
  22. package/sdk/application/Lead/LeadApplicationModel.js +0 -126
  23. package/sdk/application/Lead/LeadApplicationValidator.d.ts +1 -25
  24. package/sdk/application/Lead/LeadApplicationValidator.js +0 -24
  25. package/sdk/application/Logistic/LogisticApplicationClient.js +1 -1
  26. package/sdk/application/Logistic/LogisticApplicationModel.d.ts +2 -0
  27. package/sdk/application/Logistic/LogisticApplicationModel.js +2 -0
  28. package/sdk/application/Order/OrderApplicationModel.d.ts +72 -9
  29. package/sdk/application/Order/OrderApplicationModel.js +45 -7
  30. package/sdk/application/Payment/PaymentApplicationModel.d.ts +27 -20
  31. package/sdk/application/Payment/PaymentApplicationModel.js +23 -20
  32. package/sdk/application/Theme/ThemeApplicationModel.d.ts +2 -0
  33. package/sdk/application/Theme/ThemeApplicationModel.js +2 -0
  34. package/sdk/application/Webhook/WebhookApplicationClient.d.ts +22 -0
  35. package/sdk/application/Webhook/WebhookApplicationClient.js +115 -0
  36. package/sdk/application/Webhook/WebhookApplicationModel.d.ts +37 -0
  37. package/sdk/application/Webhook/WebhookApplicationModel.js +46 -0
  38. package/sdk/application/Webhook/WebhookApplicationValidator.d.ts +16 -0
  39. package/sdk/application/Webhook/WebhookApplicationValidator.js +19 -0
  40. package/sdk/application/index.d.ts +1 -0
  41. package/sdk/application/index.js +2 -0
  42. package/sdk/partner/Lead/LeadPartnerClient.d.ts +0 -23
  43. package/sdk/partner/Lead/LeadPartnerClient.js +0 -157
  44. package/sdk/partner/Lead/LeadPartnerModel.d.ts +12 -581
  45. package/sdk/partner/Lead/LeadPartnerModel.js +14 -403
  46. package/sdk/partner/Lead/LeadPartnerValidator.d.ts +0 -2
  47. package/sdk/partner/Lead/LeadPartnerValidator.js +0 -12
  48. package/sdk/partner/Logistics/LogisticsPartnerClient.js +1 -1
  49. package/sdk/partner/Logistics/LogisticsPartnerModel.js +4 -4
  50. package/sdk/partner/Theme/ThemePartnerClient.d.ts +22 -0
  51. package/sdk/partner/Theme/ThemePartnerClient.js +162 -0
  52. package/sdk/partner/Theme/ThemePartnerModel.d.ts +119 -1
  53. package/sdk/partner/Theme/ThemePartnerModel.js +142 -0
  54. package/sdk/partner/Theme/ThemePartnerValidator.d.ts +2 -0
  55. package/sdk/partner/Theme/ThemePartnerValidator.js +14 -0
  56. package/sdk/partner/Webhook/WebhookPartnerClient.d.ts +2 -2
  57. package/sdk/partner/Webhook/WebhookPartnerClient.js +2 -2
  58. package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +23 -19
  59. package/sdk/partner/Webhook/WebhookPartnerModel.js +19 -22
  60. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +43 -0
  61. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +257 -0
  62. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +39 -0
  63. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +45 -0
  64. package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +60 -0
  65. package/sdk/platform/Analytics/AnalyticsPlatformModel.js +57 -0
  66. package/sdk/platform/Billing/BillingPlatformClient.d.ts +304 -43
  67. package/sdk/platform/Billing/BillingPlatformClient.js +2218 -118
  68. package/sdk/platform/Billing/BillingPlatformModel.d.ts +1330 -282
  69. package/sdk/platform/Billing/BillingPlatformModel.js +1808 -590
  70. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +324 -16
  71. package/sdk/platform/Billing/BillingPlatformValidator.js +340 -12
  72. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +36 -3
  73. package/sdk/platform/Cart/CartPlatformApplicationClient.js +276 -3
  74. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +93 -1
  75. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +60 -0
  76. package/sdk/platform/Cart/CartPlatformModel.d.ts +216 -40
  77. package/sdk/platform/Cart/CartPlatformModel.js +166 -24
  78. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +11 -7
  79. package/sdk/platform/Catalog/CatalogPlatformClient.js +37 -14
  80. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +122 -17
  81. package/sdk/platform/Catalog/CatalogPlatformModel.js +141 -15
  82. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +40 -7
  83. package/sdk/platform/Catalog/CatalogPlatformValidator.js +19 -5
  84. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +1 -1
  85. package/sdk/platform/Content/ContentPlatformApplicationClient.js +18 -1
  86. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +25 -0
  87. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +10 -0
  88. package/sdk/platform/Content/ContentPlatformModel.d.ts +8 -4
  89. package/sdk/platform/Content/ContentPlatformModel.js +8 -4
  90. package/sdk/platform/Finance/FinancePlatformClient.d.ts +49 -28
  91. package/sdk/platform/Finance/FinancePlatformClient.js +181 -28
  92. package/sdk/platform/Finance/FinancePlatformModel.d.ts +350 -127
  93. package/sdk/platform/Finance/FinancePlatformModel.js +378 -108
  94. package/sdk/platform/Finance/FinancePlatformValidator.d.ts +56 -43
  95. package/sdk/platform/Finance/FinancePlatformValidator.js +61 -42
  96. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +0 -47
  97. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +0 -321
  98. package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +1 -46
  99. package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +0 -48
  100. package/sdk/platform/Lead/LeadPlatformClient.d.ts +2 -25
  101. package/sdk/platform/Lead/LeadPlatformClient.js +2 -167
  102. package/sdk/platform/Lead/LeadPlatformModel.d.ts +82 -204
  103. package/sdk/platform/Lead/LeadPlatformModel.js +98 -178
  104. package/sdk/platform/Lead/LeadPlatformValidator.d.ts +1 -25
  105. package/sdk/platform/Lead/LeadPlatformValidator.js +0 -24
  106. package/sdk/platform/Order/OrderPlatformClient.d.ts +11 -1
  107. package/sdk/platform/Order/OrderPlatformClient.js +82 -5
  108. package/sdk/platform/Order/OrderPlatformModel.d.ts +270 -29
  109. package/sdk/platform/Order/OrderPlatformModel.js +139 -28
  110. package/sdk/platform/Order/OrderPlatformValidator.d.ts +58 -17
  111. package/sdk/platform/Order/OrderPlatformValidator.js +28 -16
  112. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +14 -2
  113. package/sdk/platform/Payment/PaymentPlatformModel.js +7 -2
  114. package/sdk/platform/PlatformApplicationClient.d.ts +2 -0
  115. package/sdk/platform/PlatformApplicationClient.js +4 -0
  116. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +4 -4
  117. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +12 -0
  118. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +82 -0
  119. package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +18 -1
  120. package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +14 -0
  121. package/sdk/platform/Theme/ThemePlatformModel.d.ts +67 -1
  122. package/sdk/platform/Theme/ThemePlatformModel.js +78 -0
  123. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +24 -40
  124. package/sdk/platform/Webhook/WebhookPlatformClient.js +78 -221
  125. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +168 -167
  126. package/sdk/platform/Webhook/WebhookPlatformModel.js +180 -178
  127. package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +23 -31
  128. package/sdk/platform/Webhook/WebhookPlatformValidator.js +28 -42
  129. package/sdk/platform/index.d.ts +1 -0
  130. package/sdk/platform/index.js +2 -0
  131. package/sdk/public/Billing/BillingPublicClient.d.ts +24 -2
  132. package/sdk/public/Billing/BillingPublicClient.js +156 -3
  133. package/sdk/public/Billing/BillingPublicModel.d.ts +368 -26
  134. package/sdk/public/Billing/BillingPublicModel.js +317 -18
  135. package/sdk/public/Billing/BillingPublicValidator.d.ts +19 -3
  136. package/sdk/public/Billing/BillingPublicValidator.js +22 -3
  137. package/sdk/public/Webhook/WebhookPublicClient.d.ts +2 -2
  138. package/sdk/public/Webhook/WebhookPublicClient.js +2 -2
  139. package/sdk/public/Webhook/WebhookPublicModel.d.ts +24 -22
  140. package/sdk/public/Webhook/WebhookPublicModel.js +24 -22
@@ -12,45 +12,6 @@ const Joi = require("joi");
12
12
  * @property {TicketAsset[]} [attachments] - List of all attachments related to the form
13
13
  */
14
14
 
15
- /**
16
- * @typedef GetTokenForVideoRoomResponse
17
- * @property {string} access_token - Access token to be used for video room
18
- */
19
-
20
- /**
21
- * @typedef GetParticipantsInsideVideoRoomResponse
22
- * @property {Participant[]} participants - List of participants of the video room
23
- */
24
-
25
- /**
26
- * @typedef Participant
27
- * @property {UserSchema} [user]
28
- * @property {string} [identity] - Unique identifier of participant
29
- * @property {string} [status] - Status of participant
30
- */
31
-
32
- /**
33
- * @typedef UserSchema
34
- * @property {string} [application_id]
35
- * @property {string} [user_id]
36
- * @property {string} [first_name]
37
- * @property {Object} [meta]
38
- * @property {string} [last_name]
39
- * @property {PhoneNumber[]} [phone_numbers]
40
- * @property {Email[]} [emails]
41
- * @property {string} [gender]
42
- * @property {string} [dob]
43
- * @property {boolean} [active]
44
- * @property {string} [profile_pic_url]
45
- * @property {string} [username]
46
- * @property {string} [account_type]
47
- * @property {string} [_id]
48
- * @property {string} [created_at]
49
- * @property {string} [updated_at]
50
- * @property {string} [external_id]
51
- * @property {string} [rr_id]
52
- */
53
-
54
15
  /**
55
16
  * @typedef SubmitCustomFormResponse
56
17
  * @property {string} message - Success message for form submission
@@ -195,23 +156,6 @@ const Joi = require("joi");
195
156
  * @property {string} [created_at] - Time when the ticket was created
196
157
  */
197
158
 
198
- /**
199
- * @typedef PhoneNumber
200
- * @property {string} [phone] - Phone number
201
- * @property {number} [country_code] - Country code
202
- * @property {boolean} [active] - Is the phone number active
203
- * @property {boolean} [primary] - Is it a primary phone number
204
- * @property {boolean} [verified] - Is the phone number verified
205
- */
206
-
207
- /**
208
- * @typedef Email
209
- * @property {string} [email] - Email address
210
- * @property {boolean} [active] - Is the email active
211
- * @property {boolean} [primary] - Is it a primary email
212
- * @property {boolean} [verified] - Is the email verified
213
- */
214
-
215
159
  /** @typedef {"low" | "medium" | "high" | "urgent"} PriorityEnum */
216
160
 
217
161
  /** @typedef {"rating" | "log" | "comment" | "thread"} HistoryTypeEnum */
@@ -247,55 +191,6 @@ class LeadApplicationModel {
247
191
  });
248
192
  }
249
193
 
250
- /** @returns {GetTokenForVideoRoomResponse} */
251
- static GetTokenForVideoRoomResponse() {
252
- return Joi.object({
253
- access_token: Joi.string().allow("").required(),
254
- });
255
- }
256
-
257
- /** @returns {GetParticipantsInsideVideoRoomResponse} */
258
- static GetParticipantsInsideVideoRoomResponse() {
259
- return Joi.object({
260
- participants: Joi.array()
261
- .items(LeadApplicationModel.Participant())
262
- .required(),
263
- });
264
- }
265
-
266
- /** @returns {Participant} */
267
- static Participant() {
268
- return Joi.object({
269
- user: LeadApplicationModel.UserSchema(),
270
- identity: Joi.string().allow(""),
271
- status: Joi.string().allow(""),
272
- });
273
- }
274
-
275
- /** @returns {UserSchema} */
276
- static UserSchema() {
277
- return Joi.object({
278
- application_id: Joi.string().allow(""),
279
- user_id: Joi.string().allow(""),
280
- first_name: Joi.string().allow(""),
281
- meta: Joi.any(),
282
- last_name: Joi.string().allow(""),
283
- phone_numbers: Joi.array().items(LeadApplicationModel.PhoneNumber()),
284
- emails: Joi.array().items(LeadApplicationModel.Email()),
285
- gender: Joi.string().allow(""),
286
- dob: Joi.string().allow(""),
287
- active: Joi.boolean(),
288
- profile_pic_url: Joi.string().allow(""),
289
- username: Joi.string().allow(""),
290
- account_type: Joi.string().allow(""),
291
- _id: Joi.string().allow(""),
292
- created_at: Joi.string().allow(""),
293
- updated_at: Joi.string().allow(""),
294
- external_id: Joi.string().allow(""),
295
- rr_id: Joi.string().allow(""),
296
- });
297
- }
298
-
299
194
  /** @returns {SubmitCustomFormResponse} */
300
195
  static SubmitCustomFormResponse() {
301
196
  return Joi.object({
@@ -465,27 +360,6 @@ class LeadApplicationModel {
465
360
  });
466
361
  }
467
362
 
468
- /** @returns {PhoneNumber} */
469
- static PhoneNumber() {
470
- return Joi.object({
471
- phone: Joi.string().allow(""),
472
- country_code: Joi.number(),
473
- active: Joi.boolean(),
474
- primary: Joi.boolean(),
475
- verified: Joi.boolean(),
476
- });
477
- }
478
-
479
- /** @returns {Email} */
480
- static Email() {
481
- return Joi.object({
482
- email: Joi.string().allow(""),
483
- active: Joi.boolean(),
484
- primary: Joi.boolean(),
485
- verified: Joi.boolean(),
486
- });
487
- }
488
-
489
363
  /**
490
364
  * Enum: PriorityEnum Used By: Lead
491
365
  *
@@ -12,18 +12,10 @@ export = LeadApplicationValidator;
12
12
  * @typedef GetCustomFormParam
13
13
  * @property {string} slug - Slug of form whose response is getting submitted
14
14
  */
15
- /**
16
- * @typedef GetParticipantsInsideVideoRoomParam
17
- * @property {string} uniqueName - Unique name of Video Room
18
- */
19
15
  /**
20
16
  * @typedef GetTicketParam
21
17
  * @property {string} id - ID of ticket to be retrieved
22
18
  */
23
- /**
24
- * @typedef GetTokenForVideoRoomParam
25
- * @property {string} uniqueName - Unique name of Video Room
26
- */
27
19
  /**
28
20
  * @typedef SubmitCustomFormParam
29
21
  * @property {string} slug - Slug of form whose response is getting submitted
@@ -36,17 +28,13 @@ declare class LeadApplicationValidator {
36
28
  static createTicket(): CreateTicketParam;
37
29
  /** @returns {GetCustomFormParam} */
38
30
  static getCustomForm(): GetCustomFormParam;
39
- /** @returns {GetParticipantsInsideVideoRoomParam} */
40
- static getParticipantsInsideVideoRoom(): GetParticipantsInsideVideoRoomParam;
41
31
  /** @returns {GetTicketParam} */
42
32
  static getTicket(): GetTicketParam;
43
- /** @returns {GetTokenForVideoRoomParam} */
44
- static getTokenForVideoRoom(): GetTokenForVideoRoomParam;
45
33
  /** @returns {SubmitCustomFormParam} */
46
34
  static submitCustomForm(): SubmitCustomFormParam;
47
35
  }
48
36
  declare namespace LeadApplicationValidator {
49
- export { CreateHistoryParam, CreateTicketParam, GetCustomFormParam, GetParticipantsInsideVideoRoomParam, GetTicketParam, GetTokenForVideoRoomParam, SubmitCustomFormParam };
37
+ export { CreateHistoryParam, CreateTicketParam, GetCustomFormParam, GetTicketParam, SubmitCustomFormParam };
50
38
  }
51
39
  type CreateHistoryParam = {
52
40
  /**
@@ -64,24 +52,12 @@ type GetCustomFormParam = {
64
52
  */
65
53
  slug: string;
66
54
  };
67
- type GetParticipantsInsideVideoRoomParam = {
68
- /**
69
- * - Unique name of Video Room
70
- */
71
- uniqueName: string;
72
- };
73
55
  type GetTicketParam = {
74
56
  /**
75
57
  * - ID of ticket to be retrieved
76
58
  */
77
59
  id: string;
78
60
  };
79
- type GetTokenForVideoRoomParam = {
80
- /**
81
- * - Unique name of Video Room
82
- */
83
- uniqueName: string;
84
- };
85
61
  type SubmitCustomFormParam = {
86
62
  /**
87
63
  * - Slug of form whose response is getting submitted
@@ -18,21 +18,11 @@ const LeadApplicationModel = require("./LeadApplicationModel");
18
18
  * @property {string} slug - Slug of form whose response is getting submitted
19
19
  */
20
20
 
21
- /**
22
- * @typedef GetParticipantsInsideVideoRoomParam
23
- * @property {string} uniqueName - Unique name of Video Room
24
- */
25
-
26
21
  /**
27
22
  * @typedef GetTicketParam
28
23
  * @property {string} id - ID of ticket to be retrieved
29
24
  */
30
25
 
31
- /**
32
- * @typedef GetTokenForVideoRoomParam
33
- * @property {string} uniqueName - Unique name of Video Room
34
- */
35
-
36
26
  /**
37
27
  * @typedef SubmitCustomFormParam
38
28
  * @property {string} slug - Slug of form whose response is getting submitted
@@ -62,13 +52,6 @@ class LeadApplicationValidator {
62
52
  }).required();
63
53
  }
64
54
 
65
- /** @returns {GetParticipantsInsideVideoRoomParam} */
66
- static getParticipantsInsideVideoRoom() {
67
- return Joi.object({
68
- uniqueName: Joi.string().allow("").required(),
69
- }).required();
70
- }
71
-
72
55
  /** @returns {GetTicketParam} */
73
56
  static getTicket() {
74
57
  return Joi.object({
@@ -76,13 +59,6 @@ class LeadApplicationValidator {
76
59
  }).required();
77
60
  }
78
61
 
79
- /** @returns {GetTokenForVideoRoomParam} */
80
- static getTokenForVideoRoom() {
81
- return Joi.object({
82
- uniqueName: Joi.string().allow("").required(),
83
- }).required();
84
- }
85
-
86
62
  /** @returns {SubmitCustomFormParam} */
87
63
  static submitCustomForm() {
88
64
  return Joi.object({
@@ -15,7 +15,7 @@ class Logistic {
15
15
  this._conf = _conf;
16
16
  this._relativeUrls = {
17
17
  getAllCountries: "/service/application/logistics/v1.0/country-list",
18
- getCountries: "/service/application/logistics/v1.0/countries",
18
+ getCountries: "/service/application/logistics/v2.0/countries",
19
19
  getCountry:
20
20
  "/service/application/logistics/v1.0/countries/{country_iso_code}",
21
21
  getLocalities:
@@ -379,6 +379,7 @@ export = LogisticApplicationModel;
379
379
  /**
380
380
  * @typedef ErrorResponse
381
381
  * @property {string} [error]
382
+ * @property {string} [message]
382
383
  */
383
384
  declare class LogisticApplicationModel {
384
385
  }
@@ -852,4 +853,5 @@ type GetLocality = {
852
853
  declare function ErrorResponse(): ErrorResponse;
853
854
  type ErrorResponse = {
854
855
  error?: string;
856
+ message?: string;
855
857
  };
@@ -430,6 +430,7 @@ const Joi = require("joi");
430
430
  /**
431
431
  * @typedef ErrorResponse
432
432
  * @property {string} [error]
433
+ * @property {string} [message]
433
434
  */
434
435
 
435
436
  class LogisticApplicationModel {
@@ -970,6 +971,7 @@ class LogisticApplicationModel {
970
971
  static ErrorResponse() {
971
972
  return Joi.object({
972
973
  error: Joi.string().allow(""),
974
+ message: Joi.string().allow(""),
973
975
  });
974
976
  }
975
977
  }
@@ -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 DeliveryAddress
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 {ShipmentPayment[]} [payment_info]
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 {DeliveryAddress} [delivery_address]
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]
@@ -323,6 +341,7 @@ export = OrderApplicationModel;
323
341
  * @property {string} [order_id]
324
342
  * @property {Shipments[]} [shipments]
325
343
  * @property {BagsForReorder[]} [bags_for_reorder]
344
+ * @property {Object} [meta]
326
345
  */
327
346
  /**
328
347
  * @typedef OrderStatuses
@@ -536,7 +555,7 @@ export = OrderApplicationModel;
536
555
  declare class OrderApplicationModel {
537
556
  }
538
557
  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, DeliveryAddress, 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 };
558
+ 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
559
  }
541
560
  /** @returns {OrderPage} */
542
561
  declare function OrderPage(): OrderPage;
@@ -576,6 +595,42 @@ type ShipmentPayment = {
576
595
  logo?: string;
577
596
  display_name?: string;
578
597
  };
598
+ /** @returns {ShipmentPaymentInfo} */
599
+ declare function ShipmentPaymentInfo(): ShipmentPaymentInfo;
600
+ type ShipmentPaymentInfo = {
601
+ /**
602
+ * - Stands for "Mode of Payment". This is a short code
603
+ * (like "COD" for Cash On Delivery) that represents the payment method used.
604
+ */
605
+ mop?: string;
606
+ /**
607
+ * - Information about the payment mode,
608
+ * indicates whether COD or PREPAID
609
+ */
610
+ payment_mode?: string;
611
+ /**
612
+ * - Indicates the current status of the payment,
613
+ * Paid or Unpaid
614
+ */
615
+ status?: string;
616
+ /**
617
+ * - Information about the payment source. For eg, NB_ICICI
618
+ */
619
+ mode?: string;
620
+ /**
621
+ * - A URL to an image representing the payment method
622
+ */
623
+ logo?: string;
624
+ /**
625
+ * - The name of the payment method as it
626
+ * should be displayed to the user
627
+ */
628
+ display_name?: string;
629
+ /**
630
+ * - Amount paid using this payment method
631
+ */
632
+ amount?: number;
633
+ };
579
634
  /** @returns {ShipmentUserInfo} */
580
635
  declare function ShipmentUserInfo(): ShipmentUserInfo;
581
636
  type ShipmentUserInfo = {
@@ -794,9 +849,9 @@ declare function Article(): Article;
794
849
  type Article = {
795
850
  tags?: string[];
796
851
  };
797
- /** @returns {DeliveryAddress} */
798
- declare function DeliveryAddress(): DeliveryAddress;
799
- type DeliveryAddress = {
852
+ /** @returns {Address} */
853
+ declare function Address(): Address;
854
+ type Address = {
800
855
  pincode?: string;
801
856
  phone?: string;
802
857
  latitude?: number;
@@ -825,7 +880,12 @@ type DeliveryAddress = {
825
880
  declare function Shipments(): Shipments;
826
881
  type Shipments = {
827
882
  payment?: ShipmentPayment;
828
- payment_info?: ShipmentPayment[];
883
+ /**
884
+ * - "Array of objects
885
+ * containing payment methods used for placing an order. Each object will
886
+ * provide information about corresponding payment method with relevant details."
887
+ */
888
+ payment_info?: ShipmentPaymentInfo[];
829
889
  order_type?: string;
830
890
  show_download_invoice?: boolean;
831
891
  can_cancel?: boolean;
@@ -856,7 +916,8 @@ type Shipments = {
856
916
  beneficiary_details?: boolean;
857
917
  fulfilling_company?: FulfillingCompany;
858
918
  can_return?: boolean;
859
- delivery_address?: DeliveryAddress;
919
+ delivery_address?: Address;
920
+ billing_address?: Address;
860
921
  track_url?: string;
861
922
  order_id?: string;
862
923
  need_help_url?: string;
@@ -884,6 +945,7 @@ type BagsForReorder = {
884
945
  declare function OrderSchema(): OrderSchema;
885
946
  type OrderSchema = {
886
947
  total_shipments_in_order?: number;
948
+ gstin_code?: string;
887
949
  user_info?: UserInfo;
888
950
  breakup_values?: BreakupValues[];
889
951
  order_created_time?: string;
@@ -891,6 +953,7 @@ type OrderSchema = {
891
953
  order_id?: string;
892
954
  shipments?: Shipments[];
893
955
  bags_for_reorder?: BagsForReorder[];
956
+ meta?: any;
894
957
  };
895
958
  /** @returns {OrderStatuses} */
896
959
  declare function OrderStatuses(): OrderStatuses;
@@ -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 DeliveryAddress
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 {ShipmentPayment[]} [payment_info]
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 {DeliveryAddress} [delivery_address]
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]
@@ -352,6 +371,7 @@ const Joi = require("joi");
352
371
  * @property {string} [order_id]
353
372
  * @property {Shipments[]} [shipments]
354
373
  * @property {BagsForReorder[]} [bags_for_reorder]
374
+ * @property {Object} [meta]
355
375
  */
356
376
 
357
377
  /**
@@ -647,6 +667,19 @@ class OrderApplicationModel {
647
667
  });
648
668
  }
649
669
 
670
+ /** @returns {ShipmentPaymentInfo} */
671
+ static ShipmentPaymentInfo() {
672
+ return Joi.object({
673
+ mop: Joi.string().allow(""),
674
+ payment_mode: Joi.string().allow(""),
675
+ status: Joi.string().allow(""),
676
+ mode: Joi.string().allow(""),
677
+ logo: Joi.string().allow(""),
678
+ display_name: Joi.string().allow(""),
679
+ amount: Joi.number(),
680
+ });
681
+ }
682
+
650
683
  /** @returns {ShipmentUserInfo} */
651
684
  static ShipmentUserInfo() {
652
685
  return Joi.object({
@@ -911,8 +944,8 @@ class OrderApplicationModel {
911
944
  });
912
945
  }
913
946
 
914
- /** @returns {DeliveryAddress} */
915
- static DeliveryAddress() {
947
+ /** @returns {Address} */
948
+ static Address() {
916
949
  return Joi.object({
917
950
  pincode: Joi.string().allow(""),
918
951
  phone: Joi.string().allow(""),
@@ -944,7 +977,9 @@ class OrderApplicationModel {
944
977
  static Shipments() {
945
978
  return Joi.object({
946
979
  payment: OrderApplicationModel.ShipmentPayment(),
947
- payment_info: Joi.array().items(OrderApplicationModel.ShipmentPayment()),
980
+ payment_info: Joi.array().items(
981
+ OrderApplicationModel.ShipmentPaymentInfo()
982
+ ),
948
983
  order_type: Joi.string().allow("").allow(null),
949
984
  show_download_invoice: Joi.boolean(),
950
985
  can_cancel: Joi.boolean(),
@@ -977,7 +1012,8 @@ class OrderApplicationModel {
977
1012
  beneficiary_details: Joi.boolean(),
978
1013
  fulfilling_company: OrderApplicationModel.FulfillingCompany(),
979
1014
  can_return: Joi.boolean(),
980
- delivery_address: OrderApplicationModel.DeliveryAddress(),
1015
+ delivery_address: OrderApplicationModel.Address(),
1016
+ billing_address: OrderApplicationModel.Address(),
981
1017
  track_url: Joi.string().allow(""),
982
1018
  order_id: Joi.string().allow(""),
983
1019
  need_help_url: Joi.string().allow(""),
@@ -1011,6 +1047,7 @@ class OrderApplicationModel {
1011
1047
  static OrderSchema() {
1012
1048
  return Joi.object({
1013
1049
  total_shipments_in_order: Joi.number(),
1050
+ gstin_code: Joi.string().allow(""),
1014
1051
  user_info: OrderApplicationModel.UserInfo(),
1015
1052
  breakup_values: Joi.array().items(OrderApplicationModel.BreakupValues()),
1016
1053
  order_created_time: Joi.string().allow(""),
@@ -1020,6 +1057,7 @@ class OrderApplicationModel {
1020
1057
  bags_for_reorder: Joi.array().items(
1021
1058
  OrderApplicationModel.BagsForReorder()
1022
1059
  ),
1060
+ meta: Joi.object().pattern(/\S/, Joi.any()),
1023
1061
  });
1024
1062
  }
1025
1063