wisco 0.4.2 → 0.4.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4893611d0b98c82232776fa4705b9f92f83d76f4df549a641e2951068d7a5ee3
4
- data.tar.gz: af96365443af8fc4b407ad7de5fae4c279e630665d405f6d8945c7f3a992fb2d
3
+ metadata.gz: d67bb33e37dba45fc8fe77679c3ce959d27b8c4e047359798bcd0abfa8d1b7f4
4
+ data.tar.gz: 704d8a2c8935dbae8857be939638a0b9240a21bec61813adda314d5be34d5798
5
5
  SHA512:
6
- metadata.gz: 1edd85873a8c84fda1bd7829e47a7da67a917b50279204956ea29309f31174fb90825b06e298489d69dc88f11f2d9f68ec1abdb45ed96fb29200ef7e54304fab
7
- data.tar.gz: 9876280ad0dbd7cb2cfeea241155f2538df6b65f37ecdd8ab4d4b6406de9c841bce52c4b23b2043b27cf047aef3919bc94da185139789013c246f0a9ecdbb2f5
6
+ metadata.gz: 18103132c8fdd1af2dd18da30ae44fbd47097b92f4ee1b1adc9f1f515753ce357ca20b18f0a521e35e54237c10255fd7b0597d31d044664b5a27d26d663a2b2d
7
+ data.tar.gz: d6a7db532c55b4eb858ca69c3bedde378948a1ad8c9d1dd2f1590afdea203c8fe788bbb8f3fd514d205746beba63d4689be14ca658406d519ef0976dd4e812d3
@@ -16,7 +16,7 @@ module Wisco
16
16
  def run(path_arg, target_dir, input: nil, pagination: true, verbose: false, debug: false,
17
17
  extended: true, closure: nil, config_fields: nil, continue: nil,
18
18
  extended_input_schema: nil, extended_output_schema: nil,
19
- summary: true, summary_lines: 20)
19
+ summary: true, summary_lines: 20, auto_refresh: true)
20
20
  target_dir = File.expand_path(target_dir)
21
21
  config_path = Wisco.config_path(target_dir)
22
22
 
@@ -40,7 +40,8 @@ module Wisco
40
40
 
41
41
  # ── connection test short-circuit ──────────────────────────────────
42
42
  if path_arg == 'test'
43
- run_test(target_dir, connector_full_path, connection, verbose: verbose, debug: debug)
43
+ run_test(target_dir, connector_full_path, connection, verbose: verbose, debug: debug,
44
+ auto_refresh: auto_refresh)
44
45
  return
45
46
  end
46
47
 
@@ -68,7 +69,8 @@ module Wisco
68
69
  closure: closure, config_fields: config_fields, continue: continue,
69
70
  extended_input_schema: extended_input_schema,
70
71
  extended_output_schema: extended_output_schema, debug: debug,
71
- summary: summary, summary_lines: summary_lines, batch: batch)
72
+ summary: summary, summary_lines: summary_lines, batch: batch,
73
+ auto_refresh: auto_refresh)
72
74
  else
73
75
  Wisco::TerminalOutput.emit_warning(" Warning: No ready input files found in #{fixture_dir_output}")
74
76
  input_template = File.join(fixtures_dir, 'execute_input.json')
@@ -87,14 +89,16 @@ module Wisco
87
89
  extended: extended, closure: closure, config_fields: config_fields,
88
90
  continue: continue, extended_input_schema: extended_input_schema,
89
91
  extended_output_schema: extended_output_schema, debug: debug,
90
- summary: summary, summary_lines: summary_lines, batch: batch)
92
+ summary: summary, summary_lines: summary_lines, batch: batch,
93
+ auto_refresh: auto_refresh)
91
94
  else
92
95
  execute_one(section, key, input_file, fixtures_dir,
93
96
  connector_full_path, connection, pagination: pagination, verbose: verbose,
94
97
  extended: extended, closure: closure, config_fields: config_fields,
95
98
  continue: continue, extended_input_schema: extended_input_schema,
96
99
  extended_output_schema: extended_output_schema, debug: debug,
97
- summary: summary, summary_lines: summary_lines, batch: batch)
100
+ summary: summary, summary_lines: summary_lines, batch: batch,
101
+ auto_refresh: auto_refresh)
98
102
  end
99
103
  end
100
104
  end
@@ -153,7 +157,8 @@ module Wisco
153
157
  File.dirname(value) == '.' ? File.join(fixtures_dir, value) : value
154
158
  end
155
159
 
156
- def run_test(target_dir, connector_full_path, connection, verbose: false, debug: false)
160
+ def run_test(target_dir, connector_full_path, connection, verbose: false, debug: false,
161
+ auto_refresh: true)
157
162
  puts "Testing connection"
158
163
  fixtures_dir = File.join(target_dir, 'fixtures', 'connection', 'test')
