@gofynd/fdk-client-javascript 1.4.7 → 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 (110) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/sdk/application/Cart/CartApplicationClient.d.ts +16 -3
  4. package/sdk/application/Cart/CartApplicationClient.js +118 -13
  5. package/sdk/application/Cart/CartApplicationModel.d.ts +121 -45
  6. package/sdk/application/Cart/CartApplicationModel.js +98 -26
  7. package/sdk/application/Cart/CartApplicationValidator.d.ts +45 -1
  8. package/sdk/application/Cart/CartApplicationValidator.js +26 -0
  9. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +4 -2
  10. package/sdk/application/Catalog/CatalogApplicationModel.js +4 -2
  11. package/sdk/application/Content/ContentApplicationClient.d.ts +1 -1
  12. package/sdk/application/Content/ContentApplicationClient.js +5 -3
  13. package/sdk/application/Content/ContentApplicationModel.d.ts +5 -18
  14. package/sdk/application/Content/ContentApplicationModel.js +4 -20
  15. package/sdk/application/Content/ContentApplicationValidator.d.ts +10 -0
  16. package/sdk/application/Content/ContentApplicationValidator.js +4 -0
  17. package/sdk/application/Lead/LeadApplicationClient.d.ts +0 -27
  18. package/sdk/application/Lead/LeadApplicationClient.js +0 -167
  19. package/sdk/application/Lead/LeadApplicationModel.d.ts +1 -146
  20. package/sdk/application/Lead/LeadApplicationModel.js +0 -126
  21. package/sdk/application/Lead/LeadApplicationValidator.d.ts +1 -25
  22. package/sdk/application/Lead/LeadApplicationValidator.js +0 -24
  23. package/sdk/application/Logistic/LogisticApplicationClient.js +1 -1
  24. package/sdk/application/Logistic/LogisticApplicationModel.d.ts +2 -0
  25. package/sdk/application/Logistic/LogisticApplicationModel.js +2 -0
  26. package/sdk/application/Order/OrderApplicationModel.d.ts +2 -0
  27. package/sdk/application/Order/OrderApplicationModel.js +2 -0
  28. package/sdk/application/Payment/PaymentApplicationModel.d.ts +9 -2
  29. package/sdk/application/Payment/PaymentApplicationModel.js +5 -2
  30. package/sdk/application/Theme/ThemeApplicationModel.d.ts +2 -0
  31. package/sdk/application/Theme/ThemeApplicationModel.js +2 -0
  32. package/sdk/partner/Lead/LeadPartnerClient.d.ts +0 -23
  33. package/sdk/partner/Lead/LeadPartnerClient.js +0 -157
  34. package/sdk/partner/Lead/LeadPartnerModel.d.ts +12 -581
  35. package/sdk/partner/Lead/LeadPartnerModel.js +14 -403
  36. package/sdk/partner/Lead/LeadPartnerValidator.d.ts +0 -2
  37. package/sdk/partner/Lead/LeadPartnerValidator.js +0 -12
  38. package/sdk/partner/Logistics/LogisticsPartnerClient.js +1 -1
  39. package/sdk/partner/Logistics/LogisticsPartnerModel.js +4 -4
  40. package/sdk/partner/Theme/ThemePartnerClient.d.ts +22 -0
  41. package/sdk/partner/Theme/ThemePartnerClient.js +162 -0
  42. package/sdk/partner/Theme/ThemePartnerModel.d.ts +119 -1
  43. package/sdk/partner/Theme/ThemePartnerModel.js +142 -0
  44. package/sdk/partner/Theme/ThemePartnerValidator.d.ts +2 -0
  45. package/sdk/partner/Theme/ThemePartnerValidator.js +14 -0
  46. package/sdk/platform/Billing/BillingPlatformClient.d.ts +304 -43
  47. package/sdk/platform/Billing/BillingPlatformClient.js +2218 -118
  48. package/sdk/platform/Billing/BillingPlatformModel.d.ts +1330 -282
  49. package/sdk/platform/Billing/BillingPlatformModel.js +1808 -590
  50. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +324 -16
  51. package/sdk/platform/Billing/BillingPlatformValidator.js +340 -12
  52. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +28 -5
  53. package/sdk/platform/Cart/CartPlatformApplicationClient.js +198 -5
  54. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +81 -1
  55. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +48 -0
  56. package/sdk/platform/Cart/CartPlatformModel.d.ts +214 -40
  57. package/sdk/platform/Cart/CartPlatformModel.js +164 -24
  58. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +2 -2
  59. package/sdk/platform/Catalog/CatalogPlatformClient.js +18 -2
  60. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +4 -0
  61. package/sdk/platform/Catalog/CatalogPlatformModel.js +4 -0
  62. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +28 -0
  63. package/sdk/platform/Catalog/CatalogPlatformValidator.js +12 -0
  64. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +1 -1
  65. package/sdk/platform/Content/ContentPlatformApplicationClient.js +18 -1
  66. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +25 -0
  67. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +10 -0
  68. package/sdk/platform/Content/ContentPlatformModel.d.ts +6 -4
  69. package/sdk/platform/Content/ContentPlatformModel.js +6 -4
  70. package/sdk/platform/Finance/FinancePlatformClient.d.ts +49 -28
  71. package/sdk/platform/Finance/FinancePlatformClient.js +181 -28
  72. package/sdk/platform/Finance/FinancePlatformModel.d.ts +350 -127
  73. package/sdk/platform/Finance/FinancePlatformModel.js +378 -108
  74. package/sdk/platform/Finance/FinancePlatformValidator.d.ts +56 -43
  75. package/sdk/platform/Finance/FinancePlatformValidator.js +61 -42
  76. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +0 -47
  77. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +0 -321
  78. package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +1 -46
  79. package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +0 -48
  80. package/sdk/platform/Lead/LeadPlatformClient.d.ts +2 -25
  81. package/sdk/platform/Lead/LeadPlatformClient.js +2 -167
  82. package/sdk/platform/Lead/LeadPlatformModel.d.ts +82 -204
  83. package/sdk/platform/Lead/LeadPlatformModel.js +98 -178
  84. package/sdk/platform/Lead/LeadPlatformValidator.d.ts +1 -25
  85. package/sdk/platform/Lead/LeadPlatformValidator.js +0 -24
  86. package/sdk/platform/Order/OrderPlatformModel.d.ts +108 -15
  87. package/sdk/platform/Order/OrderPlatformModel.js +47 -14
  88. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +12 -0
  89. package/sdk/platform/Payment/PaymentPlatformModel.js +5 -0
  90. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +4 -4
  91. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +12 -0
  92. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +82 -0
  93. package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +18 -1
  94. package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +14 -0
  95. package/sdk/platform/Theme/ThemePlatformModel.d.ts +67 -1
  96. package/sdk/platform/Theme/ThemePlatformModel.js +78 -0
  97. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +0 -40
  98. package/sdk/platform/Webhook/WebhookPlatformClient.js +0 -307
  99. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +112 -164
  100. package/sdk/platform/Webhook/WebhookPlatformModel.js +118 -169
  101. package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +9 -35
  102. package/sdk/platform/Webhook/WebhookPlatformValidator.js +8 -46
  103. package/sdk/public/Billing/BillingPublicClient.d.ts +24 -2
  104. package/sdk/public/Billing/BillingPublicClient.js +156 -3
  105. package/sdk/public/Billing/BillingPublicModel.d.ts +368 -26
  106. package/sdk/public/Billing/BillingPublicModel.js +317 -18
  107. package/sdk/public/Billing/BillingPublicValidator.d.ts +19 -3
  108. package/sdk/public/Billing/BillingPublicValidator.js +22 -3
  109. package/sdk/public/Webhook/WebhookPublicModel.d.ts +22 -22
  110. package/sdk/public/Webhook/WebhookPublicModel.js +22 -22
