@revenexx/sdk 0.0.5 → 0.0.7

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.
@@ -554,32 +554,37 @@ export class Customers {
554
554
  /**
555
555
  *
556
556
  * @param {string} params.userId -
557
+ * @param {string} params.sessionId - Optional session to verify — answers 401 when the session is expired or revoked.
557
558
  * @throws {RevenexxException}
558
559
  * @returns {Promise<Models.AuthMeResponse>}
559
560
  */
560
- customersAuthMe(params: { userId: string }): Promise<Models.AuthMeResponse>;
561
+ customersAuthMe(params: { userId: string, sessionId?: string }): Promise<Models.AuthMeResponse>;
561
562
  /**
562
563
  *
563
564
  * @param {string} userId -
565
+ * @param {string} sessionId - Optional session to verify — answers 401 when the session is expired or revoked.
564
566
  * @throws {RevenexxException}
565
567
  * @returns {Promise<Models.AuthMeResponse>}
566
568
  * @deprecated Use the object parameter style method for a better developer experience.
567
569
  */
568
- customersAuthMe(userId: string): Promise<Models.AuthMeResponse>;
570
+ customersAuthMe(userId: string, sessionId?: string): Promise<Models.AuthMeResponse>;
569
571
  customersAuthMe(
570
- paramsOrFirst: { userId: string } | string
572
+ paramsOrFirst: { userId: string, sessionId?: string } | string,
573
+ ...rest: [(string)?]
571
574
  ): Promise<Models.AuthMeResponse> {
572
- let params: { userId: string };
575
+ let params: { userId: string, sessionId?: string };
573
576
 
574
577
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
575
- params = (paramsOrFirst || {}) as { userId: string };
578
+ params = (paramsOrFirst || {}) as { userId: string, sessionId?: string };
576
579
  } else {
577
580
  params = {
578
- userId: paramsOrFirst as string
581
+ userId: paramsOrFirst as string,
582
+ sessionId: rest[0] as string
579
583
  };
580
584
  }
581
585
 
582
586
  const userId = params.userId;
587
+ const sessionId = params.sessionId;
583
588
 
584
589
  if (typeof userId === 'undefined') {
585
590
  throw new RevenexxException('Missing required parameter: "userId"');
@@ -587,6 +592,9 @@ export class Customers {
587
592
 
588
593
  const apiPath = '/v1/customers/auth/me';
589
594
  const apiPayload: Payload = {};
595
+ if (typeof sessionId !== 'undefined') {
596
+ apiPayload['session_id'] = sessionId;
597
+ }
590
598
  if (typeof userId !== 'undefined') {
591
599
  apiPayload['user_id'] = userId;
592
600
  }
@@ -379,6 +379,323 @@ export class Markets {
379
379
  );
380
380
  }
381
381
 
382
+ /**
383
+ *
384
+ * @param {string} params.marketId -
385
+ * @throws {RevenexxException}
386
+ * @returns {Promise<{}>}
387
+ */
388
+ marketsCurrenciesList(params: { marketId: string }): Promise<{}>;
389
+ /**
390
+ *
391
+ * @param {string} marketId -
392
+ * @throws {RevenexxException}
393
+ * @returns {Promise<{}>}
394
+ * @deprecated Use the object parameter style method for a better developer experience.
395
+ */
396
+ marketsCurrenciesList(marketId: string): Promise<{}>;
397
+ marketsCurrenciesList(
398
+ paramsOrFirst: { marketId: string } | string
399
+ ): Promise<{}> {
400
+ let params: { marketId: string };
401
+
402
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
403
+ params = (paramsOrFirst || {}) as { marketId: string };
404
+ } else {
405
+ params = {
406
+ marketId: paramsOrFirst as string
407
+ };
408
+ }
409
+
410
+ const marketId = params.marketId;
411
+
412
+ if (typeof marketId === 'undefined') {
413
+ throw new RevenexxException('Missing required parameter: "marketId"');
414
+ }
415
+
416
+ const apiPath = '/v1/markets/{market_id}/currencies'.replace('{market_id}', marketId);
417
+ const apiPayload: Payload = {};
418
+ const uri = new URL(this.client.config.endpoint + apiPath);
419
+
420
+ const apiHeaders: { [header: string]: string } = {
421
+ }
422
+
423
+ return this.client.call(
424
+ 'get',
425
+ uri,
426
+ apiHeaders,
427
+ apiPayload
428
+ );
429
+ }
430
+
431
+ /**
432
+ *
433
+ * @param {string} params.marketId -
434
+ * @param {string} params.code - ISO 4217 code, e.g. EUR (unique per market).
435
+ * @param {boolean} params.isDefault -
436
+ * @param {number} params.position - Sort position (default 0).
437
+ * @throws {RevenexxException}
438
+ * @returns {Promise<Models.MarketCurrency>}
439
+ */
440
+ marketsCurrenciesCreate(params: { marketId: string, code: string, isDefault?: boolean, position?: number }): Promise<Models.MarketCurrency>;
441
+ /**
442
+ *
443
+ * @param {string} marketId -
444
+ * @param {string} code - ISO 4217 code, e.g. EUR (unique per market).
445
+ * @param {boolean} isDefault -
446
+ * @param {number} position - Sort position (default 0).
447
+ * @throws {RevenexxException}
448
+ * @returns {Promise<Models.MarketCurrency>}
449
+ * @deprecated Use the object parameter style method for a better developer experience.
450
+ */
451
+ marketsCurrenciesCreate(marketId: string, code: string, isDefault?: boolean, position?: number): Promise<Models.MarketCurrency>;
452
+ marketsCurrenciesCreate(
453
+ paramsOrFirst: { marketId: string, code: string, isDefault?: boolean, position?: number } | string,
454
+ ...rest: [(string)?, (boolean)?, (number)?]
455
+ ): Promise<Models.MarketCurrency> {
456
+ let params: { marketId: string, code: string, isDefault?: boolean, position?: number };
457
+
458
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
459
+ params = (paramsOrFirst || {}) as { marketId: string, code: string, isDefault?: boolean, position?: number };
460
+ } else {
461
+ params = {
462
+ marketId: paramsOrFirst as string,
463
+ code: rest[0] as string,
464
+ isDefault: rest[1] as boolean,
465
+ position: rest[2] as number
466
+ };
467
+ }
468
+
469
+ const marketId = params.marketId;
470
+ const code = params.code;
471
+ const isDefault = params.isDefault;
472
+ const position = params.position;
473
+
474
+ if (typeof marketId === 'undefined') {
475
+ throw new RevenexxException('Missing required parameter: "marketId"');
476
+ }
477
+ if (typeof code === 'undefined') {
478
+ throw new RevenexxException('Missing required parameter: "code"');
479
+ }
480
+
481
+ const apiPath = '/v1/markets/{market_id}/currencies'.replace('{market_id}', marketId);
482
+ const apiPayload: Payload = {};
483
+ if (typeof code !== 'undefined') {
484
+ apiPayload['code'] = code;
485
+ }
486
+ if (typeof isDefault !== 'undefined') {
487
+ apiPayload['is_default'] = isDefault;
488
+ }
489
+ if (typeof position !== 'undefined') {
490
+ apiPayload['position'] = position;
491
+ }
492
+ const uri = new URL(this.client.config.endpoint + apiPath);
493
+
494
+ const apiHeaders: { [header: string]: string } = {
495
+ 'content-type': 'application/json',
496
+ }
497
+
498
+ return this.client.call(
499
+ 'post',
500
+ uri,
501
+ apiHeaders,
502
+ apiPayload
503
+ );
504
+ }
505
+
506
+ /**
507
+ *
508
+ * @param {string} params.marketId -
509
+ * @param {string} params.id -
510
+ * @throws {RevenexxException}
511
+ * @returns {Promise<{}>}
512
+ */
513
+ marketsCurrenciesDelete(params: { marketId: string, id: string }): Promise<{}>;
514
+ /**
515
+ *
516
+ * @param {string} marketId -
517
+ * @param {string} id -
518
+ * @throws {RevenexxException}
519
+ * @returns {Promise<{}>}
520
+ * @deprecated Use the object parameter style method for a better developer experience.
521
+ */
522
+ marketsCurrenciesDelete(marketId: string, id: string): Promise<{}>;
523
+ marketsCurrenciesDelete(
524
+ paramsOrFirst: { marketId: string, id: string } | string,
525
+ ...rest: [(string)?]
526
+ ): Promise<{}> {
527
+ let params: { marketId: string, id: string };
528
+
529
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
530
+ params = (paramsOrFirst || {}) as { marketId: string, id: string };
531
+ } else {
532
+ params = {
533
+ marketId: paramsOrFirst as string,
534
+ id: rest[0] as string
535
+ };
536
+ }
537
+
538
+ const marketId = params.marketId;
539
+ const id = params.id;
540
+
541
+ if (typeof marketId === 'undefined') {
542
+ throw new RevenexxException('Missing required parameter: "marketId"');
543
+ }
544
+ if (typeof id === 'undefined') {
545
+ throw new RevenexxException('Missing required parameter: "id"');
546
+ }
547
+
548
+ const apiPath = '/v1/markets/{market_id}/currencies/{id}'.replace('{market_id}', marketId).replace('{id}', id);
549
+ const apiPayload: Payload = {};
550
+ const uri = new URL(this.client.config.endpoint + apiPath);
551
+
552
+ const apiHeaders: { [header: string]: string } = {
553
+ }
554
+
555
+ return this.client.call(
556
+ 'delete',
557
+ uri,
558
+ apiHeaders,
559
+ apiPayload
560
+ );
561
+ }
562
+
563
+ /**
564
+ *
565
+ * @param {string} params.marketId -
566
+ * @param {string} params.id -
567
+ * @throws {RevenexxException}
568
+ * @returns {Promise<Models.MarketCurrency>}
569
+ */
570
+ marketsCurrenciesGet(params: { marketId: string, id: string }): Promise<Models.MarketCurrency>;
571
+ /**
572
+ *
573
+ * @param {string} marketId -
574
+ * @param {string} id -
575
+ * @throws {RevenexxException}
576
+ * @returns {Promise<Models.MarketCurrency>}
577
+ * @deprecated Use the object parameter style method for a better developer experience.
578
+ */
579
+ marketsCurrenciesGet(marketId: string, id: string): Promise<Models.MarketCurrency>;
580
+ marketsCurrenciesGet(
581
+ paramsOrFirst: { marketId: string, id: string } | string,
582
+ ...rest: [(string)?]
583
+ ): Promise<Models.MarketCurrency> {
584
+ let params: { marketId: string, id: string };
585
+
586
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
587
+ params = (paramsOrFirst || {}) as { marketId: string, id: string };
588
+ } else {
589
+ params = {
590
+ marketId: paramsOrFirst as string,
591
+ id: rest[0] as string
592
+ };
593
+ }
594
+
595
+ const marketId = params.marketId;
596
+ const id = params.id;
597
+
598
+ if (typeof marketId === 'undefined') {
599
+ throw new RevenexxException('Missing required parameter: "marketId"');
600
+ }
601
+ if (typeof id === 'undefined') {
602
+ throw new RevenexxException('Missing required parameter: "id"');
603
+ }
604
+
605
+ const apiPath = '/v1/markets/{market_id}/currencies/{id}'.replace('{market_id}', marketId).replace('{id}', id);
606
+ const apiPayload: Payload = {};
607
+ const uri = new URL(this.client.config.endpoint + apiPath);
608
+
609
+ const apiHeaders: { [header: string]: string } = {
610
+ }
611
+
612
+ return this.client.call(
613
+ 'get',
614
+ uri,
615
+ apiHeaders,
616
+ apiPayload
617
+ );
618
+ }
619
+
620
+ /**
621
+ *
622
+ * @param {string} params.marketId -
623
+ * @param {string} params.id -
624
+ * @param {string} params.code - ISO 4217 code, e.g. EUR (unique per market).
625
+ * @param {boolean} params.isDefault -
626
+ * @param {number} params.position - Sort position (default 0).
627
+ * @throws {RevenexxException}
628
+ * @returns {Promise<Models.MarketCurrency>}
629
+ */
630
+ marketsCurrenciesUpdate(params: { marketId: string, id: string, code?: string, isDefault?: boolean, position?: number }): Promise<Models.MarketCurrency>;
631
+ /**
632
+ *
633
+ * @param {string} marketId -
634
+ * @param {string} id -
635
+ * @param {string} code - ISO 4217 code, e.g. EUR (unique per market).
636
+ * @param {boolean} isDefault -
637
+ * @param {number} position - Sort position (default 0).
638
+ * @throws {RevenexxException}
639
+ * @returns {Promise<Models.MarketCurrency>}
640
+ * @deprecated Use the object parameter style method for a better developer experience.
641
+ */
642
+ marketsCurrenciesUpdate(marketId: string, id: string, code?: string, isDefault?: boolean, position?: number): Promise<Models.MarketCurrency>;
643
+ marketsCurrenciesUpdate(
644
+ paramsOrFirst: { marketId: string, id: string, code?: string, isDefault?: boolean, position?: number } | string,
645
+ ...rest: [(string)?, (string)?, (boolean)?, (number)?]
646
+ ): Promise<Models.MarketCurrency> {
647
+ let params: { marketId: string, id: string, code?: string, isDefault?: boolean, position?: number };
648
+
649
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
650
+ params = (paramsOrFirst || {}) as { marketId: string, id: string, code?: string, isDefault?: boolean, position?: number };
651
+ } else {
652
+ params = {
653
+ marketId: paramsOrFirst as string,
654
+ id: rest[0] as string,
655
+ code: rest[1] as string,
656
+ isDefault: rest[2] as boolean,
657
+ position: rest[3] as number
658
+ };
659
+ }
660
+
661
+ const marketId = params.marketId;
662
+ const id = params.id;
663
+ const code = params.code;
664
+ const isDefault = params.isDefault;
665
+ const position = params.position;
666
+
667
+ if (typeof marketId === 'undefined') {
668
+ throw new RevenexxException('Missing required parameter: "marketId"');
669
+ }
670
+ if (typeof id === 'undefined') {
671
+ throw new RevenexxException('Missing required parameter: "id"');
672
+ }
673
+
674
+ const apiPath = '/v1/markets/{market_id}/currencies/{id}'.replace('{market_id}', marketId).replace('{id}', id);
675
+ const apiPayload: Payload = {};
676
+ if (typeof code !== 'undefined') {
677
+ apiPayload['code'] = code;
678
+ }
679
+ if (typeof isDefault !== 'undefined') {
680
+ apiPayload['is_default'] = isDefault;
681
+ }
682
+ if (typeof position !== 'undefined') {
683
+ apiPayload['position'] = position;
684
+ }
685
+ const uri = new URL(this.client.config.endpoint + apiPath);
686
+
687
+ const apiHeaders: { [header: string]: string } = {
688
+ 'content-type': 'application/json',
689
+ }
690
+
691
+ return this.client.call(
692
+ 'put',
693
+ uri,
694
+ apiHeaders,
695
+ apiPayload
696
+ );
697
+ }
698
+
382
699
  /**
383
700
  *
384
701
  * @param {string} params.marketId -