checkoff 0.269.0 → 0.271.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 547d6f672b3e26e79577be073c9c39c611458a7c3a9772e73cc2bed29acab3bd
4
- data.tar.gz: d073719f59121dbaf6ae04ba3027f2e432398e878747493b94c0a509702530e7
3
+ metadata.gz: fcb00ae6146c2c824474d7565e5ab33307bd9a0fd40d6e4a2c6a179878eb302c
4
+ data.tar.gz: e1ff77d6e14da537805d5aa831d69ca003b19f65ce1a00b0a194adc55f7aa655
5
5
  SHA512:
6
- metadata.gz: 278e297ce240c8ebd1cac143e6b5075398999fe14bd504244a5ba3575a7bdc541108fd55457c777f740a75d9c8aff5597d57d7f4f5a768cf15871991c2f87ec9
7
- data.tar.gz: 3d54df1e95cbf8fd61dfa89317fbd76f06f3b328c33555363e33603ee774b542c8d43d4b91aefea82bcf35af830f7ada44a6fcf3a7e72f9f09bfebc964b12c40
6
+ metadata.gz: ba6b3326bcc8db9222385301fcaef6de94d09f58559d4aa769a5defc0cf1b0496de0625c9a4ac21995b27e5a03af1916932764c38280dfc8ece6602a66e6ab66
7
+ data.tar.gz: e616ebdd3d60b69cb47dec3405eff3f9b1ef059ea41f615a07587010fd0ba8783dab7cbc7f1b475d7fe582ca0b42f0bb93ca5783b0770b40a5cdac184656946a
@@ -82,7 +82,10 @@ module Checkoff
82
82
  # @param uri [URI::Generic]
83
83
  # @param verify_mode [Integer] - e.g., OpenSSL::SSL::VERIFY_NONE,OpenSSL::SSL::VERIFY_PEER
84
84
  #
85
- # @return [Object]
85
+ # @yieldparam tempfile [File]
86
+ # @yieldreturn [Asana::Resources::Attachment, nil]
87
+ #
88
+ # @return [Asana::Resources::Attachment, nil]
86
89
  def download_uri(uri, verify_mode: OpenSSL::SSL::VERIFY_PEER, &block)
87
90
  out = nil
88
91
  host = uri.host || raise("URI has no host: #{uri}")
@@ -101,7 +104,7 @@ module Checkoff
101
104
 
102
105
  # @param response [#read_body]
103
106
  #
104
- # @yields [IO]
107
+ # @yieldparam tempfile [File]
105
108
  #
106
109
  # @return [void]
107
110
  def write_tempfile_from_response(response)
@@ -128,7 +131,7 @@ module Checkoff
128
131
  uri = URI(url)
129
132
  # @type [String]
130
133
  resolved_attachment_name = attachment_name || File.basename(uri.path || '')
131
- download_uri(uri, verify_mode:) do |tempfile|
134
+ attachment = download_uri(uri, verify_mode:) do |tempfile|
132
135
  content_type = content_type_from_filename(resolved_attachment_name)
133
136
  content_type ||= content_type_from_filename(uri.path || '')
134
137
  # neither the attachment name nor the URL's path has a MIME-recognizable extension
@@ -137,6 +140,7 @@ module Checkoff
137
140
  resource.attach(filename: resolved_attachment_name, mime: content_type,
138
141
  io: tempfile)
139
142
  end
143
+ attachment || raise("No attachment created from #{url}")
140
144
  end
141
145
 
142
146
  # @param url [String]
@@ -152,8 +156,8 @@ module Checkoff
152
156
  'name' => attachment_name,
153
157
  }
154
158
  options = {}
155
- Asana::Resources::Resource.new(parse(client.post('/attachments', body: with_params, options:)).first,
156
- client:)
159
+ Asana::Resources::Attachment.new(parse(client.post('/attachments', body: with_params, options:)).first,
160
+ client:)
157
161
  end
158
162
 
159
163
  # @param filename [String]
data/lib/checkoff/cli.rb CHANGED
@@ -185,7 +185,7 @@ module Checkoff
185
185
  @tasks = tasks
186
186
  end
187
187
 
188
- # @return [void]
188
+ # @return [String]
189
189
  def run
190
190
  if section_name.nil?
191
191
  run_on_project(workspace_name, project_name)
@@ -88,10 +88,12 @@ module Checkoff
88
88
  # @param gid [String]
89
89
  # @param resource_type [String,nil]
90
90
  #
91
- # @return [Array([String, nil], [String, nil])]
91
+ # @return [Array(String, String), Array(nil, String), Array(nil, nil)]
92
92
  def enrich_gid(gid, resource_type: nil)
93
93
  resource, resource_type = resources.resource_by_gid(gid, resource_type:)
94
- [resource&.name, resource_type]
94
+ return [nil, nil] if resource.nil? || resource_type.nil?
95
+
96
+ [resource.name, resource_type]
95
97
  end
96
98
 
97
99
  # @param filter [Hash{String => String, Array<String>}]
@@ -19,7 +19,7 @@ module Checkoff
19
19
  end
20
20
 
21
21
  # @param key [Symbol]
22
- # @return [Object]
22
+ # @return [Object, nil]
23
23
  def [](key)
24
24
  config_value = @config[key]
25
25
  return config_value unless config_value.nil?
@@ -1,4 +1,4 @@
1
- # typed: false
1
+ # typed: true
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require 'checkoff/custom_fields'
@@ -50,6 +50,16 @@ module Checkoff
50
50
  Time.parse(time_str)
51
51
  end
52
52
 
53
+ # @param project [Asana::Resources::Project]
54
+ # @param field_spec [Array] [:custom_field, custom field name]
55
+ #
56
+ # @return [Time, Date, nil]
57
+ def custom_field_by_spec(project, field_spec)
58
+ raise "Teach me how to handle field #{field_spec.inspect}" unless field_spec.length == 2
59
+
60
+ custom_field(project, field_spec.fetch(1))
61
+ end
62
+
53
63
  # @param project [Asana::Resources::Project]
54
64
  # @param field_name [Symbol,Array]
55
65
  #
@@ -64,9 +74,8 @@ module Checkoff
64
74
  if field_name.is_a?(Array)
65
75
  # @type [Symbol]
66
76
  actual_field_name = field_name.first
67
- args = field_name[1..]
68
77
 
69
- return custom_field(project, *args) if actual_field_name == :custom_field
78
+ return custom_field_by_spec(project, field_name) if actual_field_name == :custom_field
70
79
  end
71
80
 
72
81
  raise "Teach me how to handle field #{field_name.inspect}"
@@ -184,7 +184,7 @@ module Checkoff
184
184
 
185
185
  # custom_field_#{gid}.variant = 'is'
186
186
  class Is < CustomFieldVariant
187
- # @return [Array(Hash{String => String}, Array<Array<String>, String, Array>)]
187
+ # @return [Array(Hash{String => String}, Array<Array<String>, String, Array, Symbol>)]
188
188
  def convert
189
189
  selected_options = fetch_solo_param("custom_field_#{gid}.selected_options").split('~')
190
190
 
@@ -17,7 +17,7 @@ module Checkoff
17
17
  end
18
18
 
19
19
  # @param task_selectors [Array<Array<Symbol, Array>>]
20
- # @return [Symbol, Array, Array(Symbol, Array, Array)]
20
+ # @return [Array<Symbol, Array>, Array(Symbol, Array, Array)]
21
21
  def self.merge_task_selectors(*task_selectors)