@@ -1,21 +1,114 @@
1
1
  const Joi = require("joi");
2
2
 
3
3
  /**
4
- * @typedef InternalServerError
5
- * @property {string} [message] - Internal server Server error
6
- * @property {string} [code] - Error code
4
+ * @typedef ResourceNotFound
5
+ * @property {string} [message] - Resource not found with {id}
7
6
  */
8
7
 
9
8
  /**
10
9
  * @typedef PlanRecurring
11
10
  * @property {string} [interval]
12
11
  * @property {number} [interval_count]
12
+ * @property {string} [aggregate_usage]
13
+ * @property {string} [usage_type]
13
14
  */
14
15
 
15
16
  /**
16
- * @typedef Plan
17
+ * @typedef DetailList
18
+ * @property {PlanDetails[]} [plans]
19
+ * @property {string[]} [component_groups]
20
+ */
21
+
22
+ /**
23
+ * @typedef PlanTaxation
24
+ * @property {number} [gst]
25
+ */
26
+
27
+ /**
28
+ * @typedef OneTimeFees
29
+ * @property {number} [developement]
30
+ * @property {number} [marketing]
31
+ */
32
+
33
+ /**
34
+ * @typedef CreditLine
35
+ * @property {boolean} [is_active]
36
+ */
37
+
38
+ /**
39
+ * @typedef PlanMeta
40
+ * @property {string} [plan_platform_display_name]
41
+ */
42
+
43
+ /**
44
+ * @typedef FeatureConfig
45
+ * @property {boolean} [enabled]
46
+ * @property {number} [limit]
47
+ * @property {number} [hard_limit]
48
+ * @property {number} [soft_limit]
49
+ */
50
+
51
+ /**
52
+ * @typedef PlanConfig
53
+ * @property {boolean} [is_active]
54
+ * @property {string} [display_text]
55
+ * @property {boolean} [is_default]
56
+ * @property {string} [processing_type]
57
+ * @property {string[]} [tags]
58
+ * @property {FeatureConfig} [feature_config]
59
+ * @property {string} [_id]
60
+ * @property {string} [component_id]
61
+ * @property {string} [created_at]
62
+ * @property {string} [modified_at]
63
+ * @property {number} [__v]
64
+ * @property {string} [billing_scheme]
65
+ * @property {string} [bill_type]
66
+ * @property {string} [price_ui_type]
67
+ * @property {PlanRecurring} [recurring]
68
+ * @property {TransformQuantity} [transform_quantity]
69
+ * @property {FreeTier} [free_tier]
70
+ * @property {string} [currency]
71
+ * @property {number} [unit_amount]
72
+ * @property {number} [quantity]
73
+ * @property {string} [price_type]
74
+ * @property {Object[]} [tiers]
75
+ */
76
+
77
+ /**
78
+ * @typedef FreeTier
79
+ * @property {string} [type]
80
+ * @property {number} [value]
81
+ */
82
+
83
+ /**
84
+ * @typedef TransformQuantity
85
+ * @property {number} [divide_by]
86
+ * @property {string} [round]
87
+ */
88
+
89
+ /**
90
+ * @typedef ComponentsSchema
91
+ * @property {string} [name]
92
+ * @property {string} [slug]
93
+ * @property {string} [description]
94
+ * @property {string} [group]
95
+ * @property {string} [icon]
96
+ * @property {Object} [links]
97
+ * @property {PlanConfig} [config]
98
+ * @property {boolean} [is_active]
99
+ * @property {string} [display_text]
100
+ */
101
+
102
+ /**
103
+ * @typedef PlanDetails
104
+ * @property {string} [approved_by]
105
+ * @property {string} [updated_by]
17
106
  * @property {PlanRecurring} [recurring]
18
107
  * @property {boolean} [is_trial_plan]
108
+ * @property {string[]} [company_ids]
109
+ * @property {string} [created_by]
110
+ * @property {string} [channel_type]
111
+ * @property {string} [platform]
19
112
  * @property {string} [plan_group]
20
113
  * @property {string[]} [tag_lines]
21
114
  * @property {string} [currency]
@@ -33,21 +126,65 @@ const Joi = require("joi");
33
126
  * @property {string} [product_suite_id]
34
127
  * @property {string} [created_at]
35
128
  * @property {string} [modified_at]
129
+ * @property {PlanTaxation} [taxation]
130
+ * @property {OneTimeFees} [one_time_fees]
131
+ * @property {CreditLine} [credit_line]
132
+ * @property {string} [current_status]
133
+ * @property {PlanMeta} [meta]
134
+ * @property {ComponentsSchema[]} [components]
36
135
  */
