@gofynd/fdk-client-javascript 1.1.3 → 1.1.4

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 (51) hide show
  1. package/README.md +1 -0
  2. package/index.d.ts +4 -1
  3. package/index.js +7 -0
  4. package/package.json +1 -1
  5. package/partner.d.ts +4 -0
  6. package/partner.js +7 -0
  7. package/sdk/application/Common/CommonApplicationModel.js +4 -0
  8. package/sdk/application/Configuration/ConfigurationApplicationModel.js +5 -5
  9. package/sdk/application/Lead/LeadApplicationModel.js +4 -1
  10. package/sdk/partner/OAuthClient.d.ts +14 -0
  11. package/sdk/partner/OAuthClient.js +112 -0
  12. package/sdk/partner/PartnerAPIClient.d.ts +12 -0
  13. package/sdk/partner/PartnerAPIClient.js +42 -0
  14. package/sdk/partner/PartnerClient.d.ts +6 -0
  15. package/sdk/partner/PartnerClient.js +17 -0
  16. package/sdk/partner/PartnerConfig.d.ts +30 -0
  17. package/sdk/partner/PartnerConfig.js +39 -0
  18. package/sdk/partner/index.d.ts +3 -0
  19. package/sdk/partner/index.js +5 -0
  20. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +32 -0
  21. package/sdk/platform/Cart/CartPlatformApplicationClient.js +184 -0
  22. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +3 -0
  23. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +19 -0
  24. package/sdk/platform/Cart/CartPlatformModel.d.ts +6 -0
  25. package/sdk/platform/Cart/CartPlatformModel.js +72 -1
  26. package/sdk/platform/Catalog/CatalogPlatformModel.js +2 -2
  27. package/sdk/platform/Common/CommonPlatformModel.js +4 -0
  28. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +8 -7
  29. package/sdk/platform/Order/OrderPlatformClient.d.ts +3 -1
  30. package/sdk/platform/Order/OrderPlatformClient.js +5 -0
  31. package/sdk/platform/Order/OrderPlatformModel.js +1 -1
  32. package/sdk/platform/Order/OrderPlatformValidator.js +1 -0
  33. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +4 -0
  34. package/sdk/platform/Payment/PaymentPlatformModel.js +42 -7
  35. package/sdk/platform/PlatformApplicationClient.d.ts +103 -2
  36. package/sdk/platform/PlatformApplicationClient.js +109 -0
  37. package/sdk/platform/PlatformClient.d.ts +642 -36
  38. package/sdk/platform/PlatformClient.js +773 -18
  39. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +134 -0
  40. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +852 -0
  41. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +16 -0
  42. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +81 -0
  43. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +223 -0
  44. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +1296 -0
  45. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +97 -0
  46. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +778 -0
  47. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +21 -0
  48. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +130 -0
  49. package/sdk/platform/index.d.ts +1 -0
  50. package/sdk/platform/index.js +2 -0
  51. package/sdk/public/Configuration/ConfigurationPublicModel.js +5 -0