22
22
  return [] if task_selectors.empty?
23
23
 
@@ -8,7 +8,7 @@ module Checkoff
8
8
  module Common
9
9
  # Base class to evaluate a project selector function given fully evaluated arguments
10
10
  class FunctionEvaluator < ::Checkoff::SelectorClasses::FunctionEvaluator
11
- # @param selector [Array<Symbol, Array>, Symbol]
11
+ # @param selector [Array<Symbol, Array>, Symbol, String]
12
12
  # @param custom_fields [Checkoff::CustomFields]
13
13
  # @param _kwargs [Hash]
14
14
  def initialize(selector:, custom_fields:, **_kwargs)
@@ -22,7 +22,7 @@ module Checkoff
22
22
 
23
23
  private
24
24
 
25
- # @return [Array<Symbol, Array>, Symbol]
25
+ # @return [Array<Symbol, Array>, Symbol, String]
26
26
  attr_reader :selector
27
27
  end
28
28
  end
@@ -108,7 +108,12 @@ module Checkoff
108
108
  custom_field = custom_fields.resource_custom_field_by_name(resource, custom_field_name)
109
109
  return nil if custom_field.nil?
110
110
 
111
- custom_field['display_value']
111
+ display_value = custom_field['display_value']
112
+ unless display_value.nil? || display_value.is_a?(String)
113
+ raise "Expected display_value to be a String or nil, got #{display_value.class}"
114
+ end
115
+
116
+ display_value
112
117
  end
113
118
  end
114
119
 
@@ -224,7 +229,7 @@ module Checkoff
224
229
  # @param prefix [String]
225
230
  # @return [boolish]
226
231
  def evaluate(resource, prefix)
227
- resource.name&.start_with?(prefix)
232
+ resource.name.start_with?(prefix)
228
233
  end
229
234
  end
230
235
 
@@ -30,16 +30,16 @@ module Checkoff
30
30
  raise 'Override me!'
31
31
  end
32
32
 
33
- # @param _task [Asana::Resources::Task]
33
+ # @param _resource [Asana::Resources::Resource]
34
34
  # @param _args [Array<Object>]
35
35
  # @return [Object]
36
- def evaluate(_task, *_args)
36
+ def evaluate(_resource, *_args)
37
37
  raise 'Implement me!'
38
38
  end
39
39
 
40
40
  private
41
41
 
42
- # @param object [Array<Symbol, Array>, Symbol]
42
+ # @param object [Array<Symbol, Array>, Symbol, String]
43
43
  # @param fn_name [Symbol]
44
44
  # @return [Boolean]
45
45
  def fn?(object, fn_name)
@@ -8,7 +8,7 @@ module Checkoff
8
8
  module Project
9
9
  # Base class to evaluate a project selector function given fully evaluated arguments
10
10
  class FunctionEvaluator < ::Checkoff::SelectorClasses::FunctionEvaluator
11
- # @param selector [Array<Symbol, Array>, Symbol]
11
+ # @param selector [Array<Symbol, Array>, Symbol, String]
12
12
  # @param projects [Checkoff::Projects]
13
13
  # @param portfolios [Checkoff::Portfolios]
14
14
  # @param workspaces [Checkoff::Workspaces]
@@ -36,7 +36,7 @@ module Checkoff
36
36
 
37
37
  private
38
38
 
39
- # @return [Array<Symbol, Array>, Symbol]
39
+ # @return [Array<Symbol, Array>, Symbol, String]
40
40
  attr_reader :selector
41
41
  end
42
42
  end
@@ -8,7 +8,7 @@ module Checkoff
8
8
  module Section
9
9
  # Base class to evaluate a project selector function given fully evaluated arguments
10
10
  class FunctionEvaluator < ::Checkoff::SelectorClasses::FunctionEvaluator
11
- # @param selector [Array<Symbol, Array>, Symbol]
11
+ # @param selector [Array<Symbol, Array>, Symbol, String]
12
12
  # @param client [Asana::Client]
13
13
  # @param sections [Checkoff::Sections]
14
14
  # @param kwargs [Hash]
@@ -30,7 +30,7 @@ module Checkoff
30
30
 
31
31
  private
32
32
 
33
- # @return [Array<Symbol, Array>, Symbol]
33
+ # @return [Array<Symbol, Array>, Symbol, String]
34
34
  attr_reader :selector
35
35
  end
36
36
  end
@@ -8,7 +8,7 @@ module Checkoff
8
8
  module Task
9
9
  # Base class to evaluate a task selector function given fully evaluated arguments
10
10
  class FunctionEvaluator < ::Checkoff::SelectorClasses::FunctionEvaluator
11
- # @param selector [Array<Symbol, Array>, Symbol]
11
+ # @param selector [Array<Symbol, Array>, Symbol, String]
12
12
  # @param tasks [Checkoff::Tasks]
13
13
  # @param timelines [Checkoff::Timelines]
14
14
  # @param custom_fields [Checkoff::CustomFields]
@@ -36,7 +36,7 @@ module Checkoff
36
36
 
37
37
  private
38
38
 
39
- # @return [Array<Symbol, Array>, Symbol]
39
+ # @return [Array<Symbol, Array>, Symbol, String]
40
40
  attr_reader :selector
41
41
  end
42
42
  end
@@ -254,10 +254,7 @@ module Checkoff
254
254
  # @param story [Asana::Resources::Story]
255
255
  # @return [Time]
256
256
  def created_time(story)
257
- created_at = story.created_at
258
- raise "Story #{story.gid} has no created_at" if created_at.nil?
259
-
260
- Time.parse(created_at)
257
+ Time.parse(story.created_at)
261
258
  end
262
259
  end
263
260
 
@@ -45,8 +45,8 @@ module Checkoff
45
45
  task_hash['unwrapped']['custom_fields'] = unwrapped_custom_fields
46
46
  end
47
47
 
48
- # @param [Hash{String => String, Hash, Array}] task_hash
49
- # @param [Array<Hash>] memberships
48
+ # @param task_hash [Hash{String => Object}]
49
+ # @param memberships [Array<Hash>]
50
50
  #
51
51
  # @return [void]
52
52
  def add_user_task_list(task_hash, memberships)
@@ -63,7 +63,7 @@ module Checkoff
63
63
  }
64
64
  end
65
65
 
66
- # @param task_hash [Hash{String => String, Hash, Array}]
66
+ # @param task_hash [Hash{String => Object}]
67
67
  # @return [Hash{String => Object}]
68
68
  def assignee_hash(task_hash)
69
69
  assignee = task_hash.fetch('assignee')
@@ -1,4 +1,4 @@
1
- # typed: false
1
+ # typed: true
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Checkoff
@@ -71,6 +71,16 @@ module Checkoff
71
71
  Time.parse(time_str)
72
72
  end
73
73
 
74
+ # @param task [Asana::Resources::Task]
75
+ # @param field_spec [Array] [:custom_field, custom field name]
76
+ #
77
+ # @return [Time, Date, nil]
78
+ def custom_field_by_spec(task, field_spec)
79
+ raise "Teach me how to handle field #{field_spec.inspect}" unless field_spec.length == 2
80
+
81
+ custom_field(task, field_spec.fetch(1))
82
+ end
83
+
74
84
  # @param task [Asana::Resources::Task]
75
85
  # @param field_name [Symbol,Array]
76
86
  #
