@gofynd/fdk-client-javascript 3.17.0 → 3.17.1

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 (44) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/sdk/application/Cart/CartApplicationClient.d.ts +40 -0
  4. package/sdk/application/Cart/CartApplicationClient.js +176 -0
  5. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +18 -4
  6. package/sdk/application/Catalog/CatalogApplicationClient.js +47 -4
  7. package/sdk/application/Content/ContentApplicationClient.d.ts +11 -1
  8. package/sdk/application/Content/ContentApplicationClient.js +40 -2
  9. package/sdk/application/Payment/PaymentApplicationClient.d.ts +1 -1
  10. package/sdk/application/Payment/PaymentApplicationClient.js +2 -0
  11. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +72 -10
  12. package/sdk/platform/Cart/CartPlatformApplicationClient.js +634 -33
  13. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +225 -1
  14. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +147 -0
  15. package/sdk/platform/Cart/CartPlatformModel.d.ts +951 -1
  16. package/sdk/platform/Cart/CartPlatformModel.js +597 -1
  17. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +123 -3
  18. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +829 -39
  19. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +205 -7
  20. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +154 -3
  21. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +5 -5
  22. package/sdk/platform/Catalog/CatalogPlatformClient.js +8 -5
  23. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +1020 -29
  24. package/sdk/platform/Catalog/CatalogPlatformModel.js +836 -24
  25. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +7 -0
  26. package/sdk/platform/Catalog/CatalogPlatformValidator.js +3 -0
  27. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +92 -1
  28. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +54 -0
  29. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +21 -0
  30. package/sdk/platform/Discount/DiscountPlatformModel.js +9 -0
  31. package/sdk/platform/Order/OrderPlatformClient.d.ts +1 -1
  32. package/sdk/platform/Order/OrderPlatformClient.js +1 -1
  33. package/sdk/platform/Order/OrderPlatformModel.d.ts +20 -2
  34. package/sdk/platform/Order/OrderPlatformModel.js +9 -1
  35. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +14 -3
  36. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +88 -6
  37. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +28 -3
  38. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +22 -2
  39. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +356 -1
  40. package/sdk/platform/Payment/PaymentPlatformModel.js +229 -0
  41. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +29 -0
  42. package/sdk/platform/Webhook/WebhookPlatformModel.js +13 -0
  43. package/sdk/public/Webhook/WebhookPublicModel.d.ts +29 -0
  44. package/sdk/public/Webhook/WebhookPublicModel.js +13 -0
@@ -1,5 +1,21 @@
1
1
  const Joi = require("joi");
2
2
 
3
+ /**
4
+ * @typedef AggregatorToken
5
+ * @property {number} payment_mode_id - Payment mode identifier Supported values are:
6
+ *
7
+ * - **4**: Wallet
8
+ * - **3**: Net Banking
9
+ * - **2**: Card
10
+ * - **1**: Pay Later
11
+ *
12
+ * @property {string} sub_payment_mode_code - Sub-payment method code
13
+ * @property {string} token - Token value to be saved for the aggregator
14
+ * @property {string} status - Status of the token verification
15
+ * @property {boolean} is_active - Enable or Disable Flag
16
+ * @property {string} domain - Name of domain
17
+ */
18
+
3
19
  /**
4
20
  * @typedef PaymentGatewayConfigDetails
5
21
  * @property {Object[]} [aggregators] - List of all config specific to the
@@ -824,6 +840,100 @@ const Joi = require("joi");
824
840
  * @property {boolean} success - Response is successful or not.
825
841
  */
826
842
 