159
164
  FileUtils.mkdir_p(fixtures_dir)
@@ -174,6 +179,7 @@ module Wisco
174
179
 
175
180
  begin
176
181
  cmd = Workato::CLI::ExecCommand.new(path: 'test', options: options)
182
+ apply_auto_refresh(cmd) if auto_refresh
177
183
  cmd.call
178
184
  rescue StandardError => e
179
185
  File.write(error_file, "#{e.class}: #{e.message}\n\n#{e.backtrace.join("\n")}\n")
@@ -194,7 +200,7 @@ module Wisco
194
200
  pagination: true, verbose: false, debug: false,
195
201
  extended: true, closure: nil, config_fields: nil, continue: nil,
196
202
  extended_input_schema: nil, extended_output_schema: nil,
197
- summary: true, summary_lines: 20, batch: false)
203
+ summary: true, summary_lines: 20, batch: false, auto_refresh: true)
198
204
  stem = input_file ? File.basename(input_file, '.*') : 'execute'
199
205
  output_file = File.join(fixtures_dir, "output_#{stem}.json")
200
206
  error_file = File.join(fixtures_dir, "error_#{stem}.txt")
@@ -265,6 +271,7 @@ module Wisco
265
271
 
266
272
  begin
267
273
  cmd = Workato::CLI::ExecCommand.new(path: exec_path, options: options)
274
+ apply_auto_refresh(cmd) if auto_refresh
268
275
  cmd.call
269
276
  rescue StandardError => e
270
277
  FileUtils.rm_f(output_file)
@@ -295,7 +302,7 @@ module Wisco
295
302
  pagination: true, verbose: false, debug: false,
296
303
  extended: true, closure: nil, config_fields: nil, continue: nil,
297
304
  extended_input_schema: nil, extended_output_schema: nil,
298
- summary: true, summary_lines: 20, batch: false)
305
+ summary: true, summary_lines: 20, batch: false, auto_refresh: true)
299
306
  subdir = File.join(fixtures_dir, File.basename(script_path, '.rb'))
300
307
  FileUtils.mkdir_p(subdir)
301
308
  input_file = File.join(subdir, 'input.json')
@@ -379,6 +386,7 @@ module Wisco
379
386
  # Step 3: invoke ExecCommand against the generated input
380
387
  begin
381
388
  cmd = Workato::CLI::ExecCommand.new(path: exec_path, options: options)
389
+ apply_auto_refresh(cmd) if auto_refresh
382
390
  cmd.call
383
391
  rescue StandardError => e
384
392
  FileUtils.rm_f(input_file)
@@ -471,6 +479,14 @@ module Wisco
471
479
  str.length > max ? "#{str[0, max - 1]}…" : str
472
480
  end
473
481
 
482
+ # Overrides ask() on the ExecCommand singleton so the SDK's token-refresh
483
+ # prompt ("Updated settings file with new connection attributes? (Yes or No)")
484
+ # is answered "y" automatically. The refresh lambda captures self (the
485
+ # ExecCommand instance), so the singleton method wins over Thor::Shell::Basic.
486
+ def apply_auto_refresh(cmd)
487
+ cmd.define_singleton_method(:ask) { |*| 'y' }
488
+ end
489
+
474
490
  # ── SDK array-args normalisation ───────────────────────────────────────
475
491
  # The Workato SDK's InvokePath#invoke_method applies Array.wrap(args.last).flatten(1)
476
492
  # when the last parameter is *args, which incorrectly unwraps array-valued positional
data/lib/wisco/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Wisco
2
- VERSION = '0.4.2'
2
+ VERSION = '0.4.3'
3
3
  end
data/lib/wisco.rb CHANGED
@@ -103,6 +103,7 @@ module Wisco
103
103
  option :debug, type: :boolean, default: false, desc: 'Print ExecCommand call details'
104
104
  option :summary, type: :boolean, default: true, desc: 'Show output summary after execution (use --no-summary to disable)'
105
105
  option :'summary-lines', type: :numeric, default: 20, desc: 'Max output lines to display in full before switching to summary-only'
106
+ option :'auto-refresh', type: :boolean, default: true, desc: 'Automatically confirm token refresh prompts (use --no-auto-refresh to disable)'
106
107
  def exec(path_arg, target_dir = nil)
107
108
  Wisco::Commands::Exec.run(
108
109
  path_arg,
@@ -118,7 +119,8 @@ module Wisco
118
119
  extended_output_schema: options[:extended_output_schema],
119
120
  debug: options[:debug],
120
121
  summary: options[:summary],
121
- summary_lines: options[:'summary-lines']
122
+ summary_lines: options[:'summary-lines'],
123
+ auto_refresh: options[:'auto-refresh']
122
124
  )
123
125
  end
124
126
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wisco
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - mbillington
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-06-15 00:00:00.000000000 Z
11
+ date: 2026-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport