@gofynd/fdk-client-javascript 1.4.8 → 1.4.9

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.
@@ -2,33 +2,12 @@ const Joi = require("joi");
2
2
 
3
3
  const BillingPlatformModel = require("./BillingPlatformModel");
4
4
 
5
- /**
6
- * @typedef ActivateSubscriptionPlanParam
7
- * @property {BillingPlatformModel.SubscriptionActivateReq} body
8
- */
9
-
10
5
  /**
11
6
  * @typedef CancelSubscriptionChargeParam
12
7
  * @property {string} extensionId - Extension _id
13
8
  * @property {string} subscriptionId - Subscription charge _id
14
9
  */
15
10
 
16
- /**
17
- * @typedef CancelSubscriptionPlanParam
18
- * @property {BillingPlatformModel.CancelSubscriptionReq} body
19
- */
20
-
21
- /**
22
- * @typedef ChangePlanParam
23
- * @property {BillingPlatformModel.SubscriptionActivateReq} body
24
- */
25
-
26
- /**
27
- * @typedef CheckCouponValidityParam
28
- * @property {string} plan - ID of the plan.
29
- * @property {string} couponCode - Coupon code.
30
- */
31
-
32
11
  /**
33
12
  * @typedef CreateOneTimeChargeParam
34
13
  * @property {string} extensionId - Extension _id
@@ -42,207 +21,19 @@ const BillingPlatformModel = require("./BillingPlatformModel");
42
21
  * @property {BillingPlatformModel.CreateSubscriptionCharge} body
43
22
  */
44
23
 
45
- /**
46
- * @typedef CreditTransactionParam
47
- * @property {number} uniqueId - Unique ID of the company
48
- * @property {string} productSuite - Product suite
49
- * @property {string} type - Type of the company
50
- * @property {number} [pageSize] - Number of items per page
51
- * @property {number} [pageNo] - Page number
52
- * @property {string} [startDate] - Start date
53
- * @property {string} [endDate] - End date
54
- * @property {string} [searchType] - Search Type
55
- * @property {string} [searchValue] - Search Value
56
- */
57
-
58
- /**
59
- * @typedef CurrentAppLimitParam
60
- * @property {string} [productSuite]
61
- * @property {string} [type]
62
- */
63
-
64
- /**
65
- * @typedef CurrentLimitParam
66
- * @property {string} [productSuite]
67
- * @property {string} [type]
68
- */
69
-
70
- /** @typedef GetBankListParam */
71
-
72
24
  /**
73
25
  * @typedef GetChargeDetailsParam
74
26
  * @property {string} extensionId - Extension _id
75
27
  * @property {string} chargeId - Standalone charge _id
76
28
  */
77
29
 
78
- /** @typedef GetCustomerDetailParam */
79
-
80
- /** @typedef GetEnterprisePlansParam */
81
-
82
- /**
83
- * @typedef GetInvoiceByIdParam
84
- * @property {string} invoiceId - Invoice id
85
- */
86
-
87
- /** @typedef GetInvoicesParam */
88
-
89
- /**
90
- * @typedef GetPaymentOptionsParam
91
- * @property {string} transactionId - ID of the payment transaction.
92
- */
93
-
94
- /**
95
- * @typedef GetPaymentTransactionParam
96
- * @property {string} transactionId - Payment Transaction unique id.
97
- */
98
-
99
- /** @typedef GetSubscriptionParam */
100
-
101
30
  /**
102
31
  * @typedef GetSubscriptionChargeParam
103
32
  * @property {string} extensionId - Extension _id
104
33
  * @property {string} subscriptionId - Subscription charge _id
105
34
  */
106
35
 