843
+ /**
844
+ * @typedef PaymentModeConfig
845
+ * @property {string} [business_unit] - Business unit for which the configuration applies.
846
+ * @property {string} [device] - Device type for which the configuration applies.
847
+ * @property {boolean} [is_active] - Indicates if the payment configuration is
848
+ * currently active.
849
+ * @property {PaymentModeItems[]} [items] - List of payment modes available for
850
+ * the given business unit and device. This list is dynamic and can contain
851
+ * one or more payment modes.
852
+ */
853
+
854
+ /**
855
+ * @typedef PaymentModeItems
856
+ * @property {number} [id] - Unique identifier for the payment mode.
857
+ * @property {string} [name] - Display name of the payment mode.
858
+ * @property {string} [short_code] - Short code for the payment mode.
859
+ * @property {LogoSet} [logos]
860
+ * @property {boolean} [is_active] - Indicates if this payment mode is active in
861
+ * the system.
862
+ * @property {SubPaymentMode[]} [sub_payment_mode] - Dynamic list of sub-payment
863
+ * modes under this payment mode.
864
+ * @property {boolean} [is_active_at_pg] - Indicates if this payment mode is
865
+ * active at the payment gateway (PG) side.
866
+ * @property {Object} [fulfillment_options] - Fulfillment options applicable for
867
+ * these payment modes. Keys are option slugs and values indicate whether the
868
+ * option is enabled.
869
+ */
870
+
871
+ /**
872
+ * @typedef SubPaymentMode
873
+ * @property {string} [code] - Unique code of the sub-payment mode.
874
+ * @property {boolean} [is_active] - Indicates if this sub-payment mode is
875
+ * active in the system.
876
+ * @property {number} [priority] - Priority used for ordering in UI. Lower
877
+ * numbers can represent higher priority, depending on implementation.
878
+ * @property {LogoSet} [logos]
879
+ * @property {string} [name] - Human-readable name of the sub-payment mode.
880
+ * @property {boolean} [is_active_at_pg] - Indicates if this sub-payment mode is
881
+ * active at the payment gateway (PG) side.
882
+ */
883
+
884
+ /**
885
+ * @typedef LogoSet
886
+ * @property {string} [large] - URL of the large-sized logo.
887
+ * @property {string} [small] - URL of the small-sized logo.
888
+ */
889
+
890
+ /**
891
+ * @typedef PlatformLogoSet
892
+ * @property {string} [large] - URL of the large-sized logo.
893
+ * @property {string} [small] - URL of the small-sized logo.
894
+ */
895
+
896
+ /**
897
+ * @typedef PlatformConfigPaymentModeDetails
898
+ * @property {string} [business_unit] - Business unit for which the
899
+ * configuration applies (e.g. "storefront", "pos").
900
+ * @property {string} [device] - Device or channel for which the configuration
901
+ * applies (e.g. "desktop", "android", "ios").
902
+ * @property {Object} [fulfillment_options] - Fulfillment options applicable for
903
+ * these payment modes. Keys are option slugs (e.g. "self-pickup", "delivery")
904
+ * and values indicate whether the option is enabled.
905
+ * @property {boolean} [is_active] - Overall active status for this aggregator
906
+ * payment configuration for the given application and device.
907
+ * @property {PlatformPaymentModeItem[]} [items] - List of payment modes and
908
+ * their configuration.
909
+ */
910
+
911
+ /**
912
+ * @typedef PlatformPaymentModeItem
913
+ * @property {number} [id] - Unique identifier of the payment mode.
914
+ * @property {string} [name] - Human readable name of the payment mode.
915
+ * @property {string} [short_code] - Short code representing the payment mode.
916
+ * @property {PlatformLogoSet} [logos]
917
+ * @property {boolean} [is_active] - Indicates if the payment mode is enabled on
918
+ * the platform.
919
+ * @property {boolean} [is_active_at_pg] - Indicates if the payment mode is
920
+ * active at the payment gateway.
921
+ * @property {PlatformSubPaymentMode[]} [sub_payment_mode] - List of sub payment
922
+ * modes (e.g. card networks like VISA, MASTERCARD).
923
+ */
924
+
925
+ /**
926
+ * @typedef PlatformSubPaymentMode
927
+ * @property {string} [code] - Code of the sub payment mode (e.g. "VISA", "AMEX").
928
+ * @property {string} [name] - Human readable name of the sub payment mode.
929
+ * @property {boolean} [is_active] - Indicates if the sub payment mode is enabled.
930
+ * @property {boolean} [is_active_at_pg] - Indicates if the sub payment mode is
931
+ * active at payment gateway.
932
+ * @property {number} [priority] - Display priority for the sub payment mode.
933
+ * Lower numbers indicate higher priority.
934
+ * @property {PlatformLogoSet} [logos]
935
+ */
936
+
827
937
  /**
828
938
  * @typedef MerchnatPaymentModeCreation
829
939
  * @property {Object} [offline] - Details to be updated for online payment configuration.
@@ -1293,7 +1403,26 @@ const Joi = require("joi");
1293
1403
  * @property {CreditAccountSummary} [account]
1294
1404
  */
1295
1405
 
