@gofynd/fdk-client-javascript 1.4.15-beta.1 → 1.4.15-beta.11

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 (150) hide show
  1. package/README.md +2 -2
  2. package/application.d.ts +1 -2
  3. package/application.js +2 -3
  4. package/index.d.ts +1 -2
  5. package/index.js +7 -1
  6. package/package.json +3 -4
  7. package/sdk/application/ApplicationClient.js +0 -18
  8. package/sdk/application/Cart/CartApplicationClient.d.ts +55 -90
  9. package/sdk/application/Cart/CartApplicationClient.js +60 -1185
  10. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +90 -142
  11. package/sdk/application/Catalog/CatalogApplicationClient.js +187 -1293
  12. package/sdk/application/Common/CommonApplicationClient.d.ts +4 -8
  13. package/sdk/application/Common/CommonApplicationClient.js +5 -89
  14. package/sdk/application/Communication/CommunicationApplicationClient.d.ts +6 -19
  15. package/sdk/application/Communication/CommunicationApplicationClient.js +6 -145
  16. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +32 -73
  17. package/sdk/application/Configuration/ConfigurationApplicationClient.js +31 -718
  18. package/sdk/application/Content/ContentApplicationClient.d.ts +46 -78
  19. package/sdk/application/Content/ContentApplicationClient.js +77 -914
  20. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +6 -11
  21. package/sdk/application/FileStorage/FileStorageApplicationClient.js +19 -125
  22. package/sdk/application/Lead/LeadApplicationClient.d.ts +10 -18
  23. package/sdk/application/Lead/LeadApplicationClient.js +32 -202
  24. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +22 -39
  25. package/sdk/application/Logistic/LogisticApplicationClient.js +50 -478
  26. package/sdk/application/Order/OrderApplicationClient.d.ts +22 -42
  27. package/sdk/application/Order/OrderApplicationClient.js +86 -472
  28. package/sdk/application/Payment/PaymentApplicationClient.d.ts +92 -212
  29. package/sdk/application/Payment/PaymentApplicationClient.js +57 -2102
  30. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +14 -28
  31. package/sdk/application/Rewards/RewardsApplicationClient.js +16 -305
  32. package/sdk/application/Share/ShareApplicationClient.d.ts +14 -24
  33. package/sdk/application/Share/ShareApplicationClient.js +34 -294
  34. package/sdk/application/Theme/ThemeApplicationClient.d.ts +8 -14
  35. package/sdk/application/Theme/ThemeApplicationClient.js +28 -162
  36. package/sdk/application/User/UserApplicationClient.d.ts +85 -136
  37. package/sdk/application/User/UserApplicationClient.js +45 -1815
  38. package/sdk/application/Webhook/WebhookApplicationClient.d.ts +2 -5
  39. package/sdk/application/Webhook/WebhookApplicationClient.js +4 -47
  40. package/sdk/application/index.d.ts +0 -18
  41. package/sdk/application/index.js +0 -33
  42. package/sdk/common/Utility.d.ts +1 -1
  43. package/sdk/common/Utility.js +10 -7
  44. package/sdk/common/Validator.d.ts +1 -0
  45. package/sdk/common/Validator.js +20 -0
  46. package/sdk/common/utils.d.ts +0 -1
  47. package/sdk/common/utils.js +0 -14
  48. package/sdk/partner/OAuthClient.js +1 -0
  49. package/sdk/partner/Theme/ThemePartnerModel.d.ts +3 -40
  50. package/sdk/partner/Theme/ThemePartnerModel.js +2 -24
  51. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +39 -1
  52. package/sdk/platform/Cart/CartPlatformApplicationClient.js +247 -1
  53. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +33 -1
  54. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +37 -0
  55. package/sdk/platform/Cart/CartPlatformModel.d.ts +193 -1
  56. package/sdk/platform/Cart/CartPlatformModel.js +132 -0
  57. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +0 -7
  58. package/sdk/platform/Catalog/CatalogPlatformModel.js +1 -4
  59. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +14 -0
  60. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +6 -0
  61. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +0 -10
  62. package/sdk/platform/Order/OrderPlatformApplicationClient.js +0 -92
  63. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -28
  64. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +0 -18
  65. package/sdk/platform/Order/OrderPlatformClient.d.ts +10 -0
  66. package/sdk/platform/Order/OrderPlatformClient.js +99 -0
  67. package/sdk/platform/Order/OrderPlatformModel.d.ts +7 -0
  68. package/sdk/platform/Order/OrderPlatformModel.js +3 -0
  69. package/sdk/platform/Order/OrderPlatformValidator.d.ts +33 -1
  70. package/sdk/platform/Order/OrderPlatformValidator.js +20 -0
  71. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +1 -1
  72. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +4 -4
  73. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +56 -19
  74. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +42 -18
  75. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +3 -3
  76. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +2 -2
  77. package/sdk/platform/Theme/ThemePlatformModel.d.ts +3 -40
  78. package/sdk/platform/Theme/ThemePlatformModel.js +2 -24
  79. package/sdk/public/Configuration/ConfigurationPublicClient.js +5 -2
  80. package/sdk/public/Content/ContentPublicClient.d.ts +1 -1
  81. package/sdk/public/Content/ContentPublicClient.js +14 -2
  82. package/sdk/public/Partner/PartnerPublicClient.d.ts +1 -1
  83. package/sdk/public/Partner/PartnerPublicClient.js +14 -2
  84. package/sdk/public/Webhook/WebhookPublicClient.js +5 -2
  85. package/sdk/application/Cart/CartApplicationModel.d.ts +0 -3994
  86. package/sdk/application/Cart/CartApplicationModel.js +0 -2497
  87. package/sdk/application/Cart/CartApplicationValidator.d.ts +0 -769
  88. package/sdk/application/Cart/CartApplicationValidator.js +0 -530
  89. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +0 -3857
  90. package/sdk/application/Catalog/CatalogApplicationModel.js +0 -2629
  91. package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +0 -791
  92. package/sdk/application/Catalog/CatalogApplicationValidator.js +0 -551
  93. package/sdk/application/Common/CommonApplicationModel.d.ts +0 -449
  94. package/sdk/application/Common/CommonApplicationModel.js +0 -308
  95. package/sdk/application/Common/CommonApplicationValidator.d.ts +0 -46
  96. package/sdk/application/Common/CommonApplicationValidator.js +0 -38
  97. package/sdk/application/Communication/CommunicationApplicationModel.d.ts +0 -293
  98. package/sdk/application/Communication/CommunicationApplicationModel.js +0 -201
  99. package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +0 -29
  100. package/sdk/application/Communication/CommunicationApplicationValidator.js +0 -38
  101. package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +0 -2556
  102. package/sdk/application/Configuration/ConfigurationApplicationModel.js +0 -1887
  103. package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +0 -179
  104. package/sdk/application/Configuration/ConfigurationApplicationValidator.js +0 -176
  105. package/sdk/application/Content/ContentApplicationModel.d.ts +0 -2133
  106. package/sdk/application/Content/ContentApplicationModel.js +0 -1589
  107. package/sdk/application/Content/ContentApplicationValidator.d.ts +0 -284
  108. package/sdk/application/Content/ContentApplicationValidator.js +0 -264
  109. package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +0 -272
  110. package/sdk/application/FileStorage/FileStorageApplicationModel.js +0 -190
  111. package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +0 -56
  112. package/sdk/application/FileStorage/FileStorageApplicationValidator.js +0 -53
  113. package/sdk/application/Lead/LeadApplicationModel.d.ts +0 -590
  114. package/sdk/application/Lead/LeadApplicationModel.js +0 -480
  115. package/sdk/application/Lead/LeadApplicationValidator.d.ts +0 -68
  116. package/sdk/application/Lead/LeadApplicationValidator.js +0 -71
  117. package/sdk/application/Logistic/LogisticApplicationModel.d.ts +0 -1675
  118. package/sdk/application/Logistic/LogisticApplicationModel.js +0 -1121
  119. package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +0 -254
  120. package/sdk/application/Logistic/LogisticApplicationValidator.js +0 -190
  121. package/sdk/application/Order/OrderApplicationModel.d.ts +0 -2296
  122. package/sdk/application/Order/OrderApplicationModel.js +0 -1471
  123. package/sdk/application/Order/OrderApplicationValidator.d.ts +0 -265
  124. package/sdk/application/Order/OrderApplicationValidator.js +0 -197
  125. package/sdk/application/Payment/PaymentApplicationModel.d.ts +0 -4058
  126. package/sdk/application/Payment/PaymentApplicationModel.js +0 -2630
  127. package/sdk/application/Payment/PaymentApplicationValidator.d.ts +0 -576
  128. package/sdk/application/Payment/PaymentApplicationValidator.js +0 -594
  129. package/sdk/application/Rewards/RewardsApplicationModel.d.ts +0 -365
  130. package/sdk/application/Rewards/RewardsApplicationModel.js +0 -396
  131. package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +0 -73
  132. package/sdk/application/Rewards/RewardsApplicationValidator.js +0 -84
  133. package/sdk/application/Share/ShareApplicationModel.d.ts +0 -339
  134. package/sdk/application/Share/ShareApplicationModel.js +0 -234
  135. package/sdk/application/Share/ShareApplicationValidator.d.ts +0 -90
  136. package/sdk/application/Share/ShareApplicationValidator.js +0 -91
  137. package/sdk/application/Theme/ThemeApplicationModel.d.ts +0 -1713
  138. package/sdk/application/Theme/ThemeApplicationModel.js +0 -1426
  139. package/sdk/application/Theme/ThemeApplicationValidator.d.ts +0 -66
  140. package/sdk/application/Theme/ThemeApplicationValidator.js +0 -58
  141. package/sdk/application/User/UserApplicationModel.d.ts +0 -1943
  142. package/sdk/application/User/UserApplicationModel.js +0 -1382
  143. package/sdk/application/User/UserApplicationValidator.d.ts +0 -560
  144. package/sdk/application/User/UserApplicationValidator.js +0 -573
  145. package/sdk/application/Webhook/WebhookApplicationModel.d.ts +0 -52
  146. package/sdk/application/Webhook/WebhookApplicationModel.js +0 -46
  147. package/sdk/application/Webhook/WebhookApplicationValidator.d.ts +0 -16
  148. package/sdk/application/Webhook/WebhookApplicationValidator.js +0 -19
  149. package/sdk/common/Clickstream.d.ts +0 -1
  150. package/sdk/common/Clickstream.js +0 -464
