yobi 0.1.0 → 0.3.0

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.
data/sig/yobi.rbs CHANGED
@@ -1,10 +1,20 @@
1
1
  module Yobi
2
2
  VERSION: String
3
3
 
4
+ class FancyHash < Hash[String, untyped]
5
+ def initialize: (Hash[String, untyped] raw) -> void
6
+ end
7
+
8
+ class Initialized < FancyHash
9
+ def id: () -> String
10
+
11
+ def repository: () -> String
12
+ end
13
+
4
14
  class Error < StandardError
5
15
  end
6
16
 
7
- class ExitError < SimpleDelegator
17
+ class ExitError < FancyHash
8
18
  LINE_PATTERN: Regexp
9
19
 
10
20
  def self.from_output: (ResticOutput output) -> ExitError?
@@ -79,7 +89,7 @@ module Yobi
79
89
  attr_reader io: IO
80
90
  attr_reader pid: Integer
81
91
 
82
- def initialize: (IO io, pid: Integer, output_file: File, argv: Array[String]) -> void
92
+ def initialize: (IO io, pid: Integer, output: ResticOutput, argv: Array[String]) -> void
83
93
 
84
94
  def closed?: () -> bool
85
95
 
@@ -88,10 +98,10 @@ module Yobi
88
98
  def each: () { (String chunk) -> void } -> void
89
99
  end
90
100
 
91
- class Mount
101
+ class MountHandle
92
102
  attr_reader mountpoint: String
93
103
 
94
- def initialize: (wait_thr: Process::Waiter, mountpoint: String, output: IO, output_file: File, argv: Array[String]) -> void
104
+ def initialize: (wait_thr: Process::Waiter, mountpoint: String, pipe: IO, output: ResticOutput, argv: Array[String]) -> void
95
105
 
96
106
  def pid: () -> Integer
97
107
 
@@ -103,7 +113,9 @@ module Yobi
103
113
  class ResticOutput
104
114
  DEFAULT_TAIL_CHUNK_SIZE: Integer
105
115
 
106
- def initialize: (File file, ?tail_chunk_size: Integer) -> void
116
+ attr_reader file: File
117
+
118
+ def initialize: (?tail_chunk_size: Integer, ?transform: ^(Hash[String, untyped]) -> untyped) -> void
107
119
 
108
120
  def index: () -> Hash[String, Array[Integer]]
109
121
 
@@ -114,10 +126,31 @@ module Yobi
114
126
  def each_line: () { (String line) -> void } -> void
115
127
  | () -> Enumerator[String, void]
116
128
 
117
- def to_s: () -> String
129
+ def messages: [T] (?String? message_type) { (Hash[String, untyped] message) -> T } -> ResticOutput::LazyList[T]
130
+ | (?String? message_type) -> Enumerator[Hash[String, untyped], void]
131
+
132
+ def stderr_lines: () { (String line) -> void } -> void
133
+ | () -> Enumerator[String, void]
134
+
135
+ def write_and_parse: (String line, (:stdout | :stderr) origin) -> untyped
136
+
137
+ class LazyList[Elem]
138
+ include Enumerable[Elem]
139
+
140
+ INSPECT_PREVIEW_SIZE: Integer
141
+
142
+ def initialize: (ResticOutput output, Array[Integer] offsets, ^(Hash[String, untyped]) -> Elem transform) -> void
143
+
144
+ def each: () { (Elem item) -> void } -> void
145
+ | () -> Enumerator[Elem, void]
146
+
147
+ def size: () -> Integer
148
+
149
+ alias length size
150
+ end
118
151
  end
119
152
 
120
- class Snapshot < SimpleDelegator
153
+ class Snapshot < FancyHash
121
154
  def id: () -> String
122
155
 
123
156
  def short_id: () -> String
@@ -131,11 +164,64 @@ module Yobi
131
164
  def paths: () -> Array[String]
132
165
 
133
166
  def parent_id: () -> String?