@@ -2,6 +2,7 @@ export = CartValidator;
2
2
  declare class CartValidator {
3
3
  static addAddress(): any;
4
4
  static addItems(): any;
5
+ static addPriceAdjustment(): any;
5
6
  static applyCoupon(): any;
6
7
  static checkCartServiceability(): any;
7
8
  static checkoutCart(): any;
@@ -39,6 +40,7 @@ declare class CartValidator {
39
40
  static platformUpdateCart(): any;
40
41
  static removeAddress(): any;
41
42
  static removeCoupon(): any;
43
+ static removePriceAdjustment(): any;
42
44
  static selectAddress(): any;
43
45
  static selectPaymentMode(): any;
44
46
  static selectPaymentModeV2(): any;
@@ -50,6 +52,7 @@ declare class CartValidator {
50
52
  static updateCartWithSharedItems(): any;
51
53
  static updateCoupon(): any;
52
54
  static updateCouponPartially(): any;
55
+ static updatePriceAdjustment(): any;
53
56
  static updatePromotion(): any;
54
57
  static updatePromotionPartially(): any;
55
58
  static updateShipments(): any;
@@ -16,6 +16,12 @@ class CartValidator {
16
16
  }).required();
17
17
  }
18
18
 
19
+ static addPriceAdjustment() {
20
+ return Joi.object({
21
+ body: CartModel.PriceAdjustmentAdd().required(),
22
+ }).required();
23
+ }
24
+
19
25
  static applyCoupon() {
20
26
  return Joi.object({
21
27
  i: Joi.boolean(),
@@ -305,6 +311,12 @@ class CartValidator {
305
311
  }).required();
306
312
  }
307
313
 
314
+ static removePriceAdjustment() {
315
+ return Joi.object({
316
+ id: Joi.string().allow("").required(),
317
+ }).required();
318
+ }
319
+
308
320
  static selectAddress() {
309
321
  return Joi.object({
310
322
  cartId: Joi.string().allow(""),
@@ -392,6 +404,13 @@ class CartValidator {
392
404
  }).required();
393
405
  }
394
406
 
407
+ static updatePriceAdjustment() {
408
+ return Joi.object({
409
+ id: Joi.string().allow("").required(),
410
+ body: CartModel.PriceAdjustmentUpdate().required(),
411
+ }).required();
412
+ }
413
+
395
414
  static updatePromotion() {
396
415
  return Joi.object({
397
416
  id: Joi.string().allow("").required(),
@@ -10,6 +10,7 @@ declare class CartModel {
10
10
  static AppliedFreeArticles(): any;
11
11
  static AppliedPromotion(): any;
12
12
  static ApplyCouponRequest(): any;
13
+ static Article(): any;
13
14
  static ArticlePriceInfo(): any;
14
15
  static BaseInfo(): any;
15
16
  static BasePrice(): any;
@@ -34,6 +35,7 @@ declare class CartModel {
34
35
  static CategoryInfo(): any;
35
36
  static Charges(): any;
36
37
  static CheckCart(): any;
38
+ static Collection(): any;
37
39
  static CompareObject(): any;
38
40
  static Coupon(): any;
39
41
  static CouponAction(): any;
@@ -109,6 +111,10 @@ declare class CartModel {
109
111
  static PlatformUpdateCartRequest(): any;
110
112
  static PostOrder(): any;
111
113
  static PostOrder1(): any;
114
+ static PriceAdjustment(): any;
115
+ static PriceAdjustmentAdd(): any;
116
+ static PriceAdjustmentResponse(): any;
117
+ static PriceAdjustmentUpdate(): any;
112
118
  static PriceRange(): any;
113
119
  static ProductAction(): any;
114
120
  static ProductArticle(): any;
@@ -129,6 +129,15 @@ class CartModel {
129
129
  coupon_code: Joi.string().allow("").required(),
130
130
  });
131
131
  }
132
+ static Article() {
133
+ return Joi.object({
134
+ article_id: Joi.string().allow("").required(),
135
+ code: Joi.string().allow(""),
136
+ meta: Joi.any(),
137
+ type: Joi.string().allow(""),
138
+ value: Joi.number(),
139
+ });
140
+ }
132
141
  static ArticlePriceInfo() {
133
142
  return Joi.object({
134
143
  base: CartModel.BasePrice(),
@@ -368,6 +377,12 @@ class CartModel {
368
377
  user_type: Joi.string().allow(""),
369
378
  });
370
379
  }
380
+ static Collection() {
381
+ return Joi.object({
382
+ collected_by: Joi.string().allow("").required(),
383
+ refund_by: Joi.string().allow("").required(),
384
+ });
385
+ }
371
386
  static CompareObject() {
372
387
  return Joi.object({
373
388
  equals: Joi.number(),
@@ -1146,6 +1161,62 @@ class CartModel {
1146
1161
  return_allowed: Joi.boolean(),
1147
1162
  });
1148
1163
  }
1164
+ static PriceAdjustment() {
1165
+ return Joi.object({
1166
+ allowed_refund: Joi.boolean(),
1167
+ apply_expiry: Joi.string().allow(""),
1168
+ article_ids: Joi.array().items(CartModel.Article()).required(),
1169
+ article_level_distribution: Joi.boolean().required(),
1170
+ cart_id: Joi.string().allow("").required(),
1171
+ cart_value: Joi.number(),
1172
+ collection: CartModel.Collection().required(),
1173
+ id: Joi.string().allow(""),
1174
+ is_authenticated: Joi.boolean().required(),
1175
+ message: Joi.string().allow("").required(),
1176
+ meta: Joi.any(),
1177
+ type: Joi.string().allow("").required(),
1178
+ value: Joi.number().required(),
1179
+ });
1180
+ }
1181
+ static PriceAdjustmentAdd() {
1182
+ return Joi.object({
1183
+ allowed_refund: Joi.boolean(),
1184
+ apply_expiry: Joi.string().allow(""),
1185
+ article_ids: Joi.array().items(CartModel.Article()).required(),
1186
+ article_level_distribution: Joi.boolean().required(),
1187
+ cart_id: Joi.string().allow("").required(),
1188
+ cart_value: Joi.number(),
1189
+ collection: CartModel.Collection().required(),
1190
+ created_by: Joi.string().allow(""),
1191
+ is_authenticated: Joi.boolean().required(),
1192
+ message: Joi.string().allow("").required(),
1193
+ meta: Joi.any(),
1194
+ type: Joi.string().allow("").required(),
1195
+ value: Joi.number().required(),
1196
+ });
1197
+ }
1198
+ static PriceAdjustmentResponse() {
1199
+ return Joi.object({
1200
+ data: CartModel.PriceAdjustment(),
1201
+ });
1202
+ }
1203
+ static PriceAdjustmentUpdate() {
1204
+ return Joi.object({
1205
+ allowed_refund: Joi.boolean(),
1206
+ apply_expiry: Joi.string().allow(""),
1207
+ article_ids: Joi.array().items(CartModel.Article()).required(),
1208
+ article_level_distribution: Joi.boolean().required(),
1209
+ cart_id: Joi.string().allow("").required(),
1210
+ cart_value: Joi.number(),
1211
+ collection: CartModel.Collection().required(),
1212
+ is_authenticated: Joi.boolean().required(),
1213
+ message: Joi.string().allow("").required(),
1214
+ meta: Joi.any(),
1215
+ modified_by: Joi.string().allow(""),
1216
+ type: Joi.string().allow("").required(),
1217
+ value: Joi.number().required(),
1218
+ });
1219
+ }
1149
1220
  static PriceRange() {
1150
1221
  return Joi.object({
1151
1222
  max: Joi.number(),
@@ -1337,7 +1408,7 @@ class CartModel {
1337
1408
  }
1338
1409
  static PromotionsResponse() {
1339
1410
  return Joi.object({
1340
- items: CartModel.PromotionListItem(),
1411
+ items: Joi.array().items(CartModel.PromotionListItem()),
1341
1412
  page: CartModel.Page(),
1342
1413
  });
1343
1414
  }
@@ -1973,7 +1973,7 @@ class CatalogModel {
1973
1973
  }
1974
1974
  static NetQuantity() {
1975
1975
  return Joi.object({
1976
- unit: Joi.any(),
1976
+ unit: Joi.string().allow(""),
1977
1977
  value: Joi.number(),
1978
1978
  });
1979
1979
  }
@@ -2933,7 +2933,7 @@ class CatalogModel {
2933
2933
  static Trader() {
2934
2934
  return Joi.object({
2935
2935
  address: Joi.array().items(Joi.string().allow("")),
2936
- name: Joi.any().required(),
2936
+ name: Joi.string().allow("").required(),
2937
2937
  type: Joi.string().allow(""),
2938
2938
  });
2939
2939
  }
@@ -96,14 +96,18 @@ class CommonModel {
96
96
  __v: Joi.number(),
97
97
  _id: Joi.string().allow(""),
98
98
  capital: Joi.string().allow(""),
99
+ country_code: Joi.string().allow(""),
99
100
  currency: Joi.string().allow(""),
100
101
  default_currency: CommonModel.LocationDefaultCurrency(),
101
102
  default_language: CommonModel.LocationDefaultLanguage(),
102
103
  iso2: Joi.string().allow(""),
103
104
  iso3: Joi.string().allow(""),
105
+ latitude: Joi.string().allow(""),
106
+ longitude: Joi.string().allow(""),
104
107
  name: Joi.string().allow(""),
105
108
  parent: Joi.string().allow(""),
106
109
  phone_code: Joi.string().allow(""),
110
+ state_code: Joi.string().allow(""),
107
111
  type: Joi.string().allow(""),
108
112
  uid: Joi.number(),
109
113
  });
@@ -149,6 +149,7 @@ class ConfigurationModel {
149
149
  redirections: Joi.array().items(
150
150
  ConfigurationModel.ApplicationRedirections()
151
151
  ),
152
+ slug: Joi.string().allow(""),
152
153
  token: Joi.string().allow(""),
153
154
  updated_at: Joi.string().allow(""),
154
155
  website: ConfigurationModel.ApplicationWebsite(),
@@ -167,13 +168,13 @@ class ConfigurationModel {
167
168
  static ApplicationDetail() {
168
169
  return Joi.object({
169
170
  _id: Joi.string().allow(""),
170
- banner: ConfigurationModel.SecureUrl().required(),
171
- description: Joi.string().allow("").required(),
171
+ banner: ConfigurationModel.SecureUrl(),
172
+ description: Joi.string().allow(""),
172
173
  domain: ConfigurationModel.Domain(),
173
174
  domains: Joi.array().items(ConfigurationModel.Domain()),
174
- favicon: ConfigurationModel.SecureUrl().required(),
175
- logo: ConfigurationModel.SecureUrl().required(),
176
- mobile_logo: ConfigurationModel.SecureUrl().required(),
175
+ favicon: ConfigurationModel.SecureUrl(),
176
+ logo: ConfigurationModel.SecureUrl(),
177
+ mobile_logo: ConfigurationModel.SecureUrl(),
177
178
  name: Joi.string().allow("").required(),
178
179
  });
179
180
  }
@@ -186,7 +187,7 @@ class ConfigurationModel {
186
187
  business_highlights: ConfigurationModel.BusinessHighlights(),
187
188
  copyright_text: Joi.string().allow(""),
188
189
  created_at: Joi.string().allow(""),
189
- links: ConfigurationModel.Links(),
190
+ links: Joi.array().items(ConfigurationModel.Links()),
190
191
  social_links: ConfigurationModel.SocialLinks(),
191
192
  support: ConfigurationModel.InformationSupport(),
192
193
  updated_at: Joi.string().allow(""),
@@ -719,7 +720,7 @@ class ConfigurationModel {
719
720
  city: Joi.string().allow(""),
720
721
  country: Joi.string().allow(""),
721
722
  loc: Joi.string().allow(""),
722
- phone: ConfigurationModel.InformationPhone(),
723
+ phone: Joi.array().items(ConfigurationModel.InformationPhone()),
723
724
  pincode: Joi.number(),
724
725
  });
725
726
  }
@@ -382,11 +382,12 @@ declare class Order {
382
382
  * @param {string} [arg.companyAffiliateTag] -
383
383
  * @param {boolean} [arg.myOrders] -
384
384
  * @param {string} [arg.platformUserId] -
385
+ * @param {string} [arg.tags] - Comma separated values of tags
385
386
  * @returns {Promise<ShipmentInternalPlatformViewResponse>} - Success response
386
387
  * @summary:
387
388
  * @description:
388
389
  */
389
- getShipments({ lane, bagStatus, statusOverrideLane, timeToDispatch, searchType, searchValue, fromDate, toDate, dpIds, stores, salesChannels, pageNo, pageSize, fetchActiveShipment, excludeLockedShipments, paymentMethods, channelShipmentId, channelOrderId, customMeta, orderingChannel, companyAffiliateTag, myOrders, platformUserId, }?: {
390
+ getShipments({ lane, bagStatus, statusOverrideLane, timeToDispatch, searchType, searchValue, fromDate, toDate, dpIds, stores, salesChannels, pageNo, pageSize, fetchActiveShipment, excludeLockedShipments, paymentMethods, channelShipmentId, channelOrderId, customMeta, orderingChannel, companyAffiliateTag, myOrders, platformUserId, tags, }?: {
390
391
  lane?: string;
391
392
  bagStatus?: string;
392
393
  statusOverrideLane?: boolean;
@@ -410,6 +411,7 @@ declare class Order {
410
411
  companyAffiliateTag?: string;
411
412
  myOrders?: boolean;
412
413
  platformUserId?: string;
414
+ tags?: string;
413
415
  }): Promise<ShipmentInternalPlatformViewResponse>;
414
416
  /**
415
417
  * @param {Object} arg - Arg object.
@@ -1833,6 +1833,7 @@ class Order {
1833
1833
  * @param {string} [arg.companyAffiliateTag] -
1834
1834
  * @param {boolean} [arg.myOrders] -
1835
1835
  * @param {string} [arg.platformUserId] -
1836
+ * @param {string} [arg.tags] - Comma separated values of tags
1836
1837
  * @returns {Promise<ShipmentInternalPlatformViewResponse>} - Success response
1837
1838
  * @summary:
1838
1839
  * @description:
@@ -1861,6 +1862,7 @@ class Order {
1861
1862
  companyAffiliateTag,
1862
1863
  myOrders,
1863
1864
  platformUserId,
1865
+ tags,
1864
1866
  } = {}) {
1865
1867
  const { error } = OrderValidator.getShipments().validate(
1866
1868
  {
@@ -1887,6 +1889,7 @@ class Order {
1887
1889
  companyAffiliateTag,
1888
1890
  myOrders,
1889
1891
  platformUserId,
1892
+ tags,
1890
1893
  },
1891
1894
  { abortEarly: false, allowUnknown: true }
1892
1895
  );
@@ -1920,6 +1923,7 @@ class Order {
1920
1923
  companyAffiliateTag,
1921
1924
  myOrders,
1922
1925
  platformUserId,
1926
+ tags,
1923
1927
  },
1924
1928
  { abortEarly: false, allowUnknown: false }
1925
1929
  );
@@ -1955,6 +1959,7 @@ class Order {
1955
1959
  query_params["company_affiliate_tag"] = companyAffiliateTag;
1956
1960
  query_params["my_orders"] = myOrders;
1957
1961
  query_params["platform_user_id"] = platformUserId;
1962
+ query_params["tags"] = tags;
1958
1963
 
1959
1964
  const xHeaders = {};
1960
1965
 
@@ -1008,7 +1008,7 @@ class OrderModel {
1008
1008
  gst_fee: Joi.number().required(),
1009
1009
  gst_tag: Joi.string().allow(""),
1010
1010
  gst_tax_percentage: Joi.number(),
1011
- gstin_code: Joi.string().allow("").allow(null).required(),
1011
+ gstin_code: Joi.string().allow("").allow(null),
1012
1012
  hsn_code: Joi.string().allow(""),
1013
1013
  hsn_code_id: Joi.string().allow(""),
1014
1014
  igst_gst_fee: Joi.string().allow(""),
@@ -220,6 +220,7 @@ class OrderValidator {
220
220
  companyAffiliateTag: Joi.string().allow(""),
221
221
  myOrders: Joi.boolean(),
222
222
  platformUserId: Joi.string().allow(""),
223
+ tags: Joi.string().allow(""),
223
224
  }).required();
224
225
  }
225
226
 
@@ -62,7 +62,11 @@ declare class PaymentModel {
62
62
  static PaymentStatusObject(): any;
63
63
  static PaymentStatusUpdateRequest(): any;
64
64
  static PaymentStatusUpdateResponse(): any;
65
+ static Payout(): any;
66
+ static PayoutAggregator(): any;
65
67
  static PayoutBankDetails(): any;
68
+ static PayoutCustomer(): any;
69
+ static PayoutMoreAttributes(): any;
66
70
  static PayoutRequest(): any;
67
71
  static PayoutResponse(): any;
68
72
  static PayoutsResponse(): any;
@@ -564,6 +564,24 @@ class PaymentModel {
564
564
  success: Joi.boolean().allow(null),
565
565
  });
566
566
  }
567
+ static Payout() {
568
+ return Joi.object({
569
+ customers: PaymentModel.PayoutCustomer().required(),
570
+ is_active: Joi.boolean().required(),
571
+ is_default: Joi.boolean().required(),
572
+ more_attributes: PaymentModel.PayoutMoreAttributes().required(),
573
+ payouts_aggregators: Joi.array().items(PaymentModel.PayoutAggregator()),
574
+ transfer_type: Joi.string().allow("").required(),
575
+ unique_transfer_no: Joi.string().allow("").required(),
576
+ });
577
+ }
578
+ static PayoutAggregator() {
579
+ return Joi.object({
580
+ aggregator_fund_id: Joi.number().allow(null),
581
+ aggregator_id: Joi.number().allow(null),
582
+ payout_details_id: Joi.number().allow(null),
583
+ });
584
+ }
567
585
  static PayoutBankDetails() {
568
586
  return Joi.object({
569
587
  account_holder: Joi.string().allow(""),
@@ -578,6 +596,28 @@ class PaymentModel {
578
596
  state: Joi.string().allow(""),
579
597
  });
580
598
  }
599
+ static PayoutCustomer() {
600
+ return Joi.object({
601
+ email: Joi.string().allow("").allow(null),
602
+ id: Joi.number().allow(null),
603
+ mobile: Joi.string().allow("").allow(null),
604
+ name: Joi.string().allow("").allow(null),
605
+ unique_external_id: Joi.string().allow("").allow(null),
606
+ });
607
+ }
608
+ static PayoutMoreAttributes() {
609
+ return Joi.object({
610
+ account_holder: Joi.string().allow("").allow(null),
611
+ account_no: Joi.string().allow("").allow(null),
612
+ account_type: Joi.string().allow("").allow(null),
613
+ bank_name: Joi.string().allow("").allow(null),
614
+ branch_name: Joi.string().allow("").allow(null),
615
+ city: Joi.string().allow("").allow(null),
616
+ country: Joi.string().allow("").allow(null),
617
+ ifsc_code: Joi.string().allow("").allow(null),
618
+ state: Joi.string().allow("").allow(null),
619
+ });
620
+ }
581
621
  static PayoutRequest() {
582
622
  return Joi.object({
583
623
  aggregator: Joi.string().allow("").required(),
@@ -604,13 +644,8 @@ class PaymentModel {
604
644
  }
605
645
  static PayoutsResponse() {
606
646
  return Joi.object({
607
- customers: Joi.any().required(),
608
- is_active: Joi.boolean().required(),
609
- is_default: Joi.boolean().required(),
610
- more_attributes: Joi.any().required(),
611
- payouts_aggregators: Joi.array().items(Joi.any()).required(),
612
- transfer_type: Joi.string().allow("").required(),
613
- unique_transfer_no: Joi.any().required(),
647
+ items: Joi.array().items(PaymentModel.Payout()).required(),
648
+ success: Joi.boolean().required(),
614
649
  });
615
650
  }
616
651
  static PollingPaymentLinkResponse() {