107
- /**
108
- * @typedef GetentityDetailParam
109
- * @property {string} entityName - Entity name.
110
- * @property {string} [entityId] - Entity unique id.
111
- * @property {string} channel - Ordering channel.
112
- * @property {string} [component] - The coponents the user would like to know.
113
- * @property {string} [componentName] - The name of component the preferred to be fetched.
114
- */
115
-
116
- /**
117
- * @typedef GlobalSettingsParam
118
- * @property {number} pageNo - Number of pages needed
119
- * @property {number} pageSize - Number of items to be there in page
120
- * @property {Object} query - Field which will be used in db query
121
- */
122
-
123
- /**
124
- * @typedef MethodDefaultParam
125
- * @property {BillingPlatformModel.DefaultReq} body
126
- */
127
-
128
- /**
129
- * @typedef PaymentCollectParam
130
- * @property {BillingPlatformModel.PaymentCollectReq} body
131
- */
132
-
133
- /**
134
- * @typedef PaymentInitiateParam
135
- * @property {BillingPlatformModel.SubscribePlan} body
136
- */
137
-
138
- /**
139
- * @typedef PaymentOptionsParam
140
- * @property {string} code - Payment options unique code.
141
- */
142
-
143
- /**
144
- * @typedef PaymentStatusParam
145
- * @property {string} orderId - Unique ID of the company
146
- */
147
-
148
- /**
149
- * @typedef PlanDowngradeParam
150
- * @property {BillingPlatformModel.DowngradePlanReq} body
151
- */
152
-
153
- /** @typedef PlanDowngradeGetParam */
154
-
155
- /**
156
- * @typedef PlanStatusUpdateParam
157
- * @property {BillingPlatformModel.PlanStatusUpdateReq} body
158
- */
159
-
160
- /**
161
- * @typedef SetupIntentParam
162
- * @property {BillingPlatformModel.IntentReq} body
163
- */
164
-
165
- /**
166
- * @typedef SetupMandateParam
167
- * @property {BillingPlatformModel.SetupMandateReq} body
168
- */
169
-
170
- /**
171
- * @typedef SetupPaymentParam
172
- * @property {BillingPlatformModel.SetupPaymentReq} body
173
- */
174
-
175
- /** @typedef SubscriptionConfigsParam */
176
-
177
- /**
178
- * @typedef SubscriptionMethodsParam
179
- * @property {string} uniqueExternalId - Unique id for external company
180
- */
181
-
182
- /**
183
- * @typedef SubscriptionMethodsDeleteParam
184
- * @property {string} uniqueExternalId - Unique id for external company
185
- * @property {string} paymentMethodId - Payment method id
186
- */
187
-
188
- /**
189
- * @typedef SubscriptionPlanChangeParam
190
- * @property {string} [productSuite]
191
- * @property {string} [coupon]
192
- * @property {number} [uniqueId]
193
- * @property {string} [platform]
194
- * @property {string} [planId]
195
- */
196
-
197
- /**
198
- * @typedef SubscriptionRenewParam
199
- * @property {BillingPlatformModel.SubscriptionRenewReq} body
200
- */
201
-
202
- /**
203
- * @typedef TopupCancelCreditParam
204
- * @property {BillingPlatformModel.CancelTopupReq} body
205
- */
206
-
207
- /**
208
- * @typedef TopupCreditParam
209
- * @property {BillingPlatformModel.TopupReq} body
210
- */
211
-
212
- /**
213
- * @typedef UpdateConsentParam
214
- * @property {string} subscriberId - Customer unique id. In case of company it
215
- * will be company id.
216
- */
217
-
218
- /**
219
- * @typedef UpdateSetupIntentParam
220
- * @property {BillingPlatformModel.PutIntentReq} body
221
- */
222
-
223
- /**
224
- * @typedef UpgradePlanParam
225
- * @property {BillingPlatformModel.SubscriptionMethodsReq} body
226
- */
227
-
228
- /**
229
- * @typedef UpsertCustomerDetailParam
230
- * @property {BillingPlatformModel.SubscriptionCustomerCreate} body
231
- */
232
-
233
- /**
234
- * @typedef VerifyPaymentParam
235
- * @property {BillingPlatformModel.VerifyPaymentReq} body
236
- */
237
-
238
36
  class BillingPlatformValidator {
239
- /** @returns {ActivateSubscriptionPlanParam} */
240
- static activateSubscriptionPlan() {
241
- return Joi.object({
242
- body: BillingPlatformModel.SubscriptionActivateReq().required(),
243
- }).required();
244
- }
245
-
246
37
  /** @returns {CancelSubscriptionChargeParam} */
247
38
  static cancelSubscriptionCharge() {
248
39
  return Joi.object({
@@ -251,28 +42,6 @@ class BillingPlatformValidator {
251
42
  }).required();
252
43
  }
253
44
 
254
- /** @returns {CancelSubscriptionPlanParam} */
255
- static cancelSubscriptionPlan() {
256
- return Joi.object({
257
- body: BillingPlatformModel.CancelSubscriptionReq().required(),
258
- }).required();
259
- }
260
-
261
- /** @returns {ChangePlanParam} */
262
- static changePlan() {
263
- return Joi.object({
264
- body: BillingPlatformModel.SubscriptionActivateReq().required(),
265
- }).required();
266
- }
267
-
268
- /** @returns {CheckCouponValidityParam} */
269
- static checkCouponValidity() {
270
- return Joi.object({
271
- plan: Joi.string().allow("").required(),
272
- couponCode: Joi.string().allow("").required(),
273
- }).required();
274
- }
275
-
276
45
  /** @returns {CreateOneTimeChargeParam} */
277
46
  static createOneTimeCharge() {
278
47
  return Joi.object({
@@ -289,42 +58,6 @@ class BillingPlatformValidator {
289
58
  }).required();
290
59
  }
291
60
 
292
- /** @returns {CreditTransactionParam} */
293
- static creditTransaction() {
294
- return Joi.object({
295
- uniqueId: Joi.number().required(),
296
- productSuite: Joi.string().allow("").required(),
297
- type: Joi.string().allow("").required(),
298
- pageSize: Joi.number(),
299
- pageNo: Joi.number(),
300
- startDate: Joi.string().allow(""),
301
- endDate: Joi.string().allow(""),
302
- searchType: Joi.string().allow(""),
303
- searchValue: Joi.string().allow(""),
304
- }).required();
305
- }
306
-
307
- /** @returns {CurrentAppLimitParam} */
308
- static currentAppLimit() {
309
- return Joi.object({
310
- productSuite: Joi.string().allow(""),
311
- type: Joi.string().allow(""),
312
- }).required();
313
- }
314
-
315
- /** @returns {CurrentLimitParam} */
316
- static currentLimit() {
317
- return Joi.object({
318
- productSuite: Joi.string().allow(""),
319
- type: Joi.string().allow(""),
320
- }).required();
321
- }
322
-
323
- /** @returns {GetBankListParam} */
324
- static getBankList() {
325
- return Joi.object({}).required();
326
- }
327
-
328
61
  /** @returns {GetChargeDetailsParam} */
329
62
  static getChargeDetails() {
330
63
  return Joi.object({
@@ -333,47 +66,6 @@ class BillingPlatformValidator {
333
66
  }).required();
334
67
  }
335
68
 
336
- /** @returns {GetCustomerDetailParam} */
337
- static getCustomerDetail() {
338
- return Joi.object({}).required();
339
- }
340
-
341
- /** @returns {GetEnterprisePlansParam} */
342
- static getEnterprisePlans() {
343
- return Joi.object({}).required();
344
- }
345
-
346
- /** @returns {GetInvoiceByIdParam} */
347
- static getInvoiceById() {
348
- return Joi.object({
349
- invoiceId: Joi.string().allow("").required(),
350
- }).required();
351
- }
352
-
353
- /** @returns {GetInvoicesParam} */
354
- static getInvoices() {
355
- return Joi.object({}).required();
356
- }
357
-
358
- /** @returns {GetPaymentOptionsParam} */
359
- static getPaymentOptions() {
360
- return Joi.object({
361
- transactionId: Joi.string().allow("").required(),
362
- }).required();
363
- }
364
-
365
- /** @returns {GetPaymentTransactionParam} */
366
- static getPaymentTransaction() {
367
- return Joi.object({
368
- transactionId: Joi.string().allow("").required(),
369
- }).required();
370
- }
371
-
372
- /** @returns {GetSubscriptionParam} */
373
- static getSubscription() {
374
- return Joi.object({}).required();
375
- }
376
-
377
69
  /** @returns {GetSubscriptionChargeParam} */
378
70
  static getSubscriptionCharge() {
379
71
  return Joi.object({
@@ -381,188 +73,6 @@ class BillingPlatformValidator {
381
73
  subscriptionId: Joi.string().allow("").required(),
382
74
  }).required();
383
75
  }
384
-
385
- /** @returns {GetentityDetailParam} */
386
- static getentityDetail() {
387
- return Joi.object({
388
- entityName: Joi.string().allow("").required(),
389
- entityId: Joi.string().allow(""),
390
- channel: Joi.string().allow("").required(),
391
- component: Joi.string().allow(""),
392
- componentName: Joi.string().allow(""),
393
- }).required();
394
- }
395
-
396
- /** @returns {GlobalSettingsParam} */
397
- static globalSettings() {
398
- return Joi.object({
399
- pageNo: Joi.number().required(),
400
- pageSize: Joi.number().required(),
401
- query: Joi.any().required(),
402
- }).required();
403
- }
404
-
405
- /** @returns {MethodDefaultParam} */
406
- static methodDefault() {
407
- return Joi.object({
408
- body: BillingPlatformModel.DefaultReq().required(),
409
- }).required();
410
- }
411
-
412
- /** @returns {PaymentCollectParam} */
413
- static paymentCollect() {
414
- return Joi.object({
415
- body: BillingPlatformModel.PaymentCollectReq().required(),
416
- }).required();
417
- }
418
-
419
- /** @returns {PaymentInitiateParam} */
420
- static paymentInitiate() {
421
- return Joi.object({
422
- body: BillingPlatformModel.SubscribePlan().required(),
423
- }).required();
424
- }
425
-
426
- /** @returns {PaymentOptionsParam} */
427
- static paymentOptions() {
428
- return Joi.object({
429
- code: Joi.string().allow("").required(),
430
- }).required();
431
- }
432
-
433
- /** @returns {PaymentStatusParam} */
434
- static paymentStatus() {
435
- return Joi.object({
436
- orderId: Joi.string().allow("").required(),
437
- }).required();
438
- }
439
-
440
- /** @returns {PlanDowngradeParam} */
441
- static planDowngrade() {
442
- return Joi.object({
443
- body: BillingPlatformModel.DowngradePlanReq().required(),
444
- }).required();
445
- }
446
-
447
- /** @returns {PlanDowngradeGetParam} */
448
- static planDowngradeGet() {
449
- return Joi.object({}).required();
450
- }
451
-
452
- /** @returns {PlanStatusUpdateParam} */
453
- static planStatusUpdate() {
454
- return Joi.object({
455
- body: BillingPlatformModel.PlanStatusUpdateReq().required(),
456
- }).required();
457
- }
458
-
459
- /** @returns {SetupIntentParam} */
460
- static setupIntent() {
461
- return Joi.object({
462
- body: BillingPlatformModel.IntentReq().required(),
463
- }).required();
464
- }
465
-
466
- /** @returns {SetupMandateParam} */
467
- static setupMandate() {
468
- return Joi.object({
469
- body: BillingPlatformModel.SetupMandateReq().required(),
470
- }).required();
471
- }
472
-
473
- /** @returns {SetupPaymentParam} */
474
- static setupPayment() {
475
- return Joi.object({
476
- body: BillingPlatformModel.SetupPaymentReq().required(),
477
- }).required();
478
- }
479
-
480
- /** @returns {SubscriptionConfigsParam} */
481
- static subscriptionConfigs() {
482
- return Joi.object({}).required();
483
- }
484
-
485
- /** @returns {SubscriptionMethodsParam} */
486
- static subscriptionMethods() {
487
- return Joi.object({
488
- uniqueExternalId: Joi.string().allow("").required(),
489
- }).required();
490
- }
491
-
492
- /** @returns {SubscriptionMethodsDeleteParam} */
493
- static subscriptionMethodsDelete() {
494
- return Joi.object({
495
- uniqueExternalId: Joi.string().allow("").required(),
496
- paymentMethodId: Joi.string().allow("").required(),
497
- }).required();
498
- }
499
-
500
- /** @returns {SubscriptionPlanChangeParam} */
501
- static subscriptionPlanChange() {
502
- return Joi.object({
503
- productSuite: Joi.string().allow(""),
504
- coupon: Joi.string().allow(""),
505
- uniqueId: Joi.number(),
506
- platform: Joi.string().allow(""),
507
- planId: Joi.string().allow(""),
508
- }).required();
509
- }
510
-
511
- /** @returns {SubscriptionRenewParam} */
512
- static subscriptionRenew() {
513
- return Joi.object({
514
- body: BillingPlatformModel.SubscriptionRenewReq().required(),
515
- }).required();
516
- }
517
-
518
- /** @returns {TopupCancelCreditParam} */
519
- static topupCancelCredit() {
520
- return Joi.object({
521
- body: BillingPlatformModel.CancelTopupReq().required(),
522
- }).required();
523
- }
524
-
525
- /** @returns {TopupCreditParam} */
526
- static topupCredit() {
527
- return Joi.object({
528
- body: BillingPlatformModel.TopupReq().required(),
529
- }).required();
530
- }
531
-
532
- /** @returns {UpdateConsentParam} */
533
- static updateConsent() {
534
- return Joi.object({
535
- subscriberId: Joi.string().allow("").required(),
536
- }).required();
537
- }
538
-
539
- /** @returns {UpdateSetupIntentParam} */
540
- static updateSetupIntent() {
541
- return Joi.object({
542
- body: BillingPlatformModel.PutIntentReq().required(),
543
- }).required();
544
- }
545
-
546
- /** @returns {UpgradePlanParam} */
547
- static upgradePlan() {
548
- return Joi.object({
549
- body: BillingPlatformModel.SubscriptionMethodsReq().required(),
550
- }).required();
551
- }
552
-
553
- /** @returns {UpsertCustomerDetailParam} */
554
- static upsertCustomerDetail() {
555
- return Joi.object({
556
- body: BillingPlatformModel.SubscriptionCustomerCreate().required(),
557
- }).required();
558
- }
559
-
560
- /** @returns {VerifyPaymentParam} */
561
- static verifyPayment() {
562
- return Joi.object({
563
- body: BillingPlatformModel.VerifyPaymentReq().required(),
564
- }).required();
565
- }
566
76
  }
567
77
 
568
78
  module.exports = BillingPlatformValidator;
@@ -12,7 +12,6 @@ declare class PublicClient {
12
12
  */
13
13
  constructor(config: import("./PublicConfig"));
14
14
  config: import("./PublicConfig");
15
- billing: Billing;
16
15
  configuration: Configuration;
17
16
  content: Content;
18
17
  partner: Partner;
@@ -25,7 +24,6 @@ declare class PublicClient {
25
24
  */
26
25
  setExtraHeaders(header: object): void;
27
26
  }
28
- import Billing = require("./Billing/BillingPublicClient");
29
27
  import Configuration = require("./Configuration/ConfigurationPublicClient");
30
28
  import Content = require("./Content/ContentPublicClient");
31
29
  import Partner = require("./Partner/PartnerPublicClient");
@@ -1,5 +1,3 @@
1
- const Billing = require("./Billing/BillingPublicClient");
2
-
3
1
  const Configuration = require("./Configuration/ConfigurationPublicClient");
4
2
 
5
3
  const Content = require("./Content/ContentPublicClient");
@@ -24,8 +22,6 @@ class PublicClient {
24
22
  constructor(config) {
25
23
  this.config = config;
26
24
 
27
- this.billing = new Billing(config);
28
-
29
25
  this.configuration = new Configuration(config);
30
26
 
31
27
  this.content = new Content(config);
@@ -1,7 +1,6 @@
1
1
  export const PublicConfig: typeof import("./PublicConfig");
2
2
  export const PublicClient: typeof import("./PublicClient");
3
3
  export namespace PublicModel {
4
- const BillingPublicModel: typeof import("./Billing/BillingPublicModel");
5
4
  const ConfigurationPublicModel: typeof import("./Configuration/ConfigurationPublicModel");
6
5
  const ContentPublicModel: typeof import("./Content/ContentPublicModel");
7
6
  const PartnerPublicModel: typeof import("./Partner/PartnerPublicModel");
@@ -2,8 +2,6 @@ module.exports = {
2
2
  PublicConfig: require("./PublicConfig"),
3
3
  PublicClient: require("./PublicClient"),
4
4
  PublicModel: {
5
- BillingPublicModel: require("./Billing/BillingPublicModel"),
6
-
7
5
  ConfigurationPublicModel: require("./Configuration/ConfigurationPublicModel"),
8
6
 
9
7
  ContentPublicModel: require("./Content/ContentPublicModel"),
@@ -1,56 +0,0 @@
1
- export = Billing;
2
- declare class Billing {
3
- constructor(_conf: any);
4
- _conf: any;
5
- _relativeUrls: {
6
- getPlanDetails: string;
7
- getStandardPlans: string;
8
- getTenureConfig: string;
9
- planList: string;
10
- };
11
- _urls: {};
12
- updateUrls(urls: any): void;
13
- /**
14
- * @param {BillingPublicValidator.GetPlanDetailsParam} arg - Arg object.
15
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
16
- * @param {import("../PublicAPIClient").Options} - Options
17
- * @returns {Promise<BillingPublicModel.PlanDetails>} - Success response
18
- * @name getPlanDetails
19
- * @summary: Get plan details
20
- * @description: Get plan details.
21
- * - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/public/billing/getPlanDetails/).
22
- */
23
- getPlanDetails({ planId, requestHeaders }?: BillingPublicValidator.GetPlanDetailsParam, { responseHeaders }?: object): Promise<BillingPublicModel.PlanDetails>;
24
- /**
25
- * @param {BillingPublicValidator.GetStandardPlansParam} arg - Arg object.
26
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
27
- * @param {import("../PublicAPIClient").Options} - Options
28
- * @returns {Promise<BillingPublicModel.DetailList>} - Success response
29
- * @name getStandardPlans
30
- * @summary: Get Standard/Public Plans
31
- * @description: Get Standard/Public Plans. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/public/billing/getStandardPlans/).
32
- */
33
- getStandardPlans({ platform, requestHeaders }?: BillingPublicValidator.GetStandardPlansParam, { responseHeaders }?: object): Promise<BillingPublicModel.DetailList>;
34
- /**
35
- * @param {BillingPublicValidator.GetTenureConfigParam} arg - Arg object.
36
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
37
- * @param {import("../PublicAPIClient").Options} - Options
38
- * @returns {Promise<BillingPublicModel.TenureConfigResponse>} - Success response
39
- * @name getTenureConfig
40
- * @summary: Get Tenure Configuration
41
- * @description: Retrieve the tenure configuration for a specific country. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/public/billing/getTenureConfig/).
42
- */
43
- getTenureConfig({ countryCode, requestHeaders }?: BillingPublicValidator.GetTenureConfigParam, { responseHeaders }?: object): Promise<BillingPublicModel.TenureConfigResponse>;
44
- /**
45
- * @param {BillingPublicValidator.PlanListParam} arg - Arg object.
46
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
47
- * @param {import("../PublicAPIClient").Options} - Options
48
- * @returns {Promise<BillingPublicModel.PlanList[]>} - Success response
49
- * @name planList
50
- * @summary: Get List of all plans
51
- * @description: Get List of all plans - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/public/billing/planList/).
52
- */
53
- planList({ requestHeaders }?: any, { responseHeaders }?: object): Promise<BillingPublicModel.PlanList[]>;
54
- }
55
- import BillingPublicValidator = require("./BillingPublicValidator");
56
- import BillingPublicModel = require("./BillingPublicModel");