167
+
168
+ def summary: () -> SnapshotSummary
169
+ end
170
+
171
+ class SnapshotSummary < FancyHash
172
+ def backup_start: () -> Time?
173
+
174
+ def backup_end: () -> Time?
175
+
176
+ def files_new: () -> Integer
177
+
178
+ def files_changed: () -> Integer
179
+
180
+ def files_unmodified: () -> Integer
181
+
182
+ def dirs_new: () -> Integer
183
+
184
+ def dirs_changed: () -> Integer
185
+
186
+ def dirs_unmodified: () -> Integer
187
+
188
+ def data_blobs: () -> Integer
189
+
190
+ def tree_blobs: () -> Integer
191
+
192
+ def data_added: () -> Integer
193
+
194
+ def data_added_packed: () -> Integer
195
+
196
+ def total_files_processed: () -> Integer
197
+
198
+ def total_bytes_processed: () -> Integer
134
199
  end
135
200
 
136
- type password = String | [:command, String] | [:file, String] | :insecure_no_password | (^() -> String) | nil
201
+ class RepositoryStats < FancyHash
202
+ def total_size: () -> Integer
203
+
204
+ def total_file_count: () -> Integer
205
+
206
+ def total_blob_count: () -> Integer
207
+
208
+ def snapshots_count: () -> Integer
209
+
210
+ def total_uncompressed_size: () -> Integer
211
+
212
+ def compression_ratio: () -> Float
213
+
214
+ def compression_progress: () -> Float
215
+
216
+ def compression_space_saving: () -> Float
217
+ end
218
+
219
+ type password = String | [:command, String] | [:file, String] | :insecure_no_password | (^() -> String)
220
+ type from_password = password | nil
221
+ type new_password = String | [:file, String] | :insecure_no_password | (^() -> String)
137
222
  type backend_credentials = Hash[String, String] | (^() -> Hash[String, String])
138
223
  type restic_or_path = Restic | String | nil
224
+ type from_repo = String | Repository | [:file, String]
139
225
 
140
226
  class Restic
141
227
  MINIMUM_VERSION: Gem::Version
@@ -174,13 +260,11 @@ module Yobi
174
260
 
175
261
  def append_global_flags: (ArgvBuilder a) -> void
176
262
 
177
- def inspect: () -> String
178
-
179
- def version: () -> Hash[String, untyped]
263
+ def version: () -> ResticVersion
180
264
 
181
265
  def cache: (?cleanup: bool, ?max_age: String?, ?no_size: bool) -> true
182
266
 
183
- def run: (Array[String] argv, ?extra_env: Hash[String, String], ?skip_version_check: bool) ?{ (Hash[String, untyped] message) -> void } -> execution
267
+ def run: (Array[String] argv, ?extra_env: Hash[String, String], ?skip_version_check: bool, ?output: ResticOutput?) ?{ (untyped message) -> void } -> execution
184
268
 
185
269
  def self.dispatch: (execution execution) -> execution
186
270
 
@@ -189,7 +273,17 @@ module Yobi
189
273
 
190
274
  def ensure_minimum_version!: () -> void
191
275
 
192
- def run_mount: (Array[String] argv, mountpoint: String, ?extra_env: Hash[String, String], ?ready_timeout: Numeric) -> Mount
276
+ def run_mount: (Array[String] argv, mountpoint: String, ?extra_env: Hash[String, String], ?ready_timeout: Numeric) -> MountHandle
277
+ end
278
+
279
+ class ResticVersion < FancyHash
280
+ def version: () -> String
281
+
282
+ def go_version: () -> String?
283
+
284
+ def go_os: () -> String?
285
+
286
+ def go_arch: () -> String?
193
287
  end
194
288
 
195
289
  class Repository
@@ -197,17 +291,19 @@ module Yobi
197
291
  attr_reader password: password
198
292
  attr_reader backend_credentials: backend_credentials
199
293
 
200
- def initialize: (url: String, ?password: password, ?backend_credentials: backend_credentials, ?restic: restic_or_path) -> void
294
+ def initialize: (url: String, password: password, ?backend_credentials: backend_credentials, ?restic: restic_or_path) -> void
201
295
 
202
296
  def env: () -> Hash[String, String]
203
297
 