1406
+ /**
1407
+ * @typedef OperationResponseSchema
1408
+ * @property {boolean} success - Indicates if the operation was successful
1409
+ * @property {string} [message] - Optional message providing additional
1410
+ * information about the operation
1411
+ */
1412
+
1296
1413
  class PaymentPlatformModel {
1414
+ /** @returns {AggregatorToken} */
1415
+ static AggregatorToken() {
1416
+ return Joi.object({
1417
+ payment_mode_id: Joi.number().required(),
1418
+ sub_payment_mode_code: Joi.string().allow("").required(),
1419
+ token: Joi.string().allow("").required(),
1420
+ status: Joi.string().allow("").required(),
1421
+ is_active: Joi.boolean().required(),
1422
+ domain: Joi.string().allow("").required(),
1423
+ });
1424
+ }
1425
+
1297
1426
  /** @returns {PaymentGatewayConfigDetails} */
1298
1427
  static PaymentGatewayConfigDetails() {
1299
1428
  return Joi.object({
@@ -2305,6 +2434,98 @@ class PaymentPlatformModel {
2305
2434
  });
2306
2435
  }
2307
2436
 
2437
+ /** @returns {PaymentModeConfig} */
2438
+ static PaymentModeConfig() {
2439
+ return Joi.object({
2440
+ business_unit: Joi.string().allow(""),
2441
+ device: Joi.string().allow(""),
2442
+ is_active: Joi.boolean(),
2443
+ items: Joi.array().items(PaymentPlatformModel.PaymentModeItems()),
2444
+ });
2445
+ }
2446
+
2447
+ /** @returns {PaymentModeItems} */
2448
+ static PaymentModeItems() {
2449
+ return Joi.object({
2450
+ id: Joi.number(),
2451
+ name: Joi.string().allow(""),
2452
+ short_code: Joi.string().allow(""),
2453
+ logos: PaymentPlatformModel.LogoSet(),
2454
+ is_active: Joi.boolean(),
2455
+ sub_payment_mode: Joi.array().items(
2456
+ PaymentPlatformModel.SubPaymentMode()
2457
+ ),
2458
+ is_active_at_pg: Joi.boolean(),
2459
+ fulfillment_options: Joi.object().pattern(/\S/, Joi.any()),
2460
+ });
2461
+ }
2462
+
2463
+ /** @returns {SubPaymentMode} */
2464
+ static SubPaymentMode() {
2465
+ return Joi.object({
2466
+ code: Joi.string().allow(""),
2467
+ is_active: Joi.boolean(),
2468
+ priority: Joi.number(),
2469
+ logos: PaymentPlatformModel.LogoSet(),
2470
+ name: Joi.string().allow(""),
2471
+ is_active_at_pg: Joi.boolean(),
2472
+ });
2473
+ }
2474
+
2475
+ /** @returns {LogoSet} */
2476
+ static LogoSet() {
2477
+ return Joi.object({
2478
+ large: Joi.string().allow(""),
2479
+ small: Joi.string().allow(""),
2480
+ });
2481
+ }
2482
+
2483
+ /** @returns {PlatformLogoSet} */
2484
+ static PlatformLogoSet() {
2485
+ return Joi.object({
2486
+ large: Joi.string().allow(""),
2487
+ small: Joi.string().allow(""),
2488
+ });
2489
+ }
2490
+
2491
+ /** @returns {PlatformConfigPaymentModeDetails} */
2492
+ static PlatformConfigPaymentModeDetails() {
2493
+ return Joi.object({
2494
+ business_unit: Joi.string().allow(""),
2495
+ device: Joi.string().allow(""),
2496
+ fulfillment_options: Joi.object().pattern(/\S/, Joi.any()),
2497
+ is_active: Joi.boolean(),
2498
+ items: Joi.array().items(PaymentPlatformModel.PlatformPaymentModeItem()),
2499
+ });
2500
+ }
2501
+
2502
+ /** @returns {PlatformPaymentModeItem} */
2503
+ static PlatformPaymentModeItem() {
2504
+ return Joi.object({
2505
+ id: Joi.number(),
2506
+ name: Joi.string().allow(""),
2507
+ short_code: Joi.string().allow(""),
2508
+ logos: PaymentPlatformModel.PlatformLogoSet(),
2509
+ is_active: Joi.boolean(),
2510
+ is_active_at_pg: Joi.boolean(),
2511
+ sub_payment_mode: Joi.array().items(
2512
+ PaymentPlatformModel.PlatformSubPaymentMode()
2513
+ ),
2514
+ });
2515
+ }
2516
+
2517
+ /** @returns {PlatformSubPaymentMode} */
2518
+ static PlatformSubPaymentMode() {
2519
+ return Joi.object({
2520
+ code: Joi.string().allow(""),
2521
+ name: Joi.string().allow(""),
2522
+ is_active: Joi.boolean(),
2523
+ is_active_at_pg: Joi.boolean(),
2524
+ priority: Joi.number(),
2525
+ logos: PaymentPlatformModel.PlatformLogoSet(),
2526
+ });
2527
+ }
2528
+
2308
2529
  /** @returns {MerchnatPaymentModeCreation} */
2309
2530
  static MerchnatPaymentModeCreation() {
2310
2531
  return Joi.object({
@@ -2831,5 +3052,13 @@ class PaymentPlatformModel {
2831
3052
  account: PaymentPlatformModel.CreditAccountSummary(),
2832
3053
  });
2833
3054
  }
3055
+
3056
+ /** @returns {OperationResponseSchema} */
3057
+ static OperationResponseSchema() {
3058
+ return Joi.object({
3059
+ success: Joi.boolean().required(),
3060
+ message: Joi.string().allow(""),
3061
+ });
3062
+ }
2834
3063
  }
2835
3064
  module.exports = PaymentPlatformModel;
@@ -64,6 +64,16 @@ export = WebhookPlatformModel;
64
64
  * @property {SubscriberEventMapping} [subscriber_event_mapping]
65
65
  * @property {Object} [event_schema] - The schema for the event, allowing for
66
66
  * additional properties and may be null.
67
+ * @property {string} [sunset_date] - The date and time after which the event is
68
+ * considered sunset. After this timestamp, the entity should no longer be
69
+ * actively used, referenced, or offered for new operations, even if it still exists.
70
+ * @property {string} [announcement_date] - The date and time when the
71
+ * deprecation of the event is officially announced. This marks the start of
72
+ * the deprecation notice period and indicates that the entity is planned to
73
+ * be retired in the future, but may still remain available until the sunset date.
74
+ * @property {string} [support_end_date] - The date and time after which
75
+ * official support for the event ends. Beyond this point, no guarantees are
76
+ * made for maintenance, updates, fixes, or issue resolution.
67
77
  * @property {string} [group] - The group associated with the event
68
78
  * configuration, which may be null.
69
79
  * @property {string} [version] - The version of the event configuration.
@@ -479,6 +489,25 @@ type EventConfig = {
479
489
  * additional properties and may be null.
480
490
  */
481
491
  event_schema?: any;
492
+ /**
493
+ * - The date and time after which the event is
494
+ * considered sunset. After this timestamp, the entity should no longer be
495
+ * actively used, referenced, or offered for new operations, even if it still exists.
496
+ */
497
+ sunset_date?: string;
498
+ /**
499
+ * - The date and time when the
500
+ * deprecation of the event is officially announced. This marks the start of
501
+ * the deprecation notice period and indicates that the entity is planned to
502
+ * be retired in the future, but may still remain available until the sunset date.
503
+ */
504
+ announcement_date?: string;
505
+ /**
506
+ * - The date and time after which
507
+ * official support for the event ends. Beyond this point, no guarantees are
508
+ * made for maintenance, updates, fixes, or issue resolution.
509
+ */
510
+ support_end_date?: string;
482
511
  /**
483
512
  * - The group associated with the event
484
513
  * configuration, which may be null.
@@ -69,6 +69,16 @@ const Joi = require("joi");
69
69
  * @property {SubscriberEventMapping} [subscriber_event_mapping]
70
70
  * @property {Object} [event_schema] - The schema for the event, allowing for
71
71
  * additional properties and may be null.
72
+ * @property {string} [sunset_date] - The date and time after which the event is
73
+ * considered sunset. After this timestamp, the entity should no longer be
74
+ * actively used, referenced, or offered for new operations, even if it still exists.
75
+ * @property {string} [announcement_date] - The date and time when the
76
+ * deprecation of the event is officially announced. This marks the start of
77
+ * the deprecation notice period and indicates that the entity is planned to
78
+ * be retired in the future, but may still remain available until the sunset date.
79
+ * @property {string} [support_end_date] - The date and time after which
80
+ * official support for the event ends. Beyond this point, no guarantees are
81
+ * made for maintenance, updates, fixes, or issue resolution.
72
82
  * @property {string} [group] - The group associated with the event
73
83
  * configuration, which may be null.
74
84
  * @property {string} [version] - The version of the event configuration.
@@ -409,6 +419,9 @@ class WebhookPlatformModel {
409
419
  modified_by: Joi.string().allow(""),
410
420
  subscriber_event_mapping: WebhookPlatformModel.SubscriberEventMapping(),
411
421
  event_schema: Joi.object().pattern(/\S/, Joi.any()).allow(null, ""),
422
+ sunset_date: Joi.string().allow("").allow(null),
423
+ announcement_date: Joi.string().allow("").allow(null),
424
+ support_end_date: Joi.string().allow("").allow(null),
412
425
  group: Joi.string().allow("").allow(null),
413
426
  version: Joi.string().allow(""),
414
427
  display_name: Joi.string().allow(""),
@@ -14,6 +14,16 @@ export = WebhookPublicModel;
14
14
  * @property {string} [updated_on] - The timestamp when the event configuration
15
15
  * was last updated.
16
16
  * @property {string} [group] - The group to which the event belongs.
17
+ * @property {string} [sunset_date] - The date and time after which the event is
18
+ * considered sunset. After this timestamp, the entity should no longer be
19
+ * actively used, referenced, or offered for new operations, even if it still exists.
20
+ * @property {string} [announcement_date] - The date and time when the
21
+ * deprecation of the event is officially announced. This marks the start of
22
+ * the deprecation notice period and indicates that the entity is planned to
23
+ * be retired in the future, but may still remain available until the sunset date.
24
+ * @property {string} [support_end_date] - The date and time after which
25
+ * official support for the event ends. Beyond this point, no guarantees are
26
+ * made for maintenance, updates, fixes, or issue resolution.
17
27
  */
18
28
  /**
19
29
  * @typedef EventDetails
@@ -150,6 +160,25 @@ type EventConfig = {
150
160
  * - The group to which the event belongs.
151
161
  */
152
162
  group?: string;
163
+ /**
164
+ * - The date and time after which the event is
165
+ * considered sunset. After this timestamp, the entity should no longer be
166
+ * actively used, referenced, or offered for new operations, even if it still exists.
167
+ */
168
+ sunset_date?: string;
169
+ /**
170
+ * - The date and time when the
171
+ * deprecation of the event is officially announced. This marks the start of
172
+ * the deprecation notice period and indicates that the entity is planned to
173
+ * be retired in the future, but may still remain available until the sunset date.
174
+ */
175
+ announcement_date?: string;
176
+ /**
177
+ * - The date and time after which
178
+ * official support for the event ends. Beyond this point, no guarantees are
179
+ * made for maintenance, updates, fixes, or issue resolution.
180
+ */
181
+ support_end_date?: string;
153
182
  };
154
183
  /** @returns {EventDetails} */
155
184
  declare function EventDetails(): EventDetails;
@@ -15,6 +15,16 @@ const Joi = require("joi");
15
15
  * @property {string} [updated_on] - The timestamp when the event configuration
16
16
  * was last updated.
17
17
  * @property {string} [group] - The group to which the event belongs.
18
+ * @property {string} [sunset_date] - The date and time after which the event is
19
+ * considered sunset. After this timestamp, the entity should no longer be
20
+ * actively used, referenced, or offered for new operations, even if it still exists.
21
+ * @property {string} [announcement_date] - The date and time when the
22
+ * deprecation of the event is officially announced. This marks the start of
23
+ * the deprecation notice period and indicates that the entity is planned to
24
+ * be retired in the future, but may still remain available until the sunset date.
25
+ * @property {string} [support_end_date] - The date and time after which
26
+ * official support for the event ends. Beyond this point, no guarantees are
27
+ * made for maintenance, updates, fixes, or issue resolution.
18
28
  */
19
29
 
20
30
  /**
@@ -125,6 +135,9 @@ class WebhookPublicModel {
125
135
  created_on: Joi.string().allow(""),
126
136
  updated_on: Joi.string().allow(""),
127
137
  group: Joi.string().allow("").allow(null),
138
+ sunset_date: Joi.string().allow("").allow(null),
139
+ announcement_date: Joi.string().allow("").allow(null),
140
+ support_end_date: Joi.string().allow("").allow(null),
128
141
  });
129
142
  }
130
143