@@ -87,9 +97,8 @@ module Checkoff
87
97
  if field_name.is_a?(Array)
88
98
  # @type [Symbol]
89
99
  actual_field_name = field_name.first
90
- args = field_name[1..]
91
100
 
92
- return custom_field(task, *args) if actual_field_name == :custom_field
101
+ return custom_field_by_spec(task, field_name) if actual_field_name == :custom_field
93
102
  end
94
103
 
95
104
  raise "Teach me how to handle field #{field_name.inspect}"
@@ -57,7 +57,9 @@ module Checkoff
57
57
  # @param gid [String]
58
58
  # @param resource_type [String,nil]
59
59
  #
60
- # @return [Array([Asana::Resource, nil], [String,nil])]
60
+ # @return [Array(Asana::Resources::Task, String),
61
+ # Array(Asana::Resources::Section, String),
62
+ # Array(Asana::Resources::Project, String), Array(nil, nil)]
61
63
  def resource_by_gid(gid, resource_type: nil)
62
64
  %w[task section project].each do |resource_type_to_try|
63
65
  next unless [resource_type_to_try, nil].include?(resource_type)
@@ -73,7 +75,8 @@ module Checkoff
73
75
  # @param resource_type [String]
74
76
  # @param gid [String]
75
77
  #
76
- # @return [Asana::Resources::Resource, nil]
78
+ # @return [Asana::Resources::Task, Asana::Resources::Section,
79
+ # Asana::Resources::Project, nil]
77
80
  def fetch_gid_by_type(resource_type, gid)
78
81
  case resource_type
79
82
  when 'task' then fetch_task_gid(gid)
@@ -106,7 +106,7 @@ module Checkoff
106
106
  # @param by_section [Hash]
107
107
  # @param task [Asana::Resources::Task]
108
108
  #
109
- # @return [Array(String, Hash)]
109
+ # @return [Array(String, Hash), Array(nil, Hash)]
110
110
  def file_task_by_section(current_section, by_section, task)
111
111
  if subtask_section?(task)
112
112
  current_section = task.name
@@ -93,9 +93,9 @@ module Checkoff
93
93
 
94
94
  next true if last_milestone.gid == task.gid
95
95
 
96
- all_dependent_task_gids ||= @tasks.all_dependent_tasks(task).map(&:gid)
96
+ dependent_task_gids = all_dependent_task_gids ||= @tasks.all_dependent_tasks(task).map(&:gid)
97
97
 
98
- all_dependent_task_gids.include? last_milestone.gid
98
+ dependent_task_gids.include? last_milestone.gid
99
99
  end
100
100
  end
101
101
 
@@ -121,14 +121,14 @@ module Checkoff
121
121
 
122
122
  # do this once, but lazily, so we don't have to do it if all
123
123
  # projects are excluded
124
- all_dependent_milestones ||=
124
+ dependent_milestones = all_dependent_milestones ||=
125
125
  @tasks.all_dependent_tasks(task,
126
126
  extra_task_fields: ['resource_subtype',
127
127
  'memberships.project.gid']).select do |dependent_task|
128
128
  dependent_task.resource_subtype == 'milestone'
129
129
  end
130
130
 
131
- all_dependent_milestones.any? do |milestone|
131
+ dependent_milestones.any? do |milestone|
132
132
  memberships.memberships_or_raise(milestone).any? do |milestone_membership_data|
133
133
  milestone_membership_data.fetch('project').fetch('gid') == project_gid
134
134
  end
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- # typed: false
2
+ # typed: true
3
3
 
4
4
  # frozen_string_literal: true
5
5
 
@@ -51,12 +51,7 @@ module Checkoff
51
51
 
52
52
  return now_or_before?(date_or_time) if period == :now_or_before
53
53
 
54
- if period.is_a?(Array)
55
- period_name = T.cast(period.first, Symbol)
56
- args = period[1..]
57
-
58
- return compound_in_period?(date_or_time, period_name, *args)
59
- end
54
+ return compound_in_period?(date_or_time, period) if period.is_a?(Array)
60
55
 
61
56
  raise "Teach me how to handle period #{period.inspect}"
62
57
  end
@@ -204,24 +199,53 @@ module Checkoff
204
199
  end
205
200
 
206
201
  # @param date_or_time [Date,Time,nil]
207
- # @param period_name [Symbol]
208
- # @param args [Array<Object>]
209
- def compound_in_period?(date_or_time, period_name, *args)
210
- return less_than_n_days_ago?(date_or_time, *args) if period_name == :less_than_n_days_ago
202
+ # @param period [Array<Symbol, Integer, nil>] period name, then its arguments
203
+ def compound_in_period?(date_or_time, period)
204
+ period_name = period.first
205
+ args = period.drop(1)
206
+
207
+ num_days = args.first
208
+ if args.length == 1 && num_days.is_a?(Integer)
209
+ return single_num_days_in_period?(date_or_time, period_name, num_days)
210
+ end
211
+
212
+ if period_name == :between_relative_days && args.length == 2
213
+ return between_relative_days?(date_or_time,
214
+ optional_num_days(period, args.fetch(0)),
215
+ optional_num_days(period, args.fetch(1)))
216
+ end
211
217
 
212
- return less_than_n_days_from_now?(date_or_time, *args) if period_name == :less_than_n_days_from_now
218
+ raise "Teach me how to handle period #{period.inspect}"
219
+ end
220
+
221
+ # @param period [Array<Symbol, Integer, nil>] period the argument came from
222
+ # @param arg [Symbol, Integer, nil]
223
+ #
224
+ # @return [Integer, nil]
225
+ def optional_num_days(period, arg)
226
+ return nil if arg.nil?
227
+ return arg if arg.is_a?(Integer)
228
+
229
+ raise "Teach me how to handle period #{period.inspect}"
230
+ end
231
+
232
+ # @param date_or_time [Date,Time,nil]
233
+ # @param period_name [Symbol, Integer, nil]
234
+ # @param num_days [Integer]
235
+ def single_num_days_in_period?(date_or_time, period_name, num_days)
236
+ return less_than_n_days_ago?(date_or_time, num_days) if period_name == :less_than_n_days_ago
237
+
238
+ return less_than_n_days_from_now?(date_or_time, num_days) if period_name == :less_than_n_days_from_now
213
239
 
214
240
  if period_name == :greater_than_or_equal_to_n_days_from_now
215
- return greater_than_or_equal_to_n_days_from_now?(date_or_time, *args)
241
+ return greater_than_or_equal_to_n_days_from_now?(date_or_time, num_days)
216
242
  end
217
243
 
218
244
  if period_name == :greater_than_or_equal_to_n_days_from_today
219
- return greater_than_or_equal_to_n_days_from_today?(date_or_time, *args)
245
+ return greater_than_or_equal_to_n_days_from_today?(date_or_time, num_days)
220
246
  end
221
247
 
222
- return between_relative_days?(date_or_time, *args) if period_name == :between_relative_days
223
-
224
- raise "Teach me how to handle period [#{period_name.inspect}, #{args.map(&:inspect).join(', ')}]"
248
+ raise "Teach me how to handle period [#{period_name.inspect}, #{num_days.inspect}]"
225
249
  end
226
250
 
227
251
  # bundle exec ./time.rb
@@ -4,5 +4,5 @@
4
4
  # Command-line and gem client for Asana (unofficial)
5
5
  module Checkoff
6
6
  # Version of library