204
- def inspect: () -> String
298
+ def init: (?copy_chunker_params: bool, ?from_key_hint: String?, ?from_password: from_password,
299
+ ?from_repo: from_repo?, ?repository_version: String?) -> Initialized
300
+
301
+ def init_mirror: (url: String, password: password, ?backend_credentials: backend_credentials,
302
+ ?restic: restic_or_path, ?repository_version: String?) -> Repository
205
303
 
206
- def init: (?copy_chunker_params: bool, ?from_insecure_no_password: bool, ?from_key_hint: String?,
207
- ?from_password_command: String?, ?from_password_file: String?, ?from_repo: String?,
208
- ?from_repository_file: String?, ?repository_version: String?) -> Hash[String, untyped]
304
+ def cat_config: () -> Hash[String, untyped]
209
305
 
210
- def config: () -> Hash[String, untyped]
306
+ alias config cat_config
211
307
 
212
308
  def backup: (source: String | [:stdin_from_command, String | Array[String]] | [:stdin_from_command, String | Array[String], String],
213
309
  ?excludes: Array[String] | String, ?exclude_files: Array[String] | String,
@@ -219,7 +315,7 @@ module Yobi
219
315
  ?host: String?, ?ignore_ctime: bool, ?ignore_inode: bool, ?no_scan: bool,
220
316
  ?one_file_system: bool, ?parent: String?, ?read_concurrency: Integer?,
221
317
  ?skip_if_unchanged: bool, ?time: String?, ?verbose: bool, ?with_atime: bool)
222
- ?{ (BackupStatus | BackupError | BackupVerboseStatus message) -> void } -> BackupOutcome
318
+ ?{ (BackupStatus | BackupError | BackupVerboseStatus | BackupSummary message) -> void } -> BackupOutcome
223
319
 
224
320
  def cat_snapshot: (String | Snapshot id) -> Hash[String, untyped]
225
321
 
@@ -240,8 +336,8 @@ module Yobi
240
336
  def check: (?hosts: Array[String] | String, ?paths: Array[String] | String, ?read_data: bool,
241
337
  ?read_data_subset: String?, ?tags: Array[String] | String, ?with_cache: bool) -> CheckOutcome
242
338
 
243
- def copy: (from_repo: String | Repository, ?from_password: password, ?snapshot_ids: Array[String] | String,
244
- ?from_key_hint: String?, ?from_repository_file: String?, ?hosts: Array[String] | String,
339
+ def copy: (from_repo: from_repo, ?from_password: from_password, ?snapshot_ids: Array[String] | String,
340
+ ?from_key_hint: String?, ?hosts: Array[String] | String,
245
341
  ?paths: Array[String] | String, ?tags: Array[String] | String) -> true
246
342
 
247
343
  def diff: (from: String, to: String, ?metadata: bool) -> DiffOutcome
@@ -257,7 +353,7 @@ module Yobi
257
353
  def find: (patterns: Array[String] | String, ?blob: bool, ?pack: bool, ?tree: bool,
258
354
  ?hosts: Array[String] | String, ?human_readable: bool, ?ignore_case: bool, ?long: bool,
259
355
  ?newest: String?, ?oldest: String?, ?paths: Array[String] | String, ?reverse: bool,
260
- ?show_pack_id: bool, ?snapshot_ids: Array[String] | String, ?tags: Array[String] | String) -> FindMatches
356
+ ?show_pack_id: bool, ?snapshot_ids: Array[String] | String, ?tags: Array[String] | String) -> Array[MatchesPerSnapshot]
261
357
 
262
358
  def forget: (?keep_last: Integer?, ?keep_hourly: Integer?, ?keep_daily: Integer?, ?keep_weekly: Integer?,
263
359
  ?keep_monthly: Integer?, ?keep_yearly: Integer?, ?keep_within: String?, ?keep_within_hourly: String?,
@@ -266,19 +362,19 @@ module Yobi
266
362
  ?tags: Array[String] | String, ?paths: Array[String] | String, ?compact: bool, ?group_by: String?,
267
363
  ?dry_run: bool, ?prune: bool, ?unsafe_allow_remove_all: bool, ?max_unused: String?,
268
364
  ?max_repack_size: String?, ?repack_cacheable_only: bool, ?repack_uncompressed: bool,
269
- ?repack_smaller_than: String?) -> ForgetGroups
365
+ ?repack_smaller_than: String?) -> Array[ForgetGroup]
270
366
 
