terminal-shop 1.0.0 → 1.2.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.
- checksums.yaml +4 -4
- data/README.md +27 -19
- data/lib/terminal-shop/base_client.rb +2 -0
- data/lib/terminal-shop/base_model.rb +471 -440
- data/lib/terminal-shop/base_page.rb +20 -0
- data/lib/terminal-shop/models/cart.rb +35 -2
- data/lib/terminal-shop/models/cart_convert_params.rb +11 -1
- data/lib/terminal-shop/models/cart_redeem_gift_card_params.rb +24 -0
- data/lib/terminal-shop/models/cart_redeem_gift_card_response.rb +48 -0
- data/lib/terminal-shop/models/cart_remove_gift_card_params.rb +18 -0
- data/lib/terminal-shop/models/cart_remove_gift_card_response.rb +19 -0
- data/lib/terminal-shop/models/product.rb +11 -6
- data/lib/terminal-shop/pooled_net_requester.rb +23 -10
- data/lib/terminal-shop/resources/cart.rb +43 -1
- data/lib/terminal-shop/util.rb +146 -52
- data/lib/terminal-shop/version.rb +1 -1
- data/lib/terminal-shop.rb +4 -0
- data/rbi/lib/terminal-shop/base_client.rbi +23 -21
- data/rbi/lib/terminal-shop/base_model.rbi +235 -217
- data/rbi/lib/terminal-shop/client.rbi +2 -2
- data/rbi/lib/terminal-shop/errors.rbi +8 -8
- data/rbi/lib/terminal-shop/models/address.rbi +2 -2
- data/rbi/lib/terminal-shop/models/address_create_params.rbi +3 -13
- data/rbi/lib/terminal-shop/models/address_create_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/address_delete_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/address_delete_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/address_get_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/address_get_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/address_list_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/address_list_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/app.rbi +2 -2
- data/rbi/lib/terminal-shop/models/app_create_params.rbi +2 -2
- data/rbi/lib/terminal-shop/models/app_create_response.rbi +4 -4
- data/rbi/lib/terminal-shop/models/app_delete_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/app_delete_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/app_get_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/app_get_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/app_list_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/app_list_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/card.rbi +4 -4
- data/rbi/lib/terminal-shop/models/card_collect_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/card_collect_response.rbi +4 -4
- data/rbi/lib/terminal-shop/models/card_create_params.rbi +2 -2
- data/rbi/lib/terminal-shop/models/card_create_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/card_delete_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/card_delete_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/card_get_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/card_get_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/card_list_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/card_list_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/cart.rbi +45 -9
- data/rbi/lib/terminal-shop/models/cart_convert_params.rbi +17 -3
- data/rbi/lib/terminal-shop/models/cart_convert_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/cart_get_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/cart_get_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/cart_redeem_gift_card_params.rbi +32 -0
- data/rbi/lib/terminal-shop/models/cart_redeem_gift_card_response.rbi +66 -0
- data/rbi/lib/terminal-shop/models/cart_remove_gift_card_params.rbi +21 -0
- data/rbi/lib/terminal-shop/models/cart_remove_gift_card_response.rbi +23 -0
- data/rbi/lib/terminal-shop/models/cart_set_address_params.rbi +2 -2
- data/rbi/lib/terminal-shop/models/cart_set_address_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/cart_set_card_params.rbi +2 -2
- data/rbi/lib/terminal-shop/models/cart_set_card_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/cart_set_item_params.rbi +2 -2
- data/rbi/lib/terminal-shop/models/cart_set_item_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/email_create_params.rbi +2 -2
- data/rbi/lib/terminal-shop/models/email_create_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/order.rbi +10 -10
- data/rbi/lib/terminal-shop/models/order_create_params.rbi +2 -2
- data/rbi/lib/terminal-shop/models/order_create_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/order_get_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/order_get_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/order_list_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/order_list_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/product.rbi +29 -14
- data/rbi/lib/terminal-shop/models/product_get_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/product_get_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/product_list_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/product_list_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/product_variant.rbi +2 -2
- data/rbi/lib/terminal-shop/models/profile.rbi +4 -4
- data/rbi/lib/terminal-shop/models/profile_me_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/profile_me_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/profile_update_params.rbi +2 -2
- data/rbi/lib/terminal-shop/models/profile_update_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/subscription.rbi +15 -13
- data/rbi/lib/terminal-shop/models/subscription_create_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/subscription_create_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/subscription_delete_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/subscription_delete_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/subscription_get_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/subscription_get_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/subscription_list_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/subscription_list_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/token.rbi +2 -2
- data/rbi/lib/terminal-shop/models/token_create_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/token_create_response.rbi +4 -4
- data/rbi/lib/terminal-shop/models/token_delete_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/token_delete_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/token_get_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/token_get_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/token_list_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/token_list_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/view_init_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/view_init_response.rbi +5 -15
- data/rbi/lib/terminal-shop/pooled_net_requester.rbi +15 -10
- data/rbi/lib/terminal-shop/request_options.rbi +4 -0
- data/rbi/lib/terminal-shop/resources/address.rbi +2 -2
- data/rbi/lib/terminal-shop/resources/app.rbi +2 -2
- data/rbi/lib/terminal-shop/resources/card.rbi +2 -2
- data/rbi/lib/terminal-shop/resources/cart.rbi +24 -4
- data/rbi/lib/terminal-shop/resources/email.rbi +2 -2
- data/rbi/lib/terminal-shop/resources/order.rbi +2 -2
- data/rbi/lib/terminal-shop/resources/product.rbi +2 -2
- data/rbi/lib/terminal-shop/resources/profile.rbi +2 -2
- data/rbi/lib/terminal-shop/resources/subscription.rbi +2 -2
- data/rbi/lib/terminal-shop/resources/token.rbi +2 -2
- data/rbi/lib/terminal-shop/resources/view.rbi +2 -2
- data/rbi/lib/terminal-shop/util.rbi +181 -126
- data/rbi/lib/terminal-shop/version.rbi +1 -1
- data/sig/terminal-shop/models/cart.rbs +27 -2
- data/sig/terminal-shop/models/cart_convert_params.rbs +10 -2
- data/sig/terminal-shop/models/cart_redeem_gift_card_params.rbs +25 -0
- data/sig/terminal-shop/models/cart_redeem_gift_card_response.rbs +47 -0
- data/sig/terminal-shop/models/cart_remove_gift_card_params.rbs +19 -0
- data/sig/terminal-shop/models/cart_remove_gift_card_response.rbs +18 -0
- data/sig/terminal-shop/models/product.rbs +8 -2
- data/sig/terminal-shop/pooled_net_requester.rbs +4 -2
- data/sig/terminal-shop/request_options.rbs +4 -0
- data/sig/terminal-shop/resources/cart.rbs +20 -0
- data/sig/terminal-shop/util.rbs +27 -2
- data/sig/terminal-shop/version.rbs +1 -1
- metadata +14 -2
data/lib/terminal-shop/util.rb
CHANGED
@@ -399,41 +399,152 @@ module TerminalShop
|
|
399
399
|
end
|
400
400
|
end
|
401
401
|
|
402
|
+
# @private
|
403
|
+
#
|
404
|
+
# An adapter that satisfies the IO interface required by `::IO.copy_stream`
|
405
|
+
class ReadIOAdapter
|
406
|
+
# @private
|
407
|
+
#
|
408
|
+
# @param max_len [Integer, nil]
|
409
|
+
#
|
410
|
+
# @return [String]
|
411
|
+
#
|
412
|
+
private def read_enum(max_len)
|
413
|
+
case max_len
|
414
|
+
in nil
|
415
|
+
@stream.to_a.join
|
416
|
+
in Integer
|
417
|
+
@buf << @stream.next while @buf.length < max_len
|
418
|
+
@buf.slice!(..max_len)
|
419
|
+
end
|
420
|
+
rescue StopIteration
|
421
|
+
@stream = nil
|
422
|
+
@buf.slice!(0..)
|
423
|
+
end
|
424
|
+
|
425
|
+
# @private
|
426
|
+
#
|
427
|
+
# @param max_len [Integer, nil]
|
428
|
+
# @param out_string [String, nil]
|
429
|
+
#
|
430
|
+
# @return [String, nil]
|
431
|
+
#
|
432
|
+
def read(max_len = nil, out_string = nil)
|
433
|
+
case @stream
|
434
|
+
in nil
|
435
|
+
nil
|
436
|
+
in IO | StringIO
|
437
|
+
@stream.read(max_len, out_string)
|
438
|
+
in Enumerator
|
439
|
+
read = read_enum(max_len)
|
440
|
+
case out_string
|
441
|
+
in String
|
442
|
+
out_string.replace(read)
|
443
|
+
in nil
|
444
|
+
read
|
445
|
+
end
|
446
|
+
end
|
447
|
+
.tap(&@blk)
|
448
|
+
end
|
449
|
+
|
450
|
+
# @private
|
451
|
+
#
|
452
|
+
# @param stream [String, IO, StringIO, Enumerable]
|
453
|
+
# @param blk [Proc]
|
454
|
+
#
|
455
|
+
def initialize(stream, &blk)
|
456
|
+
@stream = stream.is_a?(String) ? StringIO.new(stream) : stream
|
457
|
+
@buf = String.new.b
|
458
|
+
@blk = blk
|
459
|
+
end
|
460
|
+
end
|
461
|
+
|
462
|
+
class << self
|
463
|
+
# @param blk [Proc]
|
464
|
+
#
|
465
|
+
# @return [Enumerable]
|
466
|
+
#
|
467
|
+
def string_io(&blk)
|
468
|
+
Enumerator.new do |y|
|
469
|
+
y.define_singleton_method(:write) do
|
470
|
+
self << _1.clone
|
471
|
+
_1.bytesize
|
472
|
+
end
|
473
|
+
|
474
|
+
blk.call(y)
|
475
|
+
end
|
476
|
+
end
|
477
|
+
end
|
478
|
+
|
402
479
|
class << self
|
403
480
|
# @private
|
404
481
|
#
|
405
|
-
# @param
|
482
|
+
# @param y [Enumerator::Yielder]
|
406
483
|
# @param boundary [String]
|
407
484
|
# @param key [Symbol, String]
|
408
485
|
# @param val [Object]
|
409
486
|
#
|
410
|
-
private def encode_multipart_formdata(
|
411
|
-
|
412
|
-
|
487
|
+
private def encode_multipart_formdata(y, boundary:, key:, val:)
|
488
|
+
y << "--#{boundary}\r\n"
|
489
|
+
y << "Content-Disposition: form-data"
|
413
490
|
unless key.nil?
|
414
491
|
name = ERB::Util.url_encode(key.to_s)
|
415
|
-
|
492
|
+
y << "; name=\"#{name}\""
|
416
493
|
end
|
417
494
|
if val.is_a?(IO)
|
418
495
|
filename = ERB::Util.url_encode(File.basename(val.to_path))
|
419
|
-
|
496
|
+
y << "; filename=\"#{filename}\""
|
420
497
|
end
|
421
|
-
|
498
|
+
y << "\r\n"
|
422
499
|
case val
|
423
|
-
in IO
|
424
|
-
|
425
|
-
IO.copy_stream(val,
|
500
|
+
in IO
|
501
|
+
y << "Content-Type: application/octet-stream\r\n\r\n"
|
502
|
+
IO.copy_stream(val, y)
|
503
|
+
in StringIO
|
504
|
+
y << "Content-Type: application/octet-stream\r\n\r\n"
|
505
|
+
y << val.string
|
426
506
|
in String
|
427
|
-
|
428
|
-
|
507
|
+
y << "Content-Type: application/octet-stream\r\n\r\n"
|
508
|
+
y << val.to_s
|
429
509
|
in true | false | Integer | Float | Symbol
|
430
|
-
|
431
|
-
|
510
|
+
y << "Content-Type: text/plain\r\n\r\n"
|
511
|
+
y << val.to_s
|
432
512
|
else
|
433
|
-
|
434
|
-
|
513
|
+
y << "Content-Type: application/json\r\n\r\n"
|
514
|
+
y << JSON.fast_generate(val)
|
515
|
+
end
|
516
|
+
y << "\r\n"
|
517
|
+
end
|
518
|
+
|
519
|
+
# @private
|
520
|
+
#
|
521
|
+
# @param body [Object]
|
522
|
+
#
|
523
|
+
# @return [Array(String, Enumerable)]
|
524
|
+
#
|
525
|
+
private def encode_multipart_streaming(body)
|
526
|
+
boundary = SecureRandom.urlsafe_base64(60)
|
527
|
+
|
528
|
+
strio = string_io do |y|
|
529
|
+
case body
|
530
|
+
in Hash
|
531
|
+
body.each do |key, val|
|
532
|
+
case val
|
533
|
+
in Array if val.all? { primitive?(_1) }
|
534
|
+
val.each do |v|
|
535
|
+
encode_multipart_formdata(y, boundary: boundary, key: key, val: v)
|
536
|
+
end
|
537
|
+
else
|
538
|
+
encode_multipart_formdata(y, boundary: boundary, key: key, val: val)
|
539
|
+
end
|
540
|
+
end
|
541
|
+
else
|
542
|
+
encode_multipart_formdata(y, boundary: boundary, key: nil, val: body)
|
543
|
+
end
|
544
|
+
y << "--#{boundary}--\r\n"
|
435
545
|
end
|
436
|
-
|
546
|
+
|
547
|
+
[boundary, strio]
|
437
548
|
end
|
438
549
|
|
439
550
|
# @private
|
@@ -449,37 +560,11 @@ module TerminalShop
|
|
449
560
|
in ["application/json", Hash | Array]
|
450
561
|
[headers, JSON.fast_generate(body)]
|
451
562
|
in [%r{^multipart/form-data}, Hash | IO | StringIO]
|
452
|
-
boundary =
|
453
|
-
|
454
|
-
case body
|
455
|
-
in Hash
|
456
|
-
body.each do |key, val|
|
457
|
-
case val
|
458
|
-
in Array if val.all? { primitive?(_1) }
|
459
|
-
val.each do |v|
|
460
|
-
encode_multipart_formdata(io, boundary: boundary, key: key, val: v)
|
461
|
-
end
|
462
|
-
else
|
463
|
-
encode_multipart_formdata(io, boundary: boundary, key: key, val: val)
|
464
|
-
end
|
465
|
-
end
|
466
|
-
else
|
467
|
-
encode_multipart_formdata(io, boundary: boundary, key: nil, val: body)
|
468
|
-
end
|
469
|
-
io << "--#{boundary}--\r\n"
|
470
|
-
io.rewind
|
471
|
-
end
|
472
|
-
headers = {
|
473
|
-
**headers,
|
474
|
-
"content-type" => "#{content_type}; boundary=#{boundary}",
|
475
|
-
"transfer-encoding" => "chunked"
|
476
|
-
}
|
563
|
+
boundary, strio = encode_multipart_streaming(body)
|
564
|
+
headers = {**headers, "content-type" => "#{content_type}; boundary=#{boundary}"}
|
477
565
|
[headers, strio]
|
478
566
|
in [_, StringIO]
|
479
567
|
[headers, body.string]
|
480
|
-
in [_, IO]
|
481
|
-
headers = {**headers, "transfer-encoding" => "chunked"}
|
482
|
-
[headers, body]
|
483
568
|
else
|
484
569
|
[headers, body]
|
485
570
|
end
|
@@ -505,10 +590,10 @@ module TerminalShop
|
|
505
590
|
json
|
506
591
|
end
|
507
592
|
in %r{^text/event-stream}
|
508
|
-
lines =
|
509
|
-
|
593
|
+
lines = decode_lines(stream)
|
594
|
+
decode_sse(lines)
|
510
595
|
in %r{^application/(?:x-)?jsonl}
|
511
|
-
|
596
|
+
decode_lines(stream)
|
512
597
|
in %r{^text/}
|
513
598
|
stream.to_a.join
|
514
599
|
else
|
@@ -524,17 +609,22 @@ module TerminalShop
|
|
524
609
|
# https://doc.rust-lang.org/std/iter/trait.FusedIterator.html
|
525
610
|
#
|
526
611
|
# @param enum [Enumerable]
|
612
|
+
# @param external [Boolean]
|
527
613
|
# @param close [Proc]
|
528
614
|
#
|
529
615
|
# @return [Enumerable]
|
530
616
|
#
|
531
|
-
def fused_enum(enum, &close)
|
617
|
+
def fused_enum(enum, external: false, &close)
|
532
618
|
fused = false
|
533
619
|
iter = Enumerator.new do |y|
|
534
620
|
next if fused
|
535
621
|
|
536
622
|
fused = true
|
537
|
-
|
623
|
+
if external
|
624
|
+
loop { y << enum.next }
|
625
|
+
else
|
626
|
+
enum.each(&y)
|
627
|
+
end
|
538
628
|
ensure
|
539
629
|
close&.call
|
540
630
|
close = nil
|
@@ -584,8 +674,9 @@ module TerminalShop
|
|
584
674
|
|
585
675
|
chain_fused(enum) do |y|
|
586
676
|
enum.each do |row|
|
677
|
+
offset = buffer.bytesize
|
587
678
|
buffer << row
|
588
|
-
while (match = re.match(buffer, cr_seen
|
679
|
+
while (match = re.match(buffer, cr_seen&.to_i || offset))
|
589
680
|
case [match.captures.first, cr_seen]
|
590
681
|
in ["\r", nil]
|
591
682
|
cr_seen = match.end(1)
|
@@ -595,6 +686,7 @@ module TerminalShop
|
|
595
686
|
else
|
596
687
|
y << buffer.slice!(..(match.end(1).pred))
|
597
688
|
end
|
689
|
+
offset = 0
|
598
690
|
cr_seen = nil
|
599
691
|
end
|
600
692
|
end
|
@@ -613,6 +705,7 @@ module TerminalShop
|
|
613
705
|
# @return [Hash{Symbol=>Object}]
|
614
706
|
#
|
615
707
|
def decode_sse(lines)
|
708
|
+
# rubocop:disable Metrics/BlockLength
|
616
709
|
chain_fused(lines) do |y|
|
617
710
|
blank = {event: nil, data: nil, id: nil, retry: nil}
|
618
711
|
current = {}
|
@@ -631,7 +724,7 @@ module TerminalShop
|
|
631
724
|
in "event"
|
632
725
|
current.merge!(event: value)
|
633
726
|
in "data"
|
634
|
-
(current[:data] ||= String.new.b) << value << "\n"
|
727
|
+
(current[:data] ||= String.new.b) << (value << "\n")
|
635
728
|
in "id" unless value.include?("\0")
|
636
729
|
current.merge!(id: value)
|
637
730
|
in "retry" if /^\d+$/ =~ value
|
@@ -641,6 +734,7 @@ module TerminalShop
|
|
641
734
|
else
|
642
735
|
end
|
643
736
|
end
|
737
|
+
# rubocop:enable Metrics/BlockLength
|
644
738
|
|
645
739
|
y << {**blank, **current} unless current.empty?
|
646
740
|
end
|
data/lib/terminal-shop.rb
CHANGED
@@ -63,6 +63,10 @@ require_relative "terminal-shop/models/cart_convert_params"
|
|
63
63
|
require_relative "terminal-shop/models/cart_convert_response"
|
64
64
|
require_relative "terminal-shop/models/cart_get_params"
|
65
65
|
require_relative "terminal-shop/models/cart_get_response"
|
66
|
+
require_relative "terminal-shop/models/cart_redeem_gift_card_params"
|
67
|
+
require_relative "terminal-shop/models/cart_redeem_gift_card_response"
|
68
|
+
require_relative "terminal-shop/models/cart_remove_gift_card_params"
|
69
|
+
require_relative "terminal-shop/models/cart_remove_gift_card_response"
|
66
70
|
require_relative "terminal-shop/models/cart_set_address_params"
|
67
71
|
require_relative "terminal-shop/models/cart_set_address_response"
|
68
72
|
require_relative "terminal-shop/models/cart_set_card_params"
|
@@ -43,25 +43,27 @@ module TerminalShop
|
|
43
43
|
|
44
44
|
PLATFORM_HEADERS = T::Hash[String, String]
|
45
45
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
46
|
+
class << self
|
47
|
+
sig { params(req: TerminalShop::BaseClient::RequestComponentsShape).void }
|
48
|
+
def validate!(req)
|
49
|
+
end
|
50
|
+
|
51
|
+
sig do
|
52
|
+
params(status: Integer, headers: T.any(T::Hash[String, String], Net::HTTPHeader)).returns(T::Boolean)
|
53
|
+
end
|
54
|
+
def should_retry?(status, headers:)
|
55
|
+
end
|
56
|
+
|
57
|
+
sig do
|
58
|
+
params(
|
59
|
+
request: TerminalShop::BaseClient::RequestInputShape,
|
60
|
+
status: Integer,
|
61
|
+
response_headers: T.any(T::Hash[String, String], Net::HTTPHeader)
|
62
|
+
)
|
63
|
+
.returns(TerminalShop::BaseClient::RequestInputShape)
|
64
|
+
end
|
65
|
+
def follow_redirect(request, status:, response_headers:)
|
66
|
+
end
|
65
67
|
end
|
66
68
|
|
67
69
|
sig { returns(T.anything) }
|
@@ -83,9 +85,9 @@ module TerminalShop
|
|
83
85
|
T.nilable(T.any(String, Integer, T::Array[T.nilable(T.any(String, Integer))]))],
|
84
86
|
idempotency_header: T.nilable(String)
|
85
87
|
)
|
86
|
-
.
|
88
|
+
.returns(T.attached_class)
|
87
89
|
end
|
88
|
-
def
|
90
|
+
def self.new(
|
89
91
|
base_url:,
|
90
92
|
timeout: 0.0,
|
91
93
|
max_retries: 0,
|