ryanlink 1.0.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 (60) hide show
  1. package/LICENSE +37 -0
  2. package/README.md +455 -0
  3. package/dist/index.d.mts +1335 -0
  4. package/dist/index.d.ts +1335 -0
  5. package/dist/index.js +4694 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/index.mjs +4604 -0
  8. package/dist/index.mjs.map +1 -0
  9. package/package.json +82 -0
  10. package/src/audio/AudioFilters.ts +316 -0
  11. package/src/audio/AudioQueue.ts +782 -0
  12. package/src/audio/AudioTrack.ts +242 -0
  13. package/src/audio/QueueController.ts +252 -0
  14. package/src/audio/TrackCollection.ts +138 -0
  15. package/src/audio/index.ts +9 -0
  16. package/src/config/defaults.ts +223 -0
  17. package/src/config/endpoints.ts +99 -0
  18. package/src/config/index.ts +9 -0
  19. package/src/config/patterns.ts +55 -0
  20. package/src/config/presets.ts +400 -0
  21. package/src/config/symbols.ts +31 -0
  22. package/src/core/PluginSystem.ts +50 -0
  23. package/src/core/RyanlinkPlayer.ts +403 -0
  24. package/src/core/index.ts +6 -0
  25. package/src/extensions/AutoplayExtension.ts +283 -0
  26. package/src/extensions/FairPlayExtension.ts +154 -0
  27. package/src/extensions/LyricsExtension.ts +187 -0
  28. package/src/extensions/PersistenceExtension.ts +182 -0
  29. package/src/extensions/SponsorBlockExtension.ts +81 -0
  30. package/src/extensions/index.ts +9 -0
  31. package/src/index.ts +19 -0
  32. package/src/lavalink/ConnectionPool.ts +326 -0
  33. package/src/lavalink/HttpClient.ts +316 -0
  34. package/src/lavalink/LavalinkConnection.ts +409 -0
  35. package/src/lavalink/index.ts +7 -0
  36. package/src/metadata.ts +88 -0
  37. package/src/types/api/Rest.ts +949 -0
  38. package/src/types/api/Websocket.ts +463 -0
  39. package/src/types/api/index.ts +6 -0
  40. package/src/types/audio/FilterManager.ts +29 -0
  41. package/src/types/audio/Queue.ts +4 -0
  42. package/src/types/audio/QueueManager.ts +30 -0
  43. package/src/types/audio/index.ts +7 -0
  44. package/src/types/common.ts +63 -0
  45. package/src/types/core/Player.ts +322 -0
  46. package/src/types/core/index.ts +5 -0
  47. package/src/types/index.ts +6 -0
  48. package/src/types/lavalink/Node.ts +173 -0
  49. package/src/types/lavalink/NodeManager.ts +34 -0
  50. package/src/types/lavalink/REST.ts +144 -0
  51. package/src/types/lavalink/index.ts +32 -0
  52. package/src/types/voice/VoiceManager.ts +176 -0
  53. package/src/types/voice/index.ts +5 -0
  54. package/src/utils/helpers.ts +169 -0
  55. package/src/utils/index.ts +6 -0
  56. package/src/utils/validators.ts +184 -0
  57. package/src/voice/RegionSelector.ts +184 -0
  58. package/src/voice/VoiceConnection.ts +451 -0
  59. package/src/voice/VoiceSession.ts +297 -0
  60. package/src/voice/index.ts +7 -0