271
- def key_add: (?host: String?, ?user: String?, ?new_insecure_no_password: bool, ?new_password_file: String?) -> true
367
+ def key_add: (new_password: new_password, ?host: String?, ?user: String?) -> true
272
368
 
273
- def add_key: (?host: String?, ?user: String?, ?new_insecure_no_password: bool, ?new_password_file: String?) -> true
369
+ def add_key: (new_password: new_password, ?host: String?, ?user: String?) -> true
274
370
 
275
- def key_list: () -> Keys
371
+ def key_list: () -> Array[Key]
276
372
 
277
- def keys: () -> Keys
373
+ def keys: () -> Array[Key]
278
374
 
279
- def key_passwd: (?host: String?, ?user: String?, ?new_insecure_no_password: bool, ?new_password_file: String?) -> true
375
+ def key_passwd: (new_password: new_password, ?host: String?, ?user: String?) -> true
280
376
 
281
- def change_password: (?host: String?, ?user: String?, ?new_insecure_no_password: bool, ?new_password_file: String?) -> true
377
+ def change_password: (new_password: new_password, ?host: String?, ?user: String?) -> true
282
378
 
283
379
  def key_remove: (id: String) -> true
284
380
 
@@ -295,11 +391,11 @@ module Yobi
295
391
  def mount: (mountpoint: String, ?hosts: Array[String] | String, ?paths: Array[String] | String,
296
392
  ?tags: Array[String] | String, ?allow_other: bool, ?no_default_permissions: bool,
297
393
  ?owner_root: bool, ?path_templates: Array[String] | String, ?time_template: String?,
298
- ?ready_timeout: Numeric) { (Mount mount) -> untyped } -> untyped
394
+ ?ready_timeout: Numeric) { (MountHandle mount) -> untyped } -> untyped
299
395
  | (mountpoint: String, ?hosts: Array[String] | String, ?paths: Array[String] | String,
300
396
  ?tags: Array[String] | String, ?allow_other: bool, ?no_default_permissions: bool,
301
397
  ?owner_root: bool, ?path_templates: Array[String] | String, ?time_template: String?,
302
- ?ready_timeout: Numeric) -> Mount
398
+ ?ready_timeout: Numeric) -> MountHandle
303
399
 
304
400
  def prune: (?dry_run: bool, ?max_repack_size: String?, ?max_unused: String?,
305
401
  ?repack_cacheable_only: bool, ?repack_smaller_than: String?, ?repack_uncompressed: bool,
@@ -333,10 +429,10 @@ module Yobi
333
429
  ?new_time: String?, ?snapshot_summary: bool) -> true
334
430
 
335
431
  def snapshots: (?tags: Array[String] | String, ?hosts: Array[String] | String,
336
- ?paths: Array[String] | String, ?compact: bool, ?group_by: String?, ?latest: Integer?) -> Snapshots
432
+ ?paths: Array[String] | String, ?compact: bool, ?group_by: String?, ?latest: Integer?) -> Array[Snapshot]
337
433
 
338
434
  def stats: (?snapshot_ids: Array[String] | String, ?hosts: Array[String] | String,
339
- ?mode: String | Symbol | nil, ?paths: Array[String] | String, ?tags: Array[String] | String) -> Hash[String, untyped]
435
+ ?mode: String | Symbol | nil, ?paths: Array[String] | String, ?tags: Array[String] | String) -> RepositoryStats
340
436
 