7
- VERSION = '0.269.0'
7
+ VERSION = '0.271.0'
8
8
  end
data/rbi/checkoff.rbi CHANGED
@@ -82,7 +82,7 @@ module Overcommit
82
82
  end
83
83
 
84
84
  module Checkoff
85
- VERSION = '0.269.0'
85
+ VERSION = '0.271.0'
86
86
 
87
87
  class Attachments
88
88
  include Logging
@@ -1451,8 +1451,14 @@ module Checkoff
1451
1451
  sig { params(date_or_time: T.untyped, beginning_num_days_from_now: T.untyped, end_num_days_from_now: T.untyped).returns(T.untyped) }
1452
1452
  def between_relative_days?(date_or_time, beginning_num_days_from_now, end_num_days_from_now); end
1453
1453
 
1454
- sig { params(date_or_time: T.untyped, period_name: T.untyped, args: T.untyped).returns(T.untyped) }
1455
- def compound_in_period?(date_or_time, period_name, *args); end
1454
+ sig { params(date_or_time: T.untyped, period: T.untyped).returns(T.untyped) }
1455
+ def compound_in_period?(date_or_time, period); end
1456
+
1457
+ sig { params(period: T.untyped, arg: T.untyped).returns(T.untyped) }
1458
+ def optional_num_days(period, arg); end
1459
+
1460
+ sig { params(date_or_time: T.untyped, period_name: T.untyped, num_days: T.untyped).returns(T.untyped) }
1461
+ def single_num_days_in_period?(date_or_time, period_name, num_days); end
1456
1462
 
1457
1463
  sig { returns(T.untyped) }
1458
1464
  def self.run; end
@@ -1636,6 +1642,9 @@ module Checkoff
1636
1642
  sig { params(project: T.untyped, custom_field_name: T.untyped).returns(T.untyped) }
1637
1643
  def custom_field(project, custom_field_name); end
1638
1644
 
1645
+ sig { params(project: T.untyped, field_spec: T.untyped).returns(T.untyped) }
1646
+ def custom_field_by_spec(project, field_spec); end
1647
+
1639
1648
  sig { params(project: T.untyped, field_name: T.untyped).returns(T.untyped) }
1640
1649
  def date_or_time_field_by_name(project, field_name); end
1641
1650
  end
@@ -1699,6 +1708,9 @@ module Checkoff
1699
1708
  sig { params(task: T.untyped, custom_field_name: T.untyped).returns(T.untyped) }
1700
1709
  def custom_field(task, custom_field_name); end
1701
1710
 
1711
+ sig { params(task: T.untyped, field_spec: T.untyped).returns(T.untyped) }
1712
+ def custom_field_by_spec(task, field_spec); end
1713
+
1702
1714
  sig { params(task: T.untyped, field_name: T.untyped).returns(T.untyped) }
1703
1715
  def date_or_time_field_by_name(task, field_name); end
1704
1716
  end
@@ -2021,8 +2033,8 @@ module Checkoff
2021
2033
  sig { returns(T.untyped) }
2022
2034
  def matches?; end
2023
2035
 
2024
- sig { params(_task: T.untyped, _args: T.untyped).returns(T.untyped) }
2025
- def evaluate(_task, *_args); end
2036
+ sig { params(_resource: T.untyped, _args: T.untyped).returns(T.untyped) }
2037
+ def evaluate(_resource, *_args); end
2026
2038
 
2027
2039
  sig { params(object: T.untyped, fn_name: T.untyped).returns(T.untyped) }
2028
2040
  def fn?(object, fn_name); end
@@ -2503,9 +2515,10 @@ module Checkoff
2503
2515
  end
2504
2516
  end
2505
2517
  # typed: ignore
2506
- # Command-line and gem client for Asana (unofficial)
2518
+ # typed: true
2519
+ # frozen_string_literal: true
2507
2520
  module Checkoff
2508
- VERSION = T.let('0.269.0', T.untyped)
2521
+ VERSION = T.let('0.271.0', T.untyped)
2509
2522
 
2510
2523
  # Move tasks from one place to another
2511
2524
  class MvSubcommand
@@ -2660,7 +2673,7 @@ module Checkoff
2660
2673
  projects:), tasks: Checkoff::Tasks.new(config:,
2661
2674
  sections:), stderr: $stderr); end
2662
2675
 
2663
- sig { void }
2676
+ sig { returns(String) }
2664
2677
  def run; end
2665
2678
 
2666
2679
  # _@param_ `project_name`
@@ -3354,15 +3367,27 @@ module Checkoff
3354
3367
 
3355
3368
  # _@param_ `date_or_time`
3356
3369
  #
3357
- # _@param_ `period_name`
3358
- #
3359
- # _@param_ `args`
3360
- sig { params(date_or_time: T.nilable(T.any(Date, Time)), period_name: Symbol, args: Object).returns(T::Boolean) }
3361
- def compound_in_period?(date_or_time, period_name, *args); end
3370
+ # _@param_ `period` — period name, then its arguments
3371
+ sig { params(date_or_time: T.nilable(T.any(Date, Time)), period: T::Array[T.nilable(T.any(Symbol, Integer))]).returns(T::Boolean) }
3372
+ def compound_in_period?(date_or_time, period); end
3362
3373
 
3363
3374
  sig { void }
3364
3375
  def self.run; end
3365
3376
 
3377
+ # _@param_ `period` — period the argument came from
3378
+ #
3379
+ # _@param_ `arg`
3380
+ sig { params(period: T::Array[T.nilable(T.any(Symbol, Integer))], arg: T.nilable(T.any(Symbol, Integer))).returns(T.nilable(Integer)) }
3381
+ def optional_num_days(period, arg); end
3382
+
3383
+ # _@param_ `date_or_time`
3384
+ #
3385
+ # _@param_ `period_name`
3386
+ #
3387
+ # _@param_ `num_days`
3388
+ sig { params(date_or_time: T.nilable(T.any(Date, Time)), period_name: T.nilable(T.any(Symbol, Integer)), num_days: Integer).returns(T::Boolean) }
3389
+ def single_num_days_in_period?(date_or_time, period_name, num_days); end
3390
+
3366
3391
  sig { returns(::Logger) }
3367
3392
  def logger; end
3368
3393
 
@@ -3968,7 +3993,7 @@ module Checkoff
3968
3993
  # _@param_ `by_section`
3969
3994
  #
3970
3995
  # _@param_ `task`
3971
- sig { params(current_section: T.nilable(String), by_section: T::Hash[T.untyped, T.untyped], task: Asana::Resources::Task).returns([String, T::Hash[T.untyped, T.untyped]]) }
3996
+ sig { params(current_section: T.nilable(String), by_section: T::Hash[T.untyped, T.untyped], task: Asana::Resources::Task).returns(T.any([String, T::Hash[T.untyped, T.untyped]], [NilClass, T::Hash[T.untyped, T.untyped]])) }
3972
3997
  def file_task_by_section(current_section, by_section, task); end
3973
3998
 
3974
3999
  sig { returns(Checkoff::Projects) }
@@ -4014,23 +4039,19 @@ module Checkoff
4014
4039
  end
4015
4040
  def initialize(config: Checkoff::Internal::ConfigLoader.load(:asana), workspaces: Checkoff::Workspaces.new(config:), tasks: Checkoff::Tasks.new(config:), sections: Checkoff::Sections.new(config:), projects: Checkoff::Projects.new(config:), clients: Checkoff::Clients.new(config:), client: clients.client); end