@@ -1,396 +0,0 @@
1
- const Joi = require("joi");
2
-
3
- /**
4
- * @typedef RewardsArticle
5
- * @property {string} [id]
6
- * @property {number} [points]
7
- * @property {number} [price]
8
- */
9
-
10
- /**
11
- * @typedef CatalogueOrderResponse
12
- * @property {RewardsArticle[]} [articles]
13
- */
14
-
15
- /**
16
- * @typedef CatalogueOrderRequest
17
- * @property {RewardsArticle[]} [articles]
18
- */
19
-
20
- /**
21
- * @typedef PointsResponse
22
- * @property {number} [points] - Total points available
23
- */
24
-
25
- /**
26
- * @typedef ReferralDetailsUser
27
- * @property {boolean} [blocked]
28
- * @property {number} [points]
29
- * @property {boolean} [redeemed]
30
- * @property {string} [referral_code]
31
- */
32
-
33
- /**
34
- * @typedef Offer
35
- * @property {Schedule} [_schedule]
36
- * @property {boolean} [active]
37
- * @property {string} [application_id]
38
- * @property {Asset} [banner_image]
39
- * @property {string} [created_at]
40
- * @property {string} [name]
41
- * @property {Object} [rule]
42
- * @property {ShareMessages} [share]
43
- * @property {string} [sub_text]
44
- * @property {string} [text]
45
- * @property {string} [type]
46
- * @property {string} [updated_at]
47
- * @property {string} [updated_by]
48
- * @property {string} [url]
49
- */
50
-
51
- /**
52
- * @typedef Schedule
53
- * @property {number} [duration]
54
- * @property {string} [end]
55
- * @property {string} [start]
56
- * @property {string} [cron]
57
- */
58
-
59
- /**
60
- * @typedef Error
61
- * @property {number} [code]
62
- * @property {string} [exception]
63
- * @property {string} [info]
64
- * @property {string} [message]
65
- */
66
-
67
- /**
68
- * @typedef Asset
69
- * @property {string} [aspect_ratio]
70
- * @property {string} [id]
71
- * @property {string} [secure_url]
72
- */
73
-
74
- /**
75
- * @typedef ShareMessages
76
- * @property {number} [email]
77
- * @property {string} [facebook]
78
- * @property {string} [fallback]
79
- * @property {string} [message]
80
- * @property {string} [messenger]
81
- * @property {string} [sms]
82
- * @property {string} [text]
83
- * @property {string} [twitter]
84
- * @property {string} [whatsapp]
85
- */
86
-
87
- /**
88
- * @typedef ReferralDetailsResponse
89
- * @property {Offer} [referral]
90
- * @property {ShareMessages} [share]
91
- * @property {ReferralDetailsUser} [user]
92
- * @property {string} [referrer_info]
93
- * @property {string} [terms_conditions_link]
94
- */
95
-
96
- /**
97
- * @typedef OrderDiscountRequest
98
- * @property {number} order_amount
99
- * @property {string} [currency]
100
- */
101
-
102
- /**
103
- * @typedef OrderDiscountRuleBucket
104
- * @property {number} [high]
105
- * @property {number} [low]
106
- * @property {number} [max]
107
- * @property {number} [value]
108
- * @property {string} [value_type]
109
- */
110
-
111
- /**
112
- * @typedef DiscountProperties
113
- * @property {number} [absolute]
114
- * @property {string} [currency]
115
- * @property {string} [display_absolute]
116
- * @property {string} [display_percent]
117
- * @property {number} [percent]
118
- */
119
-
120
- /**
121
- * @typedef OrderDiscountResponse
122
- * @property {number} [order_amount]
123
- * @property {number} [points]
124
- * @property {DiscountProperties} [discount]
125
- * @property {DiscountProperties} [base_discount]
126
- * @property {OrderDiscountRuleBucket} [applied_rule_bucket]
127
- */
128
-
129
- /**
130
- * @typedef RedeemReferralCodeRequest
131
- * @property {string} [device_id]
132
- * @property {string} [referral_code]
133
- */
134
-
135
- /**
136
- * @typedef RedeemReferralCodeResponse
137
- * @property {boolean} [redeemed]
138
- * @property {string} [message]
139
- * @property {string} [referrer_info]
140
- * @property {string} [referrer_id]
141
- * @property {number} [points]
142
- */
143
-
144
- /**
145
- * @typedef PointsHistoryResponse
146
- * @property {PointsHistory[]} [items] - History is the list of points transaction.
147
- * @property {Page} [page]
148
- */
149
-
150
- /**
151
- * @typedef PointsHistory
152
- * @property {string} [_id]
153
- * @property {string} [application_id]
154
- * @property {boolean} [claimed]
155
- * @property {string} [created_at]
156
- * @property {string} [expires_on]
157
- * @property {Object} [meta]
158
- * @property {number} [points]
159
- * @property {number} [remaining_points]
160
- * @property {string} [text_1]
161
- * @property {string} [text_2]
162
- * @property {string} [text_3]
163
- * @property {string} [txn_name]
164
- * @property {string} [updated_at]
165
- * @property {string} [user_id]
166
- */
167
-
168
- /**
169
- * @typedef Page
170
- * @property {number} [item_total] - The total number of items on the page.
171
- * @property {string} [next_id] - The identifier for the next page.
172
- * @property {boolean} [has_previous] - Indicates whether there is a previous page.
173
- * @property {boolean} [has_next] - Indicates whether there is a next page.
174
- * @property {number} [current] - The current page number.
175
- * @property {string} type - The type of the page, such as 'PageType'.
176
- * @property {number} [size] - The number of items per page.
177
- */
178
-
179
- class RewardsApplicationModel {
180
- /** @returns {RewardsArticle} */
181
- static RewardsArticle() {
182
- return Joi.object({
183
- id: Joi.string().allow(""),
184
- points: Joi.number(),
185
- price: Joi.number(),
186
- });
187
- }
188
-
189
- /** @returns {CatalogueOrderResponse} */
190
- static CatalogueOrderResponse() {
191
- return Joi.object({
192
- articles: Joi.array().items(RewardsApplicationModel.RewardsArticle()),
193
- });
194
- }
195
-
196
- /** @returns {CatalogueOrderRequest} */
197
- static CatalogueOrderRequest() {
198
- return Joi.object({
199
- articles: Joi.array().items(RewardsApplicationModel.RewardsArticle()),
200
- });
201
- }
202
-
203
- /** @returns {PointsResponse} */
204
- static PointsResponse() {
205
- return Joi.object({
206
- points: Joi.number(),
207
- });
208
- }
209
-
210
- /** @returns {ReferralDetailsUser} */
211
- static ReferralDetailsUser() {
212
- return Joi.object({
213
- blocked: Joi.boolean(),
214
- points: Joi.number(),
215
- redeemed: Joi.boolean(),
216
- referral_code: Joi.string().allow(""),
217
- });
218
- }
219
-
220
- /** @returns {Offer} */
221
- static Offer() {
222
- return Joi.object({
223
- _schedule: RewardsApplicationModel.Schedule(),
224
- active: Joi.boolean(),
225
- application_id: Joi.string().allow(""),
226
- banner_image: RewardsApplicationModel.Asset(),
227
- created_at: Joi.string().allow(""),
228
- name: Joi.string().allow(""),
229
- rule: Joi.any(),
230
- share: RewardsApplicationModel.ShareMessages(),
231
- sub_text: Joi.string().allow(""),
232
- text: Joi.string().allow(""),
233
- type: Joi.string().allow(""),
234
- updated_at: Joi.string().allow(""),
235
- updated_by: Joi.string().allow(""),
236
- url: Joi.string().allow(""),
237
- });
238
- }
239
-
240
- /** @returns {Schedule} */
241
- static Schedule() {
242
- return Joi.object({
243
- duration: Joi.number(),
244
- end: Joi.string().allow(""),
245
- start: Joi.string().allow(""),
246
- cron: Joi.string().allow(""),
247
- });
248
- }
249
-
250
- /** @returns {Error} */
251
- static Error() {
252
- return Joi.object({
253
- code: Joi.number(),
254
- exception: Joi.string().allow(""),
255
- info: Joi.string().allow(""),
256
- message: Joi.string().allow(""),
257
- });
258
- }
259
-
260
- /** @returns {Asset} */
261
- static Asset() {
262
- return Joi.object({
263
- aspect_ratio: Joi.string().allow(""),
264
- id: Joi.string().allow(""),
265
- secure_url: Joi.string().allow(""),
266
- });
267
- }
268
-
269
- /** @returns {ShareMessages} */
270
- static ShareMessages() {
271
- return Joi.object({
272
- email: Joi.number(),
273
- facebook: Joi.string().allow(""),
274
- fallback: Joi.string().allow(""),
275
- message: Joi.string().allow(""),
276
- messenger: Joi.string().allow(""),
277
- sms: Joi.string().allow(""),
278
- text: Joi.string().allow(""),
279
- twitter: Joi.string().allow(""),
280
- whatsapp: Joi.string().allow(""),
281
- });
282
- }
283
-
284
- /** @returns {ReferralDetailsResponse} */
285
- static ReferralDetailsResponse() {
286
- return Joi.object({
287
- referral: RewardsApplicationModel.Offer(),
288
- share: RewardsApplicationModel.ShareMessages(),
289
- user: RewardsApplicationModel.ReferralDetailsUser(),
290
- referrer_info: Joi.string().allow(""),
291
- terms_conditions_link: Joi.string().allow(""),
292
- });
293
- }
294
-
295
- /** @returns {OrderDiscountRequest} */
296
- static OrderDiscountRequest() {
297
- return Joi.object({
298
- order_amount: Joi.number().required(),
299
- currency: Joi.string().allow(""),
300
- });
301
- }
302
-
303
- /** @returns {OrderDiscountRuleBucket} */
304
- static OrderDiscountRuleBucket() {
305
- return Joi.object({
306
- high: Joi.number(),
307
- low: Joi.number(),
308
- max: Joi.number(),
309
- value: Joi.number(),
310
- value_type: Joi.string().allow(""),
311
- });
312
- }
313
-
314
- /** @returns {DiscountProperties} */
315
- static DiscountProperties() {
316
- return Joi.object({
317
- absolute: Joi.number(),
318
- currency: Joi.string().allow(""),
319
- display_absolute: Joi.string().allow(""),
320
- display_percent: Joi.string().allow(""),
321
- percent: Joi.number(),
322
- });
323
- }
324
-
325
- /** @returns {OrderDiscountResponse} */
326
- static OrderDiscountResponse() {
327
- return Joi.object({
328
- order_amount: Joi.number(),
329
- points: Joi.number(),
330
- discount: RewardsApplicationModel.DiscountProperties(),
331
- base_discount: RewardsApplicationModel.DiscountProperties(),
332
- applied_rule_bucket: RewardsApplicationModel.OrderDiscountRuleBucket(),
333
- });
334
- }
335
-
336
- /** @returns {RedeemReferralCodeRequest} */
337
- static RedeemReferralCodeRequest() {
338
- return Joi.object({
339
- device_id: Joi.string().allow(""),
340
- referral_code: Joi.string().allow(""),
341
- });
342
- }
343
-
344
- /** @returns {RedeemReferralCodeResponse} */
345
- static RedeemReferralCodeResponse() {
346
- return Joi.object({
347
- redeemed: Joi.boolean(),
348
- message: Joi.string().allow(""),
349
- referrer_info: Joi.string().allow(""),
350
- referrer_id: Joi.string().allow(""),
351
- points: Joi.number(),
352
- });
353
- }
354
-
355
- /** @returns {PointsHistoryResponse} */
356
- static PointsHistoryResponse() {
357
- return Joi.object({
358
- items: Joi.array().items(RewardsApplicationModel.PointsHistory()),
359
- page: RewardsApplicationModel.Page(),
360
- });
361
- }
362
-
363
- /** @returns {PointsHistory} */
364
- static PointsHistory() {
365
- return Joi.object({
366
- _id: Joi.string().allow(""),
367
- application_id: Joi.string().allow(""),
368
- claimed: Joi.boolean(),
369
- created_at: Joi.string().allow(""),
370
- expires_on: Joi.string().allow(""),
371
- meta: Joi.any(),
372
- points: Joi.number(),
373
- remaining_points: Joi.number(),
374
- text_1: Joi.string().allow(""),
375
- text_2: Joi.string().allow(""),
376
- text_3: Joi.string().allow(""),
377
- txn_name: Joi.string().allow(""),
378
- updated_at: Joi.string().allow(""),
379
- user_id: Joi.string().allow(""),
380
- });
381
- }
382
-
383
- /** @returns {Page} */
384
- static Page() {
385
- return Joi.object({
386
- item_total: Joi.number(),
387
- next_id: Joi.string().allow(""),
388
- has_previous: Joi.boolean(),
389
- has_next: Joi.boolean(),
390
- current: Joi.number(),
391
- type: Joi.string().allow("").required(),
392
- size: Joi.number(),
393
- });
394
- }
395
- }
396
- module.exports = RewardsApplicationModel;
@@ -1,73 +0,0 @@
1
- export = RewardsApplicationValidator;
2
- /**
3
- * @typedef CatalogueOrderParam
4
- * @property {RewardsApplicationModel.CatalogueOrderRequest} body
5
- */
6
- /**
7
- * @typedef GetOfferByNameParam
8
- * @property {string} name - The name given to the offer.
9
- */
10
- /**
11
- * @typedef GetOrderDiscountParam
12
- * @property {RewardsApplicationModel.OrderDiscountRequest} body
13
- */
14
- /** @typedef GetUserPointsParam */
15
- /**
16
- * @typedef GetUserPointsHistoryParam
17
- * @property {string} [pageId] - PageID is the ID of the requested page. For
18
- * first request it should be kept empty.
19
- * @property {number} [pageSize] - The number of items to retrieve in each page.
20
- */
21
- /** @typedef GetUserReferralDetailsParam */
22
- /**
23
- * @typedef RedeemReferralCodeParam
24
- * @property {RewardsApplicationModel.RedeemReferralCodeRequest} body
25
- */
26
- declare class RewardsApplicationValidator {
27
- /** @returns {CatalogueOrderParam} */
28
- static catalogueOrder(): CatalogueOrderParam;
29
- /** @returns {GetOfferByNameParam} */
30
- static getOfferByName(): GetOfferByNameParam;
31
- /** @returns {GetOrderDiscountParam} */
32
- static getOrderDiscount(): GetOrderDiscountParam;
33
- /** @returns {GetUserPointsParam} */
34
- static getUserPoints(): any;
35
- /** @returns {GetUserPointsHistoryParam} */
36
- static getUserPointsHistory(): GetUserPointsHistoryParam;
37
- /** @returns {GetUserReferralDetailsParam} */
38
- static getUserReferralDetails(): any;
39
- /** @returns {RedeemReferralCodeParam} */
40
- static redeemReferralCode(): RedeemReferralCodeParam;
41
- }
42
- declare namespace RewardsApplicationValidator {
43
- export { CatalogueOrderParam, GetOfferByNameParam, GetOrderDiscountParam, GetUserPointsParam, GetUserPointsHistoryParam, GetUserReferralDetailsParam, RedeemReferralCodeParam };
44
- }
45
- type CatalogueOrderParam = {
46
- body: RewardsApplicationModel.CatalogueOrderRequest;
47
- };
48
- type GetOfferByNameParam = {
49
- /**
50
- * - The name given to the offer.
51
- */
52
- name: string;
53
- };
54
- type GetOrderDiscountParam = {
55
- body: RewardsApplicationModel.OrderDiscountRequest;
56
- };
57
- type GetUserPointsHistoryParam = {
58
- /**
59
- * - PageID is the ID of the requested page. For
60
- * first request it should be kept empty.
61
- */
62
- pageId?: string;
63
- /**
64
- * - The number of items to retrieve in each page.
65
- */
66
- pageSize?: number;
67
- };
68
- type RedeemReferralCodeParam = {
69
- body: RewardsApplicationModel.RedeemReferralCodeRequest;
70
- };
71
- type GetUserPointsParam = any;
72
- type GetUserReferralDetailsParam = any;
73
- import RewardsApplicationModel = require("./RewardsApplicationModel");
@@ -1,84 +0,0 @@
1
- const Joi = require("joi");
2
-
3
- const RewardsApplicationModel = require("./RewardsApplicationModel");
4
-
5
- /**
6
- * @typedef CatalogueOrderParam
7
- * @property {RewardsApplicationModel.CatalogueOrderRequest} body
8
- */
9
-
10
- /**
11
- * @typedef GetOfferByNameParam
12
- * @property {string} name - The name given to the offer.
13
- */
14
-
15
- /**
16
- * @typedef GetOrderDiscountParam
17
- * @property {RewardsApplicationModel.OrderDiscountRequest} body
18
- */
19
-
20
- /** @typedef GetUserPointsParam */
21
-
22
- /**
23
- * @typedef GetUserPointsHistoryParam
24
- * @property {string} [pageId] - PageID is the ID of the requested page. For
25
- * first request it should be kept empty.
26
- * @property {number} [pageSize] - The number of items to retrieve in each page.
27
- */
28
-
29
- /** @typedef GetUserReferralDetailsParam */
30
-
31
- /**
32
- * @typedef RedeemReferralCodeParam
33
- * @property {RewardsApplicationModel.RedeemReferralCodeRequest} body
34
- */
35
-
36
- class RewardsApplicationValidator {
37
- /** @returns {CatalogueOrderParam} */
38
- static catalogueOrder() {
39
- return Joi.object({
40
- body: RewardsApplicationModel.CatalogueOrderRequest().required(),
41
- }).required();
42
- }
43
-
44
- /** @returns {GetOfferByNameParam} */
45
- static getOfferByName() {
46
- return Joi.object({
47
- name: Joi.string().allow("").required(),
48
- }).required();
49
- }
50
-
51
- /** @returns {GetOrderDiscountParam} */
52
- static getOrderDiscount() {
53
- return Joi.object({
54
- body: RewardsApplicationModel.OrderDiscountRequest().required(),
55
- }).required();
56
- }
57
-
58
- /** @returns {GetUserPointsParam} */
59
- static getUserPoints() {
60
- return Joi.object({});
61
- }
62
-
63
- /** @returns {GetUserPointsHistoryParam} */
64
- static getUserPointsHistory() {
65
- return Joi.object({
66
- pageId: Joi.string().allow(""),
67
- pageSize: Joi.number(),
68
- });
69
- }
70
-
71
- /** @returns {GetUserReferralDetailsParam} */
72
- static getUserReferralDetails() {
73
- return Joi.object({});
74
- }
75
-
76
- /** @returns {RedeemReferralCodeParam} */
77
- static redeemReferralCode() {
78
- return Joi.object({
79
- body: RewardsApplicationModel.RedeemReferralCodeRequest().required(),
80
- }).required();
81
- }
82
- }
83
-
84
- module.exports = RewardsApplicationValidator;