341
437
  def tag: (?snapshot_ids: Array[String] | String, ?add: Array[String] | String,
342
438
  ?remove: Array[String] | String, ?set: Array[String] | String, ?tags: Array[String] | String,
@@ -345,24 +441,38 @@ module Yobi
345
441
  def unlock: (?remove_all: bool) -> true
346
442
  end
347
443
 
444
+ module BackupMessageWrapper
445
+ def self.call: (Hash[String, untyped] raw) -> (BackupStatus | BackupError | BackupVerboseStatus | BackupSummary | Hash[String, untyped])
446
+ end
447
+
348
448
  class BackupOutcome
349
- attr_reader exit_code: Integer
350
449
  attr_reader output: ResticOutput
351
450
 
352
451
  COMMAND_OUTPUT_LINE_PATTERN: Regexp
353
452
 
354
- def success?: () -> bool
453
+ def initialize: (execution execution) -> void
454
+
455
+ def errors: () -> ResticOutput::LazyList[BackupError]
355
456
 
356
- def partial?: () -> bool
457
+ def messages: () -> ResticOutput::LazyList[BackupStatus | BackupError | BackupVerboseStatus | BackupSummary | Hash[String, untyped]]
357
458
 
358
- def errors: () -> BackupErrors
459
+ def command_output: () { (String line) -> void } -> void
460
+ | () -> Enumerator[String, void]
359
461
 
360
- def command_output: () -> Array[String]
462
+ def summary: () -> BackupSummary
361
463
 
362
- def report: () -> Hash[String, untyped]
464
+ alias report summary
465
+
466
+ def inspect: () -> String
363
467
  end
364
468
 
365
- class BackupStatus < SimpleDelegator
469
+ class BackupSummary < FancyHash
470
+ def backup_start: () -> Time?
471
+
472
+ def backup_end: () -> Time?
473
+ end
474
+
475
+ class BackupStatus < FancyHash
366
476
  def percent_done: () -> Float?
367
477
 
368
478
  def total_files: () -> Integer?
@@ -378,7 +488,7 @@ module Yobi
378
488
  def error_count: () -> Integer
379
489
  end
380
490
 
381
- class BackupError < SimpleDelegator
491
+ class BackupError < FancyHash
382
492
  def message: () -> String?
383
493
 
384
494
  def during: () -> String?
@@ -386,16 +496,7 @@ module Yobi
386
496
  def item: () -> String?
387
497
  end
388
498
 
389
- class BackupErrors
390
- include Enumerable[BackupError]
391
-
392
- def initialize: (ResticOutput output) -> void
393
-
394
- def each: () { (BackupError error) -> void } -> void
395
- | () -> Enumerator[BackupError, void]
396
- end
397
-
398
- class BackupVerboseStatus < SimpleDelegator
499
+ class BackupVerboseStatus < FancyHash
399
500
  def action: () -> String
400
501
 
401
502
  def item: () -> String
@@ -413,53 +514,97 @@ module Yobi
413
514
  def total_files: () -> Integer
414
515
  end
415
516
 
517
+ module CheckMessageWrapper
518
+ def self.call: (Hash[String, untyped] raw) -> (CheckError | CheckSummary | Hash[String, untyped])
519
+ end
520
+
416
521
  class CheckOutcome
417
- attr_reader exit_code: Integer
418
522
  attr_reader output: ResticOutput
419
523
 
420
- def report: () -> Hash[String, untyped]
524
+ def initialize: (execution execution) -> void
525
+
526
+ def summary: () -> CheckSummary
421
527
 
422
- def errors: () -> CheckErrors
528
+ alias report summary
529
+
530
+ def errors: () -> ResticOutput::LazyList[CheckError]
423
531
  end
424
532
 
425
- class CheckError < SimpleDelegator
533
+ class CheckError < FancyHash
426
534
  def message: () -> String
427
535
  end
428
536
 
429
- class CheckErrors
430
- include Enumerable[CheckError]
537
+ class CheckSummary < FancyHash
538
+ def num_errors: () -> Integer
539
+
540
+ def broken_packs: () -> Array[String]
431
541
 
432
- def initialize: (ResticOutput output) -> void
542
+ def suggest_repair_index?: () -> bool
543
+
544
+ def suggest_prune?: () -> bool
545
+ end
433
546
 
434
- def each: () { (CheckError error) -> void } -> void
435
- | () -> Enumerator[CheckError, void]
547
+ module DiffMessageWrapper
548
+ def self.call: (Hash[String, untyped] raw) -> (DiffChange | DiffStatistics | Hash[String, untyped])
436
549
  end
437
550
 
438
551
  class DiffOutcome
439
- attr_reader exit_code: Integer
440
552
  attr_reader output: ResticOutput
441
553
 
442
- def report: () -> Hash[String, untyped]
554
+ def initialize: (execution execution) -> void
555
+
556
+ def statistics: () -> DiffStatistics
443
557
 
444
- def changes: () -> DiffChanges
558
+ alias report statistics
559
+
560
+ def changes: () -> ResticOutput::LazyList[DiffChange]
445
561
  end
446
562
 
447
- class DiffChange < SimpleDelegator
563
+ class DiffChange < FancyHash
448
564
  def path: () -> String
449
565
 
450
566
  def modifier: () -> String
567
+
568
+ def added?: () -> bool
569
+
570
+ def removed?: () -> bool
571
+
572
+ def type_changed?: () -> bool
573
+
574
+ def modified?: () -> bool
575
+
576
+ def metadata_updated?: () -> bool
577
+
578
+ def bitrot?: () -> bool
451
579
  end
452
580
 
453
- class DiffChanges
454
- include Enumerable[DiffChange]
581
+ class DiffStatistics < FancyHash
582
+ def source_snapshot: () -> String?
583
+
584
+ def target_snapshot: () -> String?
455
585
 
456
- def initialize: (ResticOutput output) -> void
586
+ def changed_files: () -> Integer
457
587
 
458
- def each: () { (DiffChange change) -> void } -> void
459
- | () -> Enumerator[DiffChange, void]
588
+ def added: () -> DiffStat
589
+
590
+ def removed: () -> DiffStat
460
591
  end
461
592
 
462
- class FindMatch < SimpleDelegator
593
+ class DiffStat < FancyHash
594
+ def files: () -> Integer
595
+
596
+ def dirs: () -> Integer
597
+
598
+ def others: () -> Integer
599
+
600
+ def data_blobs: () -> Integer
601
+
602
+ def tree_blobs: () -> Integer
603
+
604
+ def bytes: () -> Integer
605
+ end
606
+
607
+ class FindMatch < FancyHash
463
608
  def path: () -> String
464
609
 
465
610
  def type: () -> String
@@ -485,42 +630,17 @@ module Yobi
485
630
  def ctime: () -> Time
486
631
  end
487
632
 
488
- class MatchesPerSnapshot < SimpleDelegator
489
- def snapshot: () -> Hash[String, untyped]
633
+ class MatchesPerSnapshot < FancyHash
634
+ def snapshot: () -> String
635
+
636
+ alias snapshot_id snapshot
490
637
 
491
638
  def hits: () -> Integer
492
639
 
493
640
  def matches: () -> Array[FindMatch]
494
641
  end
495
642
 
496
- class FindMatches
497
- include Enumerable[MatchesPerSnapshot]
498
-
499
- attr_reader output: ResticOutput
500
-
501
- def initialize: (ResticOutput output) -> void
502
-
503
- def each: () { (MatchesPerSnapshot matches) -> void } -> void
504
- | () -> Enumerator[MatchesPerSnapshot, void]
505
- end
506
-
507
- class ForgetGroups
508
- include Enumerable[ForgetGroup]
509
-
510
- attr_reader exit_code: Integer
511
- attr_reader output: ResticOutput
512
-
513
- def initialize: (Integer exit_code, ResticOutput output) -> void
514
-
515
- def each: () { (ForgetGroup group) -> void } -> void
516
- | () -> Enumerator[ForgetGroup, void]
517
-
518
- def success?: () -> bool
519
-
520
- def partial?: () -> bool
521
- end
522
-
523
- class ForgetGroup < SimpleDelegator
643
+ class ForgetGroup < FancyHash
524
644
  def host: () -> String
525
645
 
526
646
  def tags: () -> Array[String]
@@ -531,16 +651,16 @@ module Yobi
531
651
 
532
652
  def remove: () -> Array[Snapshot]
533
653
 
534
- def reasons: () -> Array[ForgetReason]
654
+ def reasons: () -> Array[KeepReason]
535
655
  end
536
656
 
537
- class ForgetReason < SimpleDelegator
657
+ class KeepReason < FancyHash
538
658
  def snapshot: () -> Snapshot
539
659
 
540
660
  def matches: () -> Array[String]
541
661
  end
542
662
 
543
- class Key < SimpleDelegator
663
+ class Key < FancyHash
544
664
  def id: () -> String
545
665
 
546
666
  def user_name: () -> String
@@ -552,27 +672,23 @@ module Yobi
552
672
  def created: () -> Time
553
673
  end
554
674
 
555
- class Keys
556
- include Enumerable[Key]
557
-
558
- attr_reader output: ResticOutput
559
-
560
- def initialize: (ResticOutput output) -> void
561
-
562
- def each: () { (Key key) -> void } -> void
563
- | () -> Enumerator[Key, void]
675
+ module LsMessageWrapper
676
+ def self.call: (Hash[String, untyped] raw) -> (Snapshot | Node | Hash[String, untyped])
564
677
  end
565
678
 
566
679
  class LsOutcome
567
- attr_reader exit_code: Integer
568
680
  attr_reader output: ResticOutput
569
681
 
682
+ def initialize: (execution execution) -> void
683
+
570
684
  def snapshot: () -> Snapshot
571
685
 
572
- def entries: () -> LsEntries
686
+ def nodes: () -> ResticOutput::LazyList[Node]
687
+
688
+ alias entries nodes
573
689
  end
574
690
 
575
- class LsEntry < SimpleDelegator
691
+ class Node < FancyHash
576
692
  def name: () -> String
577
693
 
578
694
  def type: () -> String
@@ -596,23 +712,21 @@ module Yobi
596
712
  def ctime: () -> Time
597
713
  end
598
714
 
599
- class LsEntries
600
- include Enumerable[LsEntry]
601
-
602
- def initialize: (ResticOutput output) -> void
603
-
604
- def each: () { (LsEntry entry) -> void } -> void
605
- | () -> Enumerator[LsEntry, void]
715
+ module RestoreMessageWrapper
716
+ def self.call: (Hash[String, untyped] raw) -> (RestoreStatus | RestoreVerboseStatus | Hash[String, untyped])
606
717
  end
607
718
 
608
719
  class RestoreOutcome
609
- attr_reader exit_code: Integer
610
720
  attr_reader output: ResticOutput
611
721
 
612
- def report: () -> Hash[String, untyped]
722
+ def initialize: (execution execution) -> void
723
+
724
+ def summary: () -> Hash[String, untyped]
725
+
726
+ alias report summary
613
727
  end
614
728
 
615
- class RestoreStatus < SimpleDelegator
729
+ class RestoreStatus < FancyHash
616
730
  def percent_done: () -> Float?
617
731
 
618
732
  def total_files: () -> Integer?
@@ -624,7 +738,7 @@ module Yobi
624
738
  def bytes_restored: () -> Integer?
625
739
  end
626
740
 
627
- class RestoreVerboseStatus < SimpleDelegator
741
+ class RestoreVerboseStatus < FancyHash
628
742
  def action: () -> String
629
743
 
630
744
  def item: () -> String
@@ -632,29 +746,29 @@ module Yobi
632
746
  def size: () -> Integer
633
747
  end
634
748
 
635
- class Snapshots
636
- include Enumerable[Snapshot]
637
-
638
- attr_reader output: ResticOutput
639
-
640
- def initialize: (ResticOutput output) -> void
641
-
642
- def each: () { (Snapshot snapshot) -> void } -> void
643
- | () -> Enumerator[Snapshot, void]
749
+ module TagMessageWrapper
750
+ def self.call: (Hash[String, untyped] raw) -> (TagChange | TagSummary | Hash[String, untyped])
644
751
  end
645
752
 
646
753
  class TagOutcome
647
- attr_reader exit_code: Integer
648
754
  attr_reader output: ResticOutput
649
755
 
650
- def report: () -> Hash[String, untyped]
756
+ def initialize: (execution execution) -> void
757
+
758
+ def summary: () -> TagSummary
651
759
 
652
- def changes: () -> Array[TagChange]
760
+ alias report summary
761
+
762
+ def changes: () -> ResticOutput::LazyList[TagChange]
653
763
  end
654
764
 
655
- class TagChange < SimpleDelegator
765
+ class TagChange < FancyHash
656
766
  def old_snapshot_id: () -> String
657
767
 
658
768
  def new_snapshot_id: () -> String
659
769
  end
770
+
771
+ class TagSummary < FancyHash
772
+ def changed_snapshots: () -> Integer
773
+ end
660
774
  end