4016
4041
 
4017
- # sord warn - "[Asana::Resource" does not appear to be a type
4018
- # sord warn - "nil]" does not appear to be a type
4019
- # sord warn - "[String" does not appear to be a type
4020
- # sord warn - "nil]" does not appear to be a type
4021
4042
  # Attempt to look up a GID, even in situations where we don't
4022
4043
  # have a resource type provided.
4023
4044
  #
4024
4045
  # _@param_ `gid`
4025
4046
  #
4026
4047
  # _@param_ `resource_type`
4027
- sig { params(gid: String, resource_type: T.nilable(String)).returns([T.untyped, T.untyped, T.untyped, T.untyped]) }
4048
+ sig { params(gid: String, resource_type: T.nilable(String)).returns(T.any([Asana::Resources::Task, String], [Asana::Resources::Section, String], [Asana::Resources::Project, String], [NilClass, NilClass])) }
4028
4049
  def resource_by_gid(gid, resource_type: nil); end
4029
4050
 
4030
4051
  # _@param_ `resource_type`
4031
4052
  #
4032
4053
  # _@param_ `gid`
4033
- sig { params(resource_type: String, gid: String).returns(T.nilable(Asana::Resources::Resource)) }
4054
+ sig { params(resource_type: String, gid: String).returns(T.nilable(T.any(Asana::Resources::Task, Asana::Resources::Section, Asana::Resources::Project))) }
4034
4055
  def fetch_gid_by_type(resource_type, gid); end
4035
4056
 
4036
4057
  # _@param_ `gid`
@@ -4311,13 +4332,13 @@ module Checkoff
4311
4332
  # _@param_ `uri`
4312
4333
  #
4313
4334
  # _@param_ `verify_mode` — - e.g., OpenSSL::SSL::VERIFY_NONE,OpenSSL::SSL::VERIFY_PEER
4314
- sig { params(uri: URI::Generic, verify_mode: Integer, block: T.untyped).returns(Object) }
4335
+ sig { params(uri: URI::Generic, verify_mode: Integer, block: T.proc.params(tempfile: File).returns(T.nilable(Asana::Resources::Attachment))).returns(T.nilable(Asana::Resources::Attachment)) }
4315
4336
  def download_uri(uri, verify_mode: OpenSSL::SSL::VERIFY_PEER, &block); end
4316
4337
 
4317
4338
  # sord duck - #read_body looks like a duck type, replacing with untyped
4318
4339
  # _@param_ `response`
4319
- sig { params(response: T.untyped).void }
4320
- def write_tempfile_from_response(response); end
4340
+ sig { params(response: T.untyped, blk: T.proc.params(tempfile: File).void).void }
4341
+ def write_tempfile_from_response(response, &blk); end
4321
4342
 
4322
4343
  # _@param_ `url`
4323
4344
  #
@@ -4859,11 +4880,11 @@ module Checkoff
4859
4880
  # _@param_ `task_hash`
4860
4881
  #
4861
4882
  # _@param_ `memberships`
4862
- sig { params(task_hash: T::Hash[String, T.any(String, T::Hash[T.untyped, T.untyped], T::Array[T.untyped])], memberships: T::Array[T::Hash[T.untyped, T.untyped]]).void }
4883
+ sig { params(task_hash: T::Hash[String, Object], memberships: T::Array[T::Hash[T.untyped, T.untyped]]).void }
4863
4884
  def add_user_task_list(task_hash, memberships); end
4864
4885
 
4865
4886
  # _@param_ `task_hash`
4866
- sig { params(task_hash: T::Hash[String, T.any(String, T::Hash[T.untyped, T.untyped], T::Array[T.untyped])]).returns(T::Hash[String, Object]) }
4887
+ sig { params(task_hash: T::Hash[String, Object]).returns(T::Hash[String, Object]) }
4867
4888
  def assignee_hash(task_hash); end
4868
4889
 
4869
4890
  # _@param_ `task_hash`
@@ -4938,6 +4959,12 @@ module Checkoff
4938
4959
  # _@param_ `field_name`
4939
4960
  sig { params(task: Asana::Resources::Task, field_name: T.any(Symbol, T::Array[T.untyped])).returns(T.nilable(T.any(Date, Time))) }
4940
4961
  def date_or_time_field_by_name(task, field_name); end
4962
+
4963
+ # _@param_ `task`
4964
+ #
4965
+ # _@param_ `field_spec` — [:custom_field, custom field name]
4966
+ sig { params(task: Asana::Resources::Task, field_spec: T::Array[T.untyped]).returns(T.nilable(T.any(Time, Date))) }
4967
+ def custom_field_by_spec(task, field_spec); end
4941
4968
  end
4942
4969
 
4943
4970
  # Manage thread lock variables in a block
@@ -4961,7 +4988,7 @@ module Checkoff
4961
4988
  def initialize(config, sym, yaml_filename); end
4962
4989
 
4963
4990
  # _@param_ `key`
4964
- sig { params(key: Symbol).returns(Object) }
4991
+ sig { params(key: Symbol).returns(T.nilable(Object)) }
4965
4992
  def [](key); end
4966
4993
 
4967
4994
  # _@param_ `key`
@@ -5049,6 +5076,12 @@ module Checkoff
5049
5076
  # _@param_ `field_name`
5050
5077
  sig { params(project: Asana::Resources::Project, field_name: T.any(Symbol, T::Array[T.untyped])).returns(T.nilable(T.any(Date, Time))) }
5051
5078
  def date_or_time_field_by_name(project, field_name); end
5079
+
5080
+ # _@param_ `project`
5081
+ #
5082
+ # _@param_ `field_spec` — [:custom_field, custom field name]
5083
+ sig { params(project: Asana::Resources::Project, field_spec: T::Array[T.untyped]).returns(T.nilable(T.any(Time, Date))) }
5084
+ def custom_field_by_spec(project, field_spec); end
5052
5085
  end
5053
5086
 
5054
5087
  module SearchUrl
@@ -5087,7 +5120,7 @@ module Checkoff
5087
5120
  def self.merge_args(*args); end
5088
5121
 
5089
5122
  # _@param_ `task_selectors`
5090
- sig { params(task_selectors: T::Array[T.any(Symbol, T::Array[T.untyped])]).returns(T.any(Symbol, T::Array[T.untyped], [Symbol, T::Array[T.untyped], T::Array[T.untyped]])) }
5123
+ sig { params(task_selectors: T::Array[T.any(Symbol, T::Array[T.untyped])]).returns(T.any(T::Array[T.any(Symbol, T::Array[T.untyped])], [Symbol, T::Array[T.untyped], T::Array[T.untyped]])) }
5091
5124
  def self.merge_task_selectors(*task_selectors); end
5092
5125
  end
5093
5126
 
@@ -5185,7 +5218,7 @@ module Checkoff
5185
5218
 
5186
5219
  # custom_field_#{gid}.variant = 'is'
5187
5220
  class Is < Checkoff::Internal::SearchUrl::CustomFieldVariant::CustomFieldVariant
5188
- sig { returns([T::Hash[String, String], T::Array[T.any(T::Array[String], String, T::Array[T.untyped])]]) }
5221
+ sig { returns([T::Hash[String, String], T::Array[T.any(T::Array[String], String, T::Array[T.untyped], Symbol)]]) }
5189
5222
  def convert; end
5190
5223
  end
5191
5224
  end