37
136
 
38
137
  /**
39
- * @typedef DetailList
40
- * @property {Plan[]} [plans]
41
- * @property {Plan} [trial_plan]
42
- * @property {string[]} [component_groups]
138
+ * @typedef Recurring
139
+ * @property {string} [interval] - Interval for recurring payments
140
+ * @property {number} [interval_count] - Number of intervals
141
+ */
142
+
143
+ /**
144
+ * @typedef Taxation
145
+ * @property {number} [gst] - GST percentage
146
+ */
147
+
148
+ /**
149
+ * @typedef PlanList
150
+ * @property {string} [approved_by]
151
+ * @property {string} [updated_by]
152
+ * @property {Recurring} [recurring]
153
+ * @property {Taxation} [taxation]
154
+ * @property {OneTimeFees} [one_time_fees]
155
+ * @property {CreditLine} [credit_line]
156
+ * @property {string} [_id] - Unique identifier of the plan
157
+ * @property {string} [product_suite_id] - Identifier of the product suite
158
+ * associated with the plan
159
+ * @property {boolean} [is_trial_plan] - Indicates whether the plan is a trial plan
160
+ * @property {string} [name] - Name of the plan
161
+ * @property {string} [description] - Description of the plan
162
+ * @property {string} [plan_group] - Group to which the plan belongs
163
+ * @property {string[]} [tag_lines] - Tag lines associated with the plan
164
+ * @property {string} [currency] - Currency of the plan
165
+ * @property {number} [amount] - Amount of the plan
166
+ * @property {boolean} [is_active] - Indicates whether the plan is active
167
+ * @property {boolean} [is_visible] - Indicates whether the plan is visible
168
+ * @property {number} [trial_period] - Trial period of the plan
169
+ * @property {Object[]} [addons] - Addons associated with the plan
170
+ * @property {string[]} [tags] - Tags associated with the plan
171
+ * @property {string} [type] - Type of the plan
172
+ * @property {Object} [meta] - Additional metadata associated with the plan
173
+ * @property {string} [country] - Country associated with the plan
174
+ * @property {string[]} [company_ids] - Company IDs associated with the plan
175
+ * @property {string} [created_by] - ID of the user who created the plan
176
+ * @property {string} [current_status] - Current status of the plan
177
+ * @property {string} [channel_type] - Type of channel associated with the plan
178
+ * @property {string} [platform] - Platform associated with the plan
179
+ * @property {string} [created_at] - Date and time when the plan was created
180
+ * @property {string} [modified_at] - Date and time when the plan was last modified
43
181
  */