@@ -0,0 +1,949 @@
1
+ import type {
2
+ CommonPluginFilters,
3
+ CommonPluginInfo,
4
+ CommonUserData,
5
+ EmptyObject,
6
+ JsonObject,
7
+ NonNullableProp,
8
+ } from "../../types/common";
9
+ import type { Exception, PlayerState } from "./Websocket";
10
+
11
+ /**
12
+ * Load result types
13
+ */
14
+ export const enum LoadType {
15
+ /**
16
+ * A track has been loaded
17
+ */
18
+ Track = "track",
19
+
20
+ /**
21
+ * A playlist has been loaded
22
+ */
23
+ Playlist = "playlist",
24
+
25
+ /**
26
+ * A search result has been loaded
27
+ */
28
+ Search = "search",
29
+
30
+ /**
31
+ * There has been no matches for your identifier
32
+ */
33
+ Empty = "empty",
34
+
35
+ /**
36
+ * Loading has failed with an error
37
+ */
38
+ Error = "error",
39
+ }
40
+
41
+ /**
42
+ * Route planner types
43
+ */
44
+ export const enum RoutePlannerType {
45
+ /**
46
+ * IP address used is switched on ban. Recommended for IPv4 blocks or IPv6 blocks smaller than a /64
47
+ */
48
+ Rotating = "RotatingIpRoutePlanner",
49
+
50
+ /**
51
+ * IP address used is switched on clock update. Use with at least 1 /64 IPv6 block
52
+ */
53
+ Nano = "NanoIpRoutePlanner",
54
+
55
+ /**
56
+ * IP address used is switched on clock update, rotates to a different /64 block on ban. Use with at least 2x /64 IPv6 blocks
57
+ */
58
+ RotatingNano = "RotatingNanoIpRoutePlanner",
59
+
60
+ /**
61
+ * IP address used is selected at random per request. Recommended for larger IP blocks
62
+ */
63
+ Balancing = "BalancingIpRoutePlanner",
64
+ }
65
+
66
+ /**
67
+ * IP block types
68
+ */
69
+ export const enum IPBlockType {
70
+ /**
71
+ * The ipv4 block type
72
+ */
73
+ V4 = "Inet4Address",
74
+
75
+ /**
76
+ * The ipv6 block type
77
+ */
78
+ V6 = "Inet6Address",
79
+ }
80
+
81
+ /**
82
+ * REST error response
83
+ */
84
+ export interface RestError {
85
+ /**
86
+ * The timestamp of the error in milliseconds since the Unix epoch
87
+ */
88
+ timestamp: number;
89
+
90
+ /**
91
+ * The HTTP status code
92
+ */
93
+ status: number;
94
+
95
+ /**
96
+ * The HTTP status code message
97
+ */
98
+ error: string;
99
+
100
+ /**
101
+ * The stack trace of the error when `trace=true` as query param has been sent
102
+ */
103
+ trace?: string;
104
+
105
+ /**
106
+ * The error message
107
+ */
108
+ message: string;
109
+
110
+ /**
111
+ * The request path
112
+ */
113
+ path: string;
114
+ }
115
+
116
+ /**
117
+ * API track representation
118
+ */
119
+ export interface APITrack<
120
+ UserData extends JsonObject = CommonUserData,
121
+ PluginInfo extends JsonObject = CommonPluginInfo,
122
+ > {
123
+ /**
124
+ * The base64 encoded track data
125
+ */
126
+ encoded: string;
127
+
128
+ /**
129
+ * Info about the track
130
+ */
131
+ info: TrackInfo;
132
+
133
+ /**
134
+ * Additional track info provided by plugins
135
+ */
136
+ pluginInfo: PluginInfo;
137
+
138
+ /**
139
+ * Additional track data provided via the Update Player endpoint
140
+ */
141
+ userData: UserData;
142
+ }
143
+
144
+ /**
145
+ * Track information
146
+ */
147
+ export interface TrackInfo {
148
+ /**
149
+ * The track identifier
150
+ */
151
+ identifier: string;
152
+
153
+ /**
154
+ * Whether the track is seekable
155
+ */
156
+ isSeekable: boolean;
157
+
158
+ /**
159
+ * The track author
160
+ */
161
+ author: string;
162
+
163
+ /**
164
+ * The track length in milliseconds
165
+ */
166
+ length: number;
167
+
168
+ /**
169
+ * Whether the track is a stream
170
+ */
171
+ isStream: boolean;
172
+
173
+ /**
174
+ * The track position in milliseconds
175
+ */
176
+ position: number;
177
+
178
+ /**
179
+ * The track title
180
+ */
181
+ title: string;
182
+
183
+ /**
184
+ * The track uri
185
+ */
186
+ uri: string | null;
187
+
188
+ /**
189
+ * The track artwork url
190
+ */
191
+ artworkUrl: string | null;
192
+
193
+ /**
194
+ * The track ISRC
195
+ */
196
+ isrc: string | null;
197
+
198
+ /**
199
+ * The track source name
200
+ */
201
+ sourceName: string;
202
+ }
203
+
204
+ /**
205
+ * Playlist information
206
+ */
207
+ export interface PlaylistInfo {
208
+ /**
209
+ * The name of the playlist
210
+ */
211
+ name: string;
212
+
213
+ /**
214
+ * The selected track of the playlist (`-1` if no track is selected)
215
+ */
216
+ selectedTrack: number;
217
+ }
218
+
219
+ /**
220
+ * Track load result
221
+ */
222
+ export interface TrackLoadResult {
223
+ loadType: LoadType.Track;
224
+ data: APITrack;
225
+ }
226
+
227
+ /**
228
+ * API playlist representation
229
+ */
230
+ export interface APIPlaylist<PluginInfo extends JsonObject = CommonPluginInfo> {
231
+ /**
232
+ * The info of the playlist
233
+ */
234
+ info: PlaylistInfo;
235
+
236
+ /**
237
+ * Addition playlist info provided by plugins
238
+ */
239
+ pluginInfo: PluginInfo;
240
+
241
+ /**
242
+ * The tracks of the playlist
243
+ */
244
+ tracks: APITrack[];
245
+ }
246
+
247
+ /**
248
+ * Playlist load result
249
+ */
250
+ export interface PlaylistLoadResult {
251
+ loadType: LoadType.Playlist;
252
+ data: APIPlaylist;
253
+ }
254
+
255
+ /**
256
+ * Search load result
257
+ */
258
+ export interface SearchLoadResult {
259
+ loadType: LoadType.Search;
260
+ data: APITrack[];
261
+ }
262
+
263
+ /**
264
+ * Empty load result
265
+ */
266
+ export interface EmptyLoadResult {
267
+ loadType: LoadType.Empty;
268
+ data: EmptyObject;
269
+ }
270
+
271
+ /**
272
+ * Error load result
273
+ */
274
+ export interface ErrorLoadResult {
275
+ loadType: LoadType.Error;
276
+ data: Exception;
277
+ }
278
+
279
+ /**
280
+ * Load result union type
281
+ */
282
+ export type LoadResult = TrackLoadResult | PlaylistLoadResult | SearchLoadResult | EmptyLoadResult | ErrorLoadResult;
283
+
284
+ /**
285
+ * API player representation
286
+ */
287
+ export interface APIPlayer {
288
+ /**
289
+ * The guild id of the player
290
+ */
291
+ guildId: string;
292
+
293
+ /**
294
+ * The currently playing track
295
+ */
296
+ track: APITrack | null;
297
+
298
+ /**
299
+ * The volume of the player, range 0-1000, in percentage
300
+ */
301
+ volume: number;
302
+
303
+ /**
304
+ * Whether the player is paused
305
+ */
306
+ paused: boolean;
307
+
308
+ /**
309
+ * The state of the player
310
+ */
311
+ state: PlayerState;
312
+
313
+ /**
314
+ * The voice state of the player
315
+ */
316
+ voice: APIVoiceState;
317
+
318
+ /**
319
+ * The filters used by the player
320
+ */
321
+ filters: Filters;
322
+ }
323
+
324
+ /**
325
+ * API voice state
326
+ */
327
+ export interface APIVoiceState {
328
+ /**
329
+ * The Discord voice token to authenticate with
330
+ */
331
+ token: string;
332
+
333
+ /**
334
+ * The Discord voice endpoint to connect to
335
+ */
336
+ endpoint: string;
337
+
338
+ /**
339
+ * The Discord voice session id to authenticate with
340
+ */
341
+ sessionId: string;
342
+
343
+ /**
344
+ * The Discord voice channel id the bot is connecting to
345
+ */
346
+ channelId: string | null;
347
+ }
348
+
349
+ /**
350
+ * Audio filters
351
+ */
352
+ export interface Filters<PluginFilters extends JsonObject = CommonPluginFilters> {
353
+ /**
354
+ * Adjusts the player volume from 0.0 to 5.0, where 1.0 is 100%. Values >1.0 may cause clipping
355
+ */
356
+ volume?: number;
357
+
358
+ /**
359
+ * Adjusts 15 different bands
360
+ */
361
+ equalizer?: EqualizerFilter;
362
+
363
+ /**
364
+ * Eliminates part of a band, usually targeting vocals
365
+ */
366
+ karaoke?: KaraokeFilter;
367
+
368
+ /**
369
+ * Changes the speed, pitch, and rate
370
+ */
371
+ timescale?: TimescaleFilter;
372
+
373
+ /**
374
+ * Creates a shuddering effect, where the volume quickly oscillates
375
+ */
376
+ tremolo?: TremoloFilter;
377
+
378
+ /**
379
+ * Creates a shuddering effect, where the pitch quickly oscillates
380
+ */
381
+ vibrato?: VibratoFilter;
382
+
383
+ /**
384
+ * Rotates the audio around the stereo channels/user headphones (aka Audio Panning)
385
+ */
386
+ rotation?: RotationFilter;
387
+
388
+ /**
389
+ * Distorts the audio
390
+ */
391
+ distortion?: DistortionFilter;
392
+
393
+ /**
394
+ * Mixes both channels (left and right)
395
+ */
396
+ channelMix?: ChannelMixFilter;
397
+
398
+ /**
399
+ * Filters higher frequencies
400
+ */
401
+ lowPass?: LowPassFilter;
402
+
403
+ /**
404
+ * Filter plugin configurations
405
+ */
406
+ pluginFilters?: PluginFilters;
407
+ }
408
+
409
+ /**
410
+ * Equalizer band
411
+ */
412
+ export interface EqualizerBand {
413
+ /**
414
+ * The band (0 to 14)
415
+ */
416
+ band: number;
417
+
418
+ /**
419
+ * The gain (-0.25 to 1.0)
420
+ */
421
+ gain: number;
422
+ }
423
+
424
+ /**
425
+ * Equalizer filter (array of bands)
426
+ */
427
+ export type EqualizerFilter = EqualizerBand[];
428
+
429
+ /**
430
+ * Karaoke filter
431
+ */
432
+ export interface KaraokeFilter {
433
+ /**
434
+ * The level (0 to 1.0 where 0.0 is no effect and 1.0 is full effect)
435
+ */
436
+ level?: number;
437
+
438
+ /**
439
+ * The mono level (0 to 1.0 where 0.0 is no effect and 1.0 is full effect)
440
+ */
441
+ monoLevel?: number;
442
+
443
+ /**
444
+ * The filter band (in Hz)
445
+ */
446
+ filterBand?: number;
447
+
448
+ /**
449
+ * The filter width
450
+ */
451
+ filterWidth?: number;
452
+ }
453
+
454
+ /**
455
+ * Timescale filter
456
+ */
457
+ export interface TimescaleFilter {
458
+ /**
459
+ * The playback speed 0.0 ≤ x
460
+ */
461
+ speed?: number;
462
+
463
+ /**
464
+ * The pitch 0.0 ≤ x
465
+ */
466
+ pitch?: number;
467
+
468
+ /**
469
+ * The rate 0.0 ≤ x
470
+ */
471
+ rate?: number;
472
+ }
473
+
474
+ /**
475
+ * Tremolo filter
476
+ */
477
+ export interface TremoloFilter {
478
+ /**
479
+ * The frequency 0.0 < x
480
+ */
481
+ frequency?: number;
482
+
483
+ /**
484
+ * The tremolo depth 0.0 < x ≤ 1.0
485
+ */
486
+ depth?: number;
487
+ }
488
+
489
+ /**
490
+ * Vibrato filter
491
+ */
492
+ export interface VibratoFilter {
493
+ /**
494
+ * The frequency 0.0 < x ≤ 14.0
495
+ */
496
+ frequency?: number;
497
+
498
+ /**
499
+ * The vibrato depth 0.0 < x ≤ 1.0
500
+ */
501
+ depth?: number;
502
+ }
503
+
504
+ /**
505
+ * Rotation filter
506
+ */
507
+ export interface RotationFilter {
508
+ /**
509
+ * The frequency of the audio rotating around the listener in Hz. 0.2 is similar to the example video above
510
+ */
511
+ rotationHz?: number;
512
+ }
513
+
514
+ /**
515
+ * Distortion filter
516
+ */
517
+ export interface DistortionFilter {
518
+ /**
519
+ * The sin offset
520
+ */
521
+ sinOffset?: number;
522
+
523
+ /**
524
+ * The sin scale
525
+ */
526
+ sinScale?: number;
527
+
528
+ /**
529
+ * The cos offset
530
+ */
531
+ cosOffset?: number;
532
+
533
+ /**
534
+ * The cos scale
535
+ */
536
+ cosScale?: number;
537
+
538
+ /**
539
+ * The tan offset
540
+ */
541
+ tanOffset?: number;
542
+
543
+ /**
544
+ * The tan scale
545
+ */
546
+ tanScale?: number;
547
+
548
+ /**
549
+ * The offset
550
+ */
551
+ offset?: number;
552
+
553
+ /**
554
+ * The scale
555
+ */
556
+ scale?: number;
557
+ }
558
+
559
+ /**
560
+ * Channel mix filter
561
+ */
562
+ export interface ChannelMixFilter {
563
+ /**
564
+ * The left to left channel mix factor (0.0 ≤ x ≤ 1.0)
565
+ */
566
+ leftToLeft?: number;
567
+
568
+ /**
569
+ * The left to right channel mix factor (0.0 ≤ x ≤ 1.0)
570
+ */
571
+ leftToRight?: number;
572
+
573
+ /**
574
+ * The right to left channel mix factor (0.0 ≤ x ≤ 1.0)
575
+ */
576
+ rightToLeft?: number;
577
+
578
+ /**
579
+ * The right to right channel mix factor (0.0 ≤ x ≤ 1.0)
580
+ */
581
+ rightToRight?: number;
582
+ }
583
+
584
+ /**
585
+ * Low pass filter
586
+ */
587
+ export interface LowPassFilter {
588
+ /**
589
+ * The smoothing factor (1.0 < x)
590
+ */
591
+ smoothing?: number;
592
+ }
593
+
594
+ /**
595
+ * Player update query parameters
596
+ */
597
+ export interface PlayerUpdateQueryParams {
598
+ /**
599
+ * Whether to replace the current track with the new track. Defaults to `false`
600
+ */
601
+ noReplace?: boolean;
602
+ }
603
+
604
+ /**
605
+ * Player update request body
606
+ */
607
+ export interface PlayerUpdateRequestBody {
608
+ /**
609
+ * Specification for a new track to load, as well as user data to set
610
+ */
611
+ track?: PlayerUpdateTrackData;
612
+
613
+ /**
614
+ * The track position in milliseconds
615
+ */
616
+ position?: number;
617
+
618
+ /**
619
+ * The track end time in milliseconds (must be > 0). `null` resets this if it was set previously
620
+ */
621
+ endTime?: number | null;
622
+
623
+ /**
624
+ * The player volume, in percentage, from 0 to 1000
625
+ */
626
+ volume?: number;
627
+
628
+ /**
629
+ * Whether the player is paused
630
+ */
631
+ paused?: boolean;
632
+
633
+ /**
634
+ * The new filters to apply. This will override all previously applied filters
635
+ */
636
+ filters?: Filters;
637
+
638
+ /**
639
+ * Information required for connecting to Discord
640
+ */
641
+ voice?: NonNullableProp<APIVoiceState, "channelId">;
642
+ }
643
+
644
+ /**
645
+ * Player update track data
646
+ */
647
+ export interface PlayerUpdateTrackData<UserData extends JsonObject = CommonUserData> {
648
+ /**
649
+ * The base64 encoded track to play. `null` stops the current track.
650
+ * `encoded` and `identifier` are mutually exclusive.
651
+ */
652
+ encoded?: string | null;
653
+
654
+ /**
655
+ * The identifier of the track to play.
656
+ * `encoded` and `identifier` are mutually exclusive.
657
+ */
658
+ identifier?: string;
659
+
660
+ /**
661
+ * Additional track data to be sent back in the Track Object
662
+ */
663
+ userData?: UserData;
664
+ }
665
+
666
+ /**
667
+ * Session update request body
668
+ */
669
+ export interface SessionUpdateRequestBody {
670
+ /**
671
+ * Whether resuming is enabled for this session or not
672
+ */
673
+ resuming?: boolean;
674
+
675
+ /**
676
+ * The timeout in seconds (default is 60s)
677
+ */
678
+ timeout?: number;
679
+ }
680
+
681
+ /**
682
+ * Session update response body
683
+ */
684
+ export type SessionUpdateResponseBody = Required<SessionUpdateRequestBody>;
685
+
686
+ /**
687
+ * Lavalink info response
688
+ */
689
+ export interface LavalinkInfo {
690
+ /**
691
+ * The version of this Lavalink server
692
+ */
693
+ version: LavalinkVersion;
694
+
695
+ /**
696
+ * The millisecond unix timestamp when this Lavalink jar was built
697
+ */
698
+ buildTime: number;
699
+
700
+ /**
701
+ * The git information of this Lavalink server
702
+ */
703
+ git: LavalinkGit;
704
+
705
+ /**
706
+ * The JVM version this Lavalink server runs on
707
+ */
708
+ jvm: string;
709
+
710
+ /**
711
+ * The Lavaplayer version being used by this server
712
+ */
713
+ lavaplayer: string;
714
+
715
+ /**
716
+ * The enabled source managers for this server
717
+ */
718
+ sourceManagers: string[];
719
+
720
+ /**
721
+ * The enabled filters for this server
722
+ */
723
+ filters: string[];
724
+
725
+ /**
726
+ * The enabled plugins for this server
727
+ */
728
+ plugins: LavalinkPlugin[];
729
+ }
730
+
731
+ /**
732
+ * Lavalink version information
733
+ */
734
+ export interface LavalinkVersion {
735
+ /**
736
+ * The full version string of this Lavalink server
737
+ */
738
+ semver: string;
739
+
740
+ /**
741
+ * The major version of this Lavalink server
742
+ */
743
+ major: number;
744
+
745
+ /**
746
+ * The minor version of this Lavalink server
747
+ */
748
+ minor: number;
749
+
750
+ /**
751
+ * The patch version of this Lavalink server
752
+ */
753
+ patch: number;
754
+
755
+ /**
756
+ * The pre-release version according to semver as a `.` separated list of identifiers
757
+ */
758
+ preRelease: string | null;
759
+
760
+ /**
761
+ * The build metadata according to semver as a `.` separated list of identifiers
762
+ */
763
+ build: string | null;
764
+ }
765
+
766
+ /**
767
+ * Lavalink git information
768
+ */
769
+ export interface LavalinkGit {
770
+ /**
771
+ * The branch this Lavalink server was built on
772
+ */
773
+ branch: string;
774
+
775
+ /**
776
+ * The commit this Lavalink server was built on
777
+ */
778
+ commit: string;
779
+
780
+ /**
781
+ * The millisecond unix timestamp for when the commit was created
782
+ */
783
+ commitTime: number;
784
+ }
785
+
786
+ /**
787
+ * Lavalink plugin information
788
+ */
789
+ export interface LavalinkPlugin {
790
+ /**
791
+ * The name of the plugin
792
+ */
793
+ name: string;
794
+
795
+ /**
796
+ * The version of the plugin
797
+ */
798
+ version: string;
799
+ }
800
+
801
+ /**
802
+ * IP block information
803
+ */
804
+ export interface IPBlock {
805
+ /**
806
+ * The type of the ip block
807
+ */
808
+ type: IPBlockType;
809
+
810
+ /**
811
+ * The size of the ip block
812
+ */
813
+ size: string;
814
+ }
815
+
816
+ /**
817
+ * Failing address information
818
+ */
819
+ export interface FailingAddress {
820
+ /**
821
+ * The failing address
822
+ */
823
+ failingAddress: string;
824
+
825
+ /**
826
+ * The timestamp when the address failed
827
+ */
828
+ failingTimestamp: number;
829
+
830
+ /**
831
+ * The timestamp when the address failed as a pretty string
832
+ */
833
+ failingTime: string;
834
+ }
835
+
836
+ /**
837
+ * Base route planner details
838
+ */
839
+ export interface BaseRoutePlannerDetails {
840
+ /**
841
+ * The ip block being used
842
+ */
843
+ ipBlock: IPBlock;
844
+
845
+ /**
846
+ * The failing addresses
847
+ */
848
+ failingAddresses: FailingAddress[];
849
+ }
850
+
851
+ /**
852
+ * Rotating route planner details
853
+ */
854
+ export interface RotatingRoutePlannerDetails extends BaseRoutePlannerDetails {
855
+ /**
856
+ * The number of rotations
857
+ */
858
+ rotateIndex: string;
859
+
860
+ /**
861
+ * The current offset in the block
862
+ */
863
+ ipIndex: string;
864
+
865
+ /**
866
+ * The current address being used
867
+ */
868
+ currentAddress: string;
869
+ }
870
+
871
+ /**
872
+ * Nano route planner details
873
+ */
874
+ export interface NanoRoutePlannerDetails extends BaseRoutePlannerDetails {
875
+ /**
876
+ * The current offset in the ip block
877
+ */
878
+ currentAddressIndex: string;
879
+ }
880
+
881
+ /**
882
+ * Rotating nano route planner details
883
+ */
884
+ export interface RotatingNanoRoutePlannerDetails extends BaseRoutePlannerDetails {
885
+ /**
886
+ * The current offset in the ip block
887
+ */
888
+ currentAddressIndex: string;
889
+
890
+ /**
891
+ * The information in which /64 block ips are chosen. This number increases on each ban.
892
+ */
893
+ blockIndex: string;
894
+ }
895
+
896
+ /**
897
+ * Balancing route planner details
898
+ */
899
+ export interface BalancingRoutePlannerDetails extends BaseRoutePlannerDetails {}
900
+
901
+ /**
902
+ * Rotating route planner status
903
+ */
904
+ export interface RotatingRoutePlannerStatus {
905
+ class: RoutePlannerType.Rotating;
906
+ details: RotatingRoutePlannerDetails;
907
+ }
908
+
909
+ /**
910
+ * Nano route planner status
911
+ */
912
+ export interface NanoRoutePlannerStatus {
913
+ class: RoutePlannerType.Nano;
914
+ details: NanoRoutePlannerDetails;
915
+ }
916
+
917
+ /**
918
+ * Rotating nano route planner status
919
+ */
920
+ export interface RotatingNanoRoutePlannerStatus {
921
+ class: RoutePlannerType.RotatingNano;
922
+ details: RotatingNanoRoutePlannerDetails;
923
+ }
924
+
925
+ /**
926
+ * Balancing route planner status
927
+ */
928
+ export interface BalancingRoutePlannerStatus {
929
+ class: RoutePlannerType.Balancing;
930
+ details: BalancingRoutePlannerDetails;
931
+ }
932
+
933
+ /**
934
+ * Nullish route planner status
935
+ */
936
+ export interface NullishRoutePlannerStatus {
937
+ class: null;
938
+ details: null;
939
+ }
940
+
941
+ /**
942
+ * Route planner status union type
943
+ */
944
+ export type RoutePlannerStatus =
945
+ | RotatingRoutePlannerStatus
946
+ | NanoRoutePlannerStatus
947
+ | RotatingNanoRoutePlannerStatus
948
+ | BalancingRoutePlannerStatus
949
+ | NullishRoutePlannerStatus;