@@ -5589,17 +5622,13 @@ module Checkoff
5589
5622
  sig { params(webhook_subscription: T.nilable(T::Hash[T.untyped, T.untyped])).void }
5590
5623
  def enrich_webhook_subscription!(webhook_subscription); end
5591
5624
 
5592
- # sord warn - "[String" does not appear to be a type
5593
- # sord warn - "nil]" does not appear to be a type
5594
- # sord warn - "[String" does not appear to be a type
5595
- # sord warn - "nil]" does not appear to be a type
5596
5625
  # Attempt to look up a GID in situations where we don't have a
5597
5626
  # resource type provided, and returns the name of the resource.
5598
5627
  #
5599
5628
  # _@param_ `gid`
5600
5629
  #
5601
5630
  # _@param_ `resource_type`
5602
- sig { params(gid: String, resource_type: T.nilable(String)).returns([T.untyped, T.untyped, T.untyped, T.untyped]) }
5631
+ sig { params(gid: String, resource_type: T.nilable(String)).returns(T.any([String, String], [NilClass, String], [NilClass, NilClass])) }
5603
5632
  def enrich_gid(gid, resource_type: nil); end
5604
5633
 
5605
5634
  # _@param_ `filter`
@@ -5983,7 +6012,7 @@ module Checkoff
5983
6012
  # _@param_ `_kwargs`
5984
6013
  sig do