44
182
 
45
183
  class BillingPublicModel {
46
- /** @returns {InternalServerError} */
47
- static InternalServerError() {
184
+ /** @returns {ResourceNotFound} */
185
+ static ResourceNotFound() {
48
186
  return Joi.object({
49
187
  message: Joi.string().allow(""),
50
- code: Joi.string().allow(""),
51
188
  });
52
189
  }
53
190
 
@@ -56,14 +193,128 @@ class BillingPublicModel {
56
193
  return Joi.object({
57
194
  interval: Joi.string().allow(""),
58
195
  interval_count: Joi.number(),
196
+ aggregate_usage: Joi.string().allow(""),
197
+ usage_type: Joi.string().allow(""),
59
198
  });
60
199
  }
61
200
 
62
- /** @returns {Plan} */
63
- static Plan() {
201
+ /** @returns {DetailList} */
202
+ static DetailList() {
64
203
  return Joi.object({
204
+ plans: Joi.array().items(BillingPublicModel.PlanDetails()),
205
+ component_groups: Joi.array().items(Joi.string().allow("")),
206
+ });
207
+ }
208
+
209
+ /** @returns {PlanTaxation} */
210
+ static PlanTaxation() {
211
+ return Joi.object({
212
+ gst: Joi.number(),
213
+ });
214
+ }
215
+
216
+ /** @returns {OneTimeFees} */
217
+ static OneTimeFees() {
218
+ return Joi.object({
219
+ developement: Joi.number().allow(null),
220
+ marketing: Joi.number().allow(null),
221
+ });
222
+ }
223
+
224
+ /** @returns {CreditLine} */
225
+ static CreditLine() {
226
+ return Joi.object({
227
+ is_active: Joi.boolean(),
228
+ });
229
+ }
230
+
231
+ /** @returns {PlanMeta} */
232
+ static PlanMeta() {
233
+ return Joi.object({
234
+ plan_platform_display_name: Joi.string().allow("").allow(null),
235
+ });
236
+ }
237
+
238
+ /** @returns {FeatureConfig} */
239
+ static FeatureConfig() {
240
+ return Joi.object({
241
+ enabled: Joi.boolean(),
242
+ limit: Joi.number(),
243
+ hard_limit: Joi.number(),
244
+ soft_limit: Joi.number(),
245
+ });
246
+ }
247
+
248
+ /** @returns {PlanConfig} */
249
+ static PlanConfig() {
250
+ return Joi.object({
251
+ is_active: Joi.boolean(),
252
+ display_text: Joi.string().allow("").allow(null),
253
+ is_default: Joi.boolean(),
254
+ processing_type: Joi.string().allow(""),
255
+ tags: Joi.array().items(Joi.string().allow("")),
256
+ feature_config: BillingPublicModel.FeatureConfig(),
257
+ _id: Joi.string().allow(""),
258
+ component_id: Joi.string().allow(""),
259
+ created_at: Joi.string().allow(""),
260
+ modified_at: Joi.string().allow(""),
261
+ __v: Joi.number(),
262
+ billing_scheme: Joi.string().allow(""),
263
+ bill_type: Joi.string().allow(""),
264
+ price_ui_type: Joi.string().allow(""),
265
+ recurring: BillingPublicModel.PlanRecurring(),
266
+ transform_quantity: BillingPublicModel.TransformQuantity(),
267
+ free_tier: BillingPublicModel.FreeTier(),
268
+ currency: Joi.string().allow(""),
269
+ unit_amount: Joi.number(),
270
+ quantity: Joi.number(),
271
+ price_type: Joi.string().allow(""),
272
+ tiers: Joi.array().items(Joi.any()),
273
+ });
274
+ }
275
+
276
+ /** @returns {FreeTier} */
277
+ static FreeTier() {
278
+ return Joi.object({
279
+ type: Joi.string().allow(""),
280
+ value: Joi.number(),
281
+ });
282
+ }
283
+
284
+ /** @returns {TransformQuantity} */
285
+ static TransformQuantity() {
286
+ return Joi.object({
287
+ divide_by: Joi.number(),
288
+ round: Joi.string().allow(""),
289
+ });
290
+ }
291
+
292
+ /** @returns {ComponentsSchema} */
293
+ static ComponentsSchema() {
294
+ return Joi.object({
295
+ name: Joi.string().allow(""),
296
+ slug: Joi.string().allow(""),
297
+ description: Joi.string().allow(""),
298
+ group: Joi.string().allow(""),
299
+ icon: Joi.string().allow(""),
300
+ links: Joi.any(),
301
+ config: BillingPublicModel.PlanConfig(),
302
+ is_active: Joi.boolean(),
303
+ display_text: Joi.string().allow("").allow(null),
304
+ });
305
+ }
306
+
307
+ /** @returns {PlanDetails} */
308
+ static PlanDetails() {
309
+ return Joi.object({
310
+ approved_by: Joi.string().allow(""),
311
+ updated_by: Joi.string().allow(""),
65
312
  recurring: BillingPublicModel.PlanRecurring(),
66
313
  is_trial_plan: Joi.boolean(),
314
+ company_ids: Joi.array().items(Joi.string().allow("")),
315
+ created_by: Joi.string().allow(""),
316
+ channel_type: Joi.string().allow(""),
317
+ platform: Joi.string().allow("").allow(null),
67
318
  plan_group: Joi.string().allow(""),
68
319
  tag_lines: Joi.array().items(Joi.string().allow("")),
69
320
  currency: Joi.string().allow(""),
@@ -81,15 +332,63 @@ class BillingPublicModel {
81
332
  product_suite_id: Joi.string().allow(""),
82
333
  created_at: Joi.string().allow(""),
83
334
  modified_at: Joi.string().allow(""),
335
+ taxation: BillingPublicModel.PlanTaxation(),
336
+ one_time_fees: BillingPublicModel.OneTimeFees(),
337
+ credit_line: BillingPublicModel.CreditLine(),
338
+ current_status: Joi.string().allow(""),
339
+ meta: BillingPublicModel.PlanMeta(),
340
+ components: Joi.array().items(BillingPublicModel.ComponentsSchema()),
84
341
  });
85
342
  }
86
343
 
87
- /** @returns {DetailList} */
88
- static DetailList() {
344
+ /** @returns {Recurring} */
345
+ static Recurring() {
89
346
  return Joi.object({
90
- plans: Joi.array().items(BillingPublicModel.Plan()),
91
- trial_plan: BillingPublicModel.Plan(),
92
- component_groups: Joi.array().items(Joi.string().allow("")),
347
+ interval: Joi.string().allow(""),
348
+ interval_count: Joi.number(),
349
+ });
350
+ }
351
+
352
+ /** @returns {Taxation} */
353
+ static Taxation() {
354
+ return Joi.object({
355
+ gst: Joi.number(),
356
+ });
357
+ }
358
+
359
+ /** @returns {PlanList} */
360
+ static PlanList() {
361
+ return Joi.object({
362
+ approved_by: Joi.string().allow(""),
363
+ updated_by: Joi.string().allow(""),
364
+ recurring: BillingPublicModel.Recurring(),
365
+ taxation: BillingPublicModel.Taxation(),
366
+ one_time_fees: BillingPublicModel.OneTimeFees(),
367
+ credit_line: BillingPublicModel.CreditLine(),
368
+ _id: Joi.string().allow(""),
369
+ product_suite_id: Joi.string().allow(""),
370
+ is_trial_plan: Joi.boolean(),
371
+ name: Joi.string().allow(""),
372
+ description: Joi.string().allow(""),
373
+ plan_group: Joi.string().allow(""),
374
+ tag_lines: Joi.array().items(Joi.string().allow("")),
375
+ currency: Joi.string().allow(""),
376
+ amount: Joi.number(),
377
+ is_active: Joi.boolean(),
378
+ is_visible: Joi.boolean(),
379
+ trial_period: Joi.number(),
380
+ addons: Joi.array().items(Joi.any()),
381
+ tags: Joi.array().items(Joi.string().allow("")),
382
+ type: Joi.string().allow(""),
383
+ meta: Joi.any(),
384
+ country: Joi.string().allow(""),
385
+ company_ids: Joi.array().items(Joi.string().allow("")),
386
+ created_by: Joi.string().allow(""),
387
+ current_status: Joi.string().allow(""),
388
+ channel_type: Joi.string().allow(""),
389
+ platform: Joi.string().allow("").allow(null),
390
+ created_at: Joi.string().allow(""),
391
+ modified_at: Joi.string().allow(""),
93
392
  });
94
393
  }
95
394
  }
@@ -1,18 +1,34 @@
1
1
  export = BillingPublicValidator;
2
+ /**
3
+ * @typedef GetPlanDetailsParam
4
+ * @property {string} planId - Plan unique id.
5
+ */
2
6
  /**
3
7
  * @typedef GetStandardPlansParam
4
- * @property {string} platform - The type of platform for which plans are requested.
8
+ * @property {string} [platform] - The type of platform for which plans are requested.
5
9
  */
10
+ /** @typedef PlanListParam */
6
11
  declare class BillingPublicValidator {
12
+ /** @returns {GetPlanDetailsParam} */
13
+ static getPlanDetails(): GetPlanDetailsParam;
7
14
  /** @returns {GetStandardPlansParam} */
8
15
  static getStandardPlans(): GetStandardPlansParam;
16
+ /** @returns {PlanListParam} */
17
+ static planList(): any;
9
18
  }
10
19
  declare namespace BillingPublicValidator {
11
- export { GetStandardPlansParam };
20
+ export { GetPlanDetailsParam, GetStandardPlansParam, PlanListParam };
12
21
  }
22
+ type GetPlanDetailsParam = {
23
+ /**
24
+ * - Plan unique id.
25
+ */
26
+ planId: string;
27
+ };
13
28
  type GetStandardPlansParam = {
14
29
  /**
15
30
  * - The type of platform for which plans are requested.
16
31
  */
17
- platform: string;
32
+ platform?: string;
18
33
  };
34
+ type PlanListParam = any;
@@ -2,17 +2,36 @@ const Joi = require("joi");
2
2
 
3
3
  const BillingPublicModel = require("./BillingPublicModel");
4
4
 
5
+ /**
6
+ * @typedef GetPlanDetailsParam
7
+ * @property {string} planId - Plan unique id.
8
+ */
9
+
5
10
  /**
6
11
  * @typedef GetStandardPlansParam
7
- * @property {string} platform - The type of platform for which plans are requested.
12
+ * @property {string} [platform] - The type of platform for which plans are requested.
8
13
  */
9
14
 
15
+ /** @typedef PlanListParam */
16
+
10
17
  class BillingPublicValidator {
18
+ /** @returns {GetPlanDetailsParam} */
19
+ static getPlanDetails() {
20
+ return Joi.object({
21
+ planId: Joi.string().allow("").required(),
22
+ }).required();
23
+ }
24
+
11
25
  /** @returns {GetStandardPlansParam} */
12
26
  static getStandardPlans() {
13
27
  return Joi.object({
14
- platform: Joi.string().allow("").required(),
15
- }).required();
28
+ platform: Joi.string().allow(""),
29
+ });
30
+ }
31
+
32
+ /** @returns {PlanListParam} */
33
+ static planList() {
34
+ return Joi.object({});
16
35
  }
17
36
  }
18
37
 
@@ -59,20 +59,20 @@ export = WebhookPublicModel;
59
59
  */
60
60
  /**
61
61
  * @typedef TransformEventRequest
62
- * @property {string} [event_name]
63
- * @property {string} [event_type]
64
- * @property {string} [event_category]
65
- * @property {string} [event_version]
66
- * @property {EventSchema} [event]
62
+ * @property {string} event_name
63
+ * @property {string} event_type
64
+ * @property {string} event_category
65
+ * @property {string} event_version
66
+ * @property {EventSchema} event
67
67
  */
68
68
  /**
69
69
  * @typedef ValidateSchemaRequest
70
- * @property {string} [event_name]
71
- * @property {string} [event_type]
72
- * @property {string} [event_category]
73
- * @property {string} [event_version]
74
- * @property {EventSchema} [event]
75
- * @property {Object} [event_schema]
70
+ * @property {string} event_name
71
+ * @property {string} event_type
72
+ * @property {string} event_category
73
+ * @property {string} event_version
74
+ * @property {EventSchema} event
75
+ * @property {Object} event_schema
76
76
  */
77
77
  /**
78
78
  * @typedef ValidateSchemaResponse
@@ -165,21 +165,21 @@ type TransformEventAssociation = {
165
165
  /** @returns {TransformEventRequest} */
166
166
  declare function TransformEventRequest(): TransformEventRequest;
167
167
  type TransformEventRequest = {
168
- event_name?: string;
169
- event_type?: string;
170
- event_category?: string;
171
- event_version?: string;
172
- event?: EventSchema;
168
+ event_name: string;
169
+ event_type: string;
170
+ event_category: string;
171
+ event_version: string;
172
+ event: EventSchema;
173
173
  };
174
174
  /** @returns {ValidateSchemaRequest} */
175
175
  declare function ValidateSchemaRequest(): ValidateSchemaRequest;
176
176
  type ValidateSchemaRequest = {
177
- event_name?: string;
178
- event_type?: string;
179
- event_category?: string;
180
- event_version?: string;
181
- event?: EventSchema;
182
- event_schema?: any;
177
+ event_name: string;
178
+ event_type: string;
179
+ event_category: string;
180
+ event_version: string;
181
+ event: EventSchema;
182
+ event_schema: any;
183
183
  };
184
184
  /** @returns {ValidateSchemaResponse} */
185
185
  declare function ValidateSchemaResponse(): ValidateSchemaResponse;
@@ -69,21 +69,21 @@ const Joi = require("joi");
69
69
 
70
70
  /**
71
71
  * @typedef TransformEventRequest
72
- * @property {string} [event_name]
73
- * @property {string} [event_type]
74
- * @property {string} [event_category]
75
- * @property {string} [event_version]
76
- * @property {EventSchema} [event]
72
+ * @property {string} event_name
73
+ * @property {string} event_type
74
+ * @property {string} event_category
75
+ * @property {string} event_version
76
+ * @property {EventSchema} event
77
77
  */
78
78
 
79
79
  /**
80
80
  * @typedef ValidateSchemaRequest
81
- * @property {string} [event_name]
82
- * @property {string} [event_type]
83
- * @property {string} [event_category]
84
- * @property {string} [event_version]
85
- * @property {EventSchema} [event]
86
- * @property {Object} [event_schema]
81
+ * @property {string} event_name
82
+ * @property {string} event_type
83
+ * @property {string} event_category
84
+ * @property {string} event_version
85
+ * @property {EventSchema} event
86
+ * @property {Object} event_schema
87
87
  */
88
88
 
89
89
  /**
@@ -193,23 +193,23 @@ class WebhookPublicModel {
193
193
  /** @returns {TransformEventRequest} */
194
194
  static TransformEventRequest() {
195
195
  return Joi.object({
196
- event_name: Joi.string().allow(""),
197
- event_type: Joi.string().allow(""),
198
- event_category: Joi.string().allow(""),
199
- event_version: Joi.string().allow(""),
200
- event: WebhookPublicModel.EventSchema(),
196
+ event_name: Joi.string().allow("").required(),
197
+ event_type: Joi.string().allow("").required(),
198
+ event_category: Joi.string().allow("").required(),
199
+ event_version: Joi.string().allow("").required(),
200
+ event: WebhookPublicModel.EventSchema().required(),
201
201
  });
202
202
  }
203
203
 
204
204
  /** @returns {ValidateSchemaRequest} */
205
205
  static ValidateSchemaRequest() {
206
206
  return Joi.object({
207
- event_name: Joi.string().allow(""),
208
- event_type: Joi.string().allow(""),
209
- event_category: Joi.string().allow(""),
210
- event_version: Joi.string().allow(""),
211
- event: WebhookPublicModel.EventSchema(),
212
- event_schema: Joi.object().pattern(/\S/, Joi.any()),
207
+ event_name: Joi.string().allow("").required(),
208
+ event_type: Joi.string().allow("").required(),
209
+ event_category: Joi.string().allow("").required(),
210
+ event_version: Joi.string().allow("").required(),
211
+ event: WebhookPublicModel.EventSchema().required(),
212
+ event_schema: Joi.object().pattern(/\S/, Joi.any()).required(),
213
213
  });
214
214
  }
215
215