5985
6014
  params(
5986
- selector: T.any(T::Array[T.any(Symbol, T::Array[T.untyped])], Symbol),
6015
+ selector: T.any(T::Array[T.any(Symbol, T::Array[T.untyped])], Symbol, String),
5987
6016
  tasks: Checkoff::Tasks,
5988
6017
  timelines: Checkoff::Timelines,
5989
6018
  custom_fields: Checkoff::CustomFields,
@@ -6001,7 +6030,7 @@ module Checkoff
6001
6030
  sig { returns(Checkoff::CustomFields) }
6002
6031
  attr_reader :custom_fields
6003
6032
 
6004
- sig { returns(T.any(T::Array[T.any(Symbol, T::Array[T.untyped])], Symbol)) }
6033
+ sig { returns(T.any(T::Array[T.any(Symbol, T::Array[T.untyped])], Symbol, String)) }
6005
6034
  attr_reader :selector
6006
6035
  end
6007
6036
  end
@@ -6206,13 +6235,13 @@ module Checkoff
6206
6235
  # _@param_ `custom_fields`
6207
6236
  #
6208
6237
  # _@param_ `_kwargs`
6209
- sig { params(selector: T.any(T::Array[T.any(Symbol, T::Array[T.untyped])], Symbol), custom_fields: Checkoff::CustomFields, _kwargs: T.untyped).void }
6238
+ sig { params(selector: T.any(T::Array[T.any(Symbol, T::Array[T.untyped])], Symbol, String), custom_fields: Checkoff::CustomFields, _kwargs: T.untyped).void }
6210
6239
  def initialize(selector:, custom_fields:, **_kwargs); end
6211
6240
 
6212
6241
  sig { returns(Checkoff::CustomFields) }
6213
6242
  attr_reader :custom_fields
6214
6243
 
6215
- sig { returns(T.any(T::Array[T.any(Symbol, T::Array[T.untyped])], Symbol)) }
6244
+ sig { returns(T.any(T::Array[T.any(Symbol, T::Array[T.untyped])], Symbol, String)) }
6216
6245
  attr_reader :selector
6217
6246
  end
6218
6247
  end
@@ -6283,7 +6312,7 @@ module Checkoff
6283
6312
  # _@param_ `_kwargs`
6284
6313
  sig do
6285
6314
  params(
6286
- selector: T.any(T::Array[T.any(Symbol, T::Array[T.untyped])], Symbol),
6315
+ selector: T.any(T::Array[T.any(Symbol, T::Array[T.untyped])], Symbol, String),
6287
6316
  projects: Checkoff::Projects,
6288
6317
  portfolios: Checkoff::Portfolios,
6289
6318
  workspaces: Checkoff::Workspaces,
@@ -6301,7 +6330,7 @@ module Checkoff
6301
6330
  sig { returns(Checkoff::Workspaces) }
6302
6331
  attr_reader :workspaces
6303
6332
 
6304
- sig { returns(T.any(T::Array[T.any(Symbol, T::Array[T.untyped])], Symbol)) }
6333
+ sig { returns(T.any(T::Array[T.any(Symbol, T::Array[T.untyped])], Symbol, String)) }
6305
6334
  attr_reader :selector
6306
6335
  end
6307
6336
  end
@@ -6343,7 +6372,7 @@ module Checkoff
6343
6372
  # _@param_ `kwargs`
6344
6373
  sig do
6345
6374
  params(
6346
- selector: T.any(T::Array[T.any(Symbol, T::Array[T.untyped])], Symbol),
6375
+ selector: T.any(T::Array[T.any(Symbol, T::Array[T.untyped])], Symbol, String),
6347
6376
  sections: Checkoff::Sections,
6348
6377
  client: Asana::Client,
6349
6378
  kwargs: T.untyped
@@ -6357,7 +6386,7 @@ module Checkoff
6357
6386
  sig { returns(Asana::Client) }
6358
6387
  attr_reader :client
6359
6388
 
6360
- sig { returns(T.any(T::Array[T.any(Symbol, T::Array[T.untyped])], Symbol)) }
6389
+ sig { returns(T.any(T::Array[T.any(Symbol, T::Array[T.untyped])], Symbol, String)) }
6361
6390
  attr_reader :selector
6362
6391
  end
6363
6392
  end
@@ -6387,16 +6416,16 @@ module Checkoff
6387
6416
  sig { returns(T::Boolean) }
6388
6417
  def matches?; end
6389
6418
 
6390
- # _@param_ `_task`
6419
+ # _@param_ `_resource`
6391
6420
  #
6392
6421
  # _@param_ `_args`
6393
- sig { params(_task: Asana::Resources::Task, _args: Object).returns(Object) }
6394
- def evaluate(_task, *_args); end
6422
+ sig { params(_resource: Asana::Resources::Resource, _args: Object).returns(Object) }
6423
+ def evaluate(_resource, *_args); end
6395
6424
 
6396
6425
  # _@param_ `object`
6397
6426
  #
6398
6427
  # _@param_ `fn_name`
6399
- sig { params(object: T.any(T::Array[T.any(Symbol, T::Array[T.untyped])], Symbol), fn_name: Symbol).returns(T::Boolean) }
6428
+ sig { params(object: T.any(T::Array[T.any(Symbol, T::Array[T.untyped])], Symbol, String), fn_name: Symbol).returns(T::Boolean) }
6400
6429
  def fn?(object, fn_name); end
6401
6430
 
6402
6431
  sig { returns(::Logger) }
data/sig/checkoff.rbs CHANGED
@@ -1,4 +1,5 @@
1
- # Command-line and gem client for Asana (unofficial)
1
+ # typed: true
2
+ # frozen_string_literal: true
2
3
  module Checkoff
3
4
  VERSION: untyped
4
5
 
@@ -131,7 +132,7 @@ module Checkoff
131
132
  ?stderr: IO
132
133
  ) -> void
133
134
 
134
- def run: () -> void
135
+ def run: () -> String
135
136
 
136
137
  # _@param_ `project_name`
137
138
  def validate_and_assign_project_name: ((String | Symbol) project_name) -> (String | Symbol)
@@ -700,13 +701,23 @@ module Checkoff
700
701
 
701
702
  # _@param_ `date_or_time`
702
703
  #
703
- # _@param_ `period_name`
704
- #
705
- # _@param_ `args`
706
- def compound_in_period?: ((Date | Time)? date_or_time, Symbol period_name, *Object args) -> bool
704
+ # _@param_ `period` — period name, then its arguments
705
+ def compound_in_period?: ((Date | Time)? date_or_time, ::Array[(Symbol | Integer)?] period) -> bool
707
706
 
708
707
  def self.run: () -> void
709
708
 
709
+ # _@param_ `period` — period the argument came from
710
+ #
711
+ # _@param_ `arg`
712
+ def optional_num_days: (::Array[(Symbol | Integer)?] period, (Symbol | Integer)? arg) -> Integer?
713
+
714
+ # _@param_ `date_or_time`
715
+ #
716
+ # _@param_ `period_name`
717
+ #
718
+ # _@param_ `num_days`
719
+ def single_num_days_in_period?: ((Date | Time)? date_or_time, (Symbol | Integer)? period_name, Integer num_days) -> bool
720
+
710
721
  def logger: () -> ::Logger
711
722
 
712
723
  # _@param_ `message`
@@ -1213,7 +1224,7 @@ module Checkoff
1213
1224
  # _@param_ `by_section`
1214
1225
  #
1215
1226
  # _@param_ `task`
1216
- def file_task_by_section: (String? current_section, ::Hash[untyped, untyped] by_section, Asana::Resources::Task task) -> [String, ::Hash[untyped, untyped]]
1227
+ def file_task_by_section: (String? current_section, ::Hash[untyped, untyped] by_section, Asana::Resources::Task task) -> ([String, ::Hash[untyped, untyped]] | [NilClass, ::Hash[untyped, untyped]])
1217
1228
 
1218
1229
  attr_reader projects: Checkoff::Projects
1219
1230
 
@@ -1253,22 +1264,18 @@ module Checkoff
1253
1264
  ?client: Asana::Client
1254
1265
  ) -> void
1255
1266
 
1256
- # sord warn - "[Asana::Resource" does not appear to be a type
1257
- # sord warn - "nil]" does not appear to be a type
1258
- # sord warn - "[String" does not appear to be a type
1259
- # sord warn - "nil]" does not appear to be a type
1260
1267
  # Attempt to look up a GID, even in situations where we don't
1261
1268
  # have a resource type provided.
1262
1269
  #
1263
1270
  # _@param_ `gid`
1264
1271
  #
1265
1272
  # _@param_ `resource_type`
1266
- def resource_by_gid: (String gid, ?resource_type: String?) -> [untyped, untyped, untyped, untyped]
1273
+ def resource_by_gid: (String gid, ?resource_type: String?) -> ([Asana::Resources::Task, String] | [Asana::Resources::Section, String] | [Asana::Resources::Project, String] | [NilClass, NilClass])
1267
1274
 
1268
1275
  # _@param_ `resource_type`
1269
1276
  #
1270
1277
  # _@param_ `gid`
1271
- def fetch_gid_by_type: (String resource_type, String gid) -> Asana::Resources::Resource?
1278
+ def fetch_gid_by_type: (String resource_type, String gid) -> (Asana::Resources::Task | Asana::Resources::Section | Asana::Resources::Project)?
1272
1279
 
1273
1280
  # _@param_ `gid`
1274
1281
  def fetch_task_gid: (String gid) -> Asana::Resources::Task?
@@ -1503,11 +1510,11 @@ module Checkoff
1503
1510
  # _@param_ `uri`
1504
1511
  #
1505
1512
  # _@param_ `verify_mode` — - e.g., OpenSSL::SSL::VERIFY_NONE,OpenSSL::SSL::VERIFY_PEER
1506
- def download_uri: (URI::Generic uri, ?verify_mode: Integer) ?{ (*untyped args) -> untyped } -> Object
1513
+ def download_uri: (URI::Generic uri, ?verify_mode: Integer) { (File tempfile) -> Asana::Resources::Attachment? } -> Asana::Resources::Attachment?
1507
1514
 
1508
1515
  # sord duck - #read_body looks like a duck type, replacing with untyped
1509
1516
  # _@param_ `response`
1510
- def write_tempfile_from_response: (untyped response) -> void
1517
+ def write_tempfile_from_response: (untyped response) { (File tempfile) -> void } -> void
1511
1518
 
1512
1519
  # _@param_ `url`
1513
1520
  #
@@ -1956,10 +1963,10 @@ module Checkoff
1956
1963
  # _@param_ `task_hash`
1957
1964
  #
1958
1965
  # _@param_ `memberships`
1959
- def add_user_task_list: (::Hash[String, (String | ::Hash[untyped, untyped] | ::Array[untyped])] task_hash, ::Array[::Hash[untyped, untyped]] memberships) -> void
1966
+ def add_user_task_list: (::Hash[String, Object] task_hash, ::Array[::Hash[untyped, untyped]] memberships) -> void
1960
1967
 
1961
1968
  # _@param_ `task_hash`
1962
- def assignee_hash: (::Hash[String, (String | ::Hash[untyped, untyped] | ::Array[untyped])] task_hash) -> ::Hash[String, Object]
1969
+ def assignee_hash: (::Hash[String, Object] task_hash) -> ::Hash[String, Object]
1963
1970
 
1964
1971
  # _@param_ `task_hash`
1965
1972
  #
@@ -2019,6 +2026,11 @@ module Checkoff
2019
2026
  #
2020
2027
  # _@param_ `field_name`
2021
2028
  def date_or_time_field_by_name: (Asana::Resources::Task task, (Symbol | ::Array[untyped]) field_name) -> (Date | Time)?
2029
+
2030
+ # _@param_ `task`
2031
+ #
2032
+ # _@param_ `field_spec` — [:custom_field, custom field name]
2033
+ def custom_field_by_spec: (Asana::Resources::Task task, ::Array[untyped] field_spec) -> (Time | Date)?
2022
2034
  end
2023
2035
 
2024
2036
  # Manage thread lock variables in a block
@@ -2040,7 +2052,7 @@ module Checkoff
2040
2052
  def initialize: (::Hash[Symbol, untyped] config, Symbol sym, String yaml_filename) -> void
2041
2053
 
2042
2054
  # _@param_ `key`
2043
- def []: (Symbol key) -> Object
2055
+ def []: (Symbol key) -> Object?
2044
2056
 
2045
2057
  # _@param_ `key`
2046
2058
  def fetch: (Symbol key) -> Object
@@ -2112,6 +2124,11 @@ module Checkoff
2112
2124
  #
2113
2125
  # _@param_ `field_name`
2114
2126
  def date_or_time_field_by_name: (Asana::Resources::Project project, (Symbol | ::Array[untyped]) field_name) -> (Date | Time)?
2127
+
2128
+ # _@param_ `project`
2129
+ #
2130
+ # _@param_ `field_spec` — [:custom_field, custom field name]
2131
+ def custom_field_by_spec: (Asana::Resources::Project project, ::Array[untyped] field_spec) -> (Time | Date)?
2115
2132
  end
2116
2133
 
2117
2134
  module SearchUrl
@@ -2143,7 +2160,7 @@ module Checkoff
2143
2160
  def self.merge_args: (*::Hash[String, String] args) -> ::Hash[String, String]
2144
2161
 
2145
2162
  # _@param_ `task_selectors`
2146
- def self.merge_task_selectors: (*::Array[(Symbol | ::Array[untyped])] task_selectors) -> (Symbol | ::Array[untyped] | [Symbol, ::Array[untyped], ::Array[untyped]])
2163
+ def self.merge_task_selectors: (*::Array[(Symbol | ::Array[untyped])] task_selectors) -> (::Array[(Symbol | ::Array[untyped])] | [Symbol, ::Array[untyped], ::Array[untyped]])
2147
2164
  end
2148
2165
 
2149
2166
  # https://developers.asana.com/docs/search-tasks-in-a-workspace
@@ -2225,7 +2242,7 @@ module Checkoff
2225
2242
 
2226
2243
  # custom_field_#{gid}.variant = 'is'
2227
2244
  class Is < Checkoff::Internal::SearchUrl::CustomFieldVariant::CustomFieldVariant
2228
- def convert: () -> [::Hash[String, String], ::Array[(::Array[String] | String | ::Array[untyped])]]
2245
+ def convert: () -> [::Hash[String, String], ::Array[(::Array[String] | String | ::Array[untyped] | Symbol)]]
2229
2246
  end
2230
2247
  end
2231
2248
 
@@ -2537,17 +2554,13 @@ module Checkoff
2537
2554
  # _@param_ `webhook_subscription` — Hash of the request made to webhook POST endpoint - https://app.asana.com/api/1.0/webhooks https://developers.asana.com/reference/createwebhook
2538
2555
  def enrich_webhook_subscription!: (::Hash[untyped, untyped]? webhook_subscription) -> void
2539
2556
 
2540
- # sord warn - "[String" does not appear to be a type
2541
- # sord warn - "nil]" does not appear to be a type
2542
- # sord warn - "[String" does not appear to be a type
2543
- # sord warn - "nil]" does not appear to be a type
2544
2557
  # Attempt to look up a GID in situations where we don't have a
2545
2558
  # resource type provided, and returns the name of the resource.
2546
2559
  #
2547
2560
  # _@param_ `gid`
2548
2561
  #
2549
2562
  # _@param_ `resource_type`
2550
- def enrich_gid: (String gid, ?resource_type: String?) -> [untyped, untyped, untyped, untyped]
2563
+ def enrich_gid: (String gid, ?resource_type: String?) -> ([String, String] | [NilClass, String] | [NilClass, NilClass])
2551
2564
 
2552
2565
  # _@param_ `filter`
2553
2566
  def enrich_filter_parent_gid!: (::Hash[String, (String | ::Array[String])] filter) -> void
@@ -2857,7 +2870,7 @@ module Checkoff
2857
2870
  #
2858
2871
  # _@param_ `_kwargs`
2859
2872
  def initialize: (
2860
- selector: (::Array[(Symbol | ::Array[untyped])] | Symbol),
2873
+ selector: (::Array[(Symbol | ::Array[untyped])] | Symbol | String),
2861
2874
  tasks: Checkoff::Tasks,
2862
2875
  timelines: Checkoff::Timelines,
2863
2876
  custom_fields: Checkoff::CustomFields,
@@ -2870,7 +2883,7 @@ module Checkoff
2870
2883
 
2871
2884
  attr_reader custom_fields: Checkoff::CustomFields
2872
2885
 
2873
- attr_reader selector: (::Array[(Symbol | ::Array[untyped])] | Symbol)
2886
+ attr_reader selector: (::Array[(Symbol | ::Array[untyped])] | Symbol | String)
2874
2887
  end
2875
2888
  end
2876
2889
 
@@ -3044,11 +3057,11 @@ module Checkoff
3044
3057
  # _@param_ `custom_fields`
3045
3058
  #
3046
3059
  # _@param_ `_kwargs`
3047
- def initialize: (selector: (::Array[(Symbol | ::Array[untyped])] | Symbol), custom_fields: Checkoff::CustomFields, **untyped _kwargs) -> void
3060
+ def initialize: (selector: (::Array[(Symbol | ::Array[untyped])] | Symbol | String), custom_fields: Checkoff::CustomFields, **untyped _kwargs) -> void
3048
3061
 
3049
3062
  attr_reader custom_fields: Checkoff::CustomFields
3050
3063
 
3051
- attr_reader selector: (::Array[(Symbol | ::Array[untyped])] | Symbol)
3064
+ attr_reader selector: (::Array[(Symbol | ::Array[untyped])] | Symbol | String)
3052
3065
  end
3053
3066
  end
3054
3067
 
@@ -3109,7 +3122,7 @@ module Checkoff
3109
3122
  #
3110
3123
  # _@param_ `_kwargs`
3111
3124
  def initialize: (
3112
- selector: (::Array[(Symbol | ::Array[untyped])] | Symbol),
3125
+ selector: (::Array[(Symbol | ::Array[untyped])] | Symbol | String),
3113
3126
  projects: Checkoff::Projects,
3114
3127
  portfolios: Checkoff::Portfolios,
3115
3128
  workspaces: Checkoff::Workspaces,
@@ -3122,7 +3135,7 @@ module Checkoff
3122
3135
 
3123
3136
  attr_reader workspaces: Checkoff::Workspaces
3124
3137
 
3125
- attr_reader selector: (::Array[(Symbol | ::Array[untyped])] | Symbol)
3138
+ attr_reader selector: (::Array[(Symbol | ::Array[untyped])] | Symbol | String)
3126
3139
  end
3127
3140
  end
3128
3141
 
@@ -3158,7 +3171,7 @@ module Checkoff
3158
3171
  #
3159
3172
  # _@param_ `kwargs`
3160
3173
  def initialize: (
3161
- selector: (::Array[(Symbol | ::Array[untyped])] | Symbol),
3174
+ selector: (::Array[(Symbol | ::Array[untyped])] | Symbol | String),
3162
3175
  sections: Checkoff::Sections,
3163
3176
  client: Asana::Client,
3164
3177
  **untyped kwargs
@@ -3168,7 +3181,7 @@ module Checkoff
3168
3181
 
3169
3182
  attr_reader client: Asana::Client
3170
3183
 
3171
- attr_reader selector: (::Array[(Symbol | ::Array[untyped])] | Symbol)
3184
+ attr_reader selector: (::Array[(Symbol | ::Array[untyped])] | Symbol | String)
3172
3185
  end
3173
3186
  end
3174
3187
 
@@ -3194,15 +3207,15 @@ module Checkoff
3194
3207
 
3195
3208
  def matches?: () -> bool
3196
3209
 
3197
- # _@param_ `_task`
3210
+ # _@param_ `_resource`
3198
3211
  #
3199
3212
  # _@param_ `_args`
3200
- def evaluate: (Asana::Resources::Task _task, *Object _args) -> Object
3213
+ def evaluate: (Asana::Resources::Resource _resource, *Object _args) -> Object
3201
3214
 
3202
3215
  # _@param_ `object`
3203
3216
  #
3204
3217
  # _@param_ `fn_name`
3205
- def fn?: ((::Array[(Symbol | ::Array[untyped])] | Symbol) object, Symbol fn_name) -> bool
3218
+ def fn?: ((::Array[(Symbol | ::Array[untyped])] | Symbol | String) object, Symbol fn_name) -> bool
3206
3219
 
3207
3220
  def logger: () -> ::Logger
3208
3221
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: checkoff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.269.0
4
+ version: 0.271.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vince Broz