checkoff 0.276.0 → 0.278.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/lib/checkoff/attachments.rb +1 -1
- data/lib/checkoff/internal/asana_event_filter.rb +7 -6
- data/lib/checkoff/internal/project_hashes.rb +1 -1
- data/lib/checkoff/internal/search_url/custom_field_param_converter.rb +2 -2
- data/lib/checkoff/internal/search_url/custom_field_variant.rb +5 -5
- data/lib/checkoff/internal/search_url/parser.rb +2 -1
- data/lib/checkoff/internal/search_url/simple_param_converter.rb +3 -3
- data/lib/checkoff/my_tasks.rb +3 -3
- data/lib/checkoff/sections.rb +2 -2
- data/lib/checkoff/subtasks.rb +3 -2
- data/lib/checkoff/task_searches.rb +1 -1
- data/lib/checkoff/tasks.rb +2 -1
- data/lib/checkoff/version.rb +1 -1
- data/rbi/checkoff.rbi +4 -4
- data/sig/checkoff.rbs +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fed85fe1084bf6635a8cf97dd03859317e12530a83d5b47703919a5caee8d060
|
|
4
|
+
data.tar.gz: 10ccf5ad0419fb660a268b4474e8533fafb082ea56a18cceda6b552ac79b1005
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b405a340f496a914deb4f65c3eed15037ab229601ff27bd86efaf43c7290681f8e52e6c8f4638df5730acd08d4aa97b12fc83ea0c463d0de048c732e2cc3ed87
|
|
7
|
+
data.tar.gz: 172c30bb1d90defa5e585bd29c6c87ae356f08a0592c7fc4ca7ecbfd7a35500ad0d9bba8b0011cf78690e868ca1e5d5103c2bdc25c37c16a1f225a93ac2e5fe5
|
data/lib/checkoff/attachments.rb
CHANGED
|
@@ -155,7 +155,7 @@ module Checkoff
|
|
|
155
155
|
'resource_subtype' => 'external',
|
|
156
156
|
'name' => attachment_name,
|
|
157
157
|
}
|
|
158
|
-
options = {}
|
|
158
|
+
options = {} #: Hash[Symbol, untyped]
|
|
159
159
|
Asana::Resources::Attachment.new(parse(client.post('/attachments', body: with_params, options:)).first,
|
|
160
160
|
client:)
|
|
161
161
|
end
|
|
@@ -35,7 +35,7 @@ module Checkoff
|
|
|
35
35
|
logger.debug { "Filtering using #{@filters.inspect}" }
|
|
36
36
|
return true if @filters.nil?
|
|
37
37
|
|
|
38
|
-
failures = []
|
|
38
|
+
failures = [] #: Array[untyped]
|
|
39
39
|
|
|
40
40
|
@filters.any? do |filter|
|
|
41
41
|
filter_matches = filter_matches_asana_event?(filter, asana_event, failures)
|
|
@@ -74,19 +74,20 @@ module Checkoff
|
|
|
74
74
|
#
|
|
75
75
|
# @return [Boolean]
|
|
76
76
|
def asana_event_matches_filter_item?(key, value, asana_event)
|
|
77
|
+
no_hash = {} #: Hash[String, untyped]
|
|
77
78
|
case key
|
|
78
79
|
when 'resource_type'
|
|
79
|
-
asana_event.fetch('resource',
|
|
80
|
+
asana_event.fetch('resource', no_hash)['resource_type'] == value
|
|
80
81
|
when 'resource_subtype'
|
|
81
|
-
asana_event.fetch('resource',
|
|
82
|
+
asana_event.fetch('resource', no_hash)['resource_subtype'] == value
|
|
82
83
|
when 'action'
|
|
83
84
|
asana_event['action'] == value
|
|
84
85
|
when 'fields'
|
|
85
|
-
value.include? asana_event.fetch('change',
|
|
86
|
+
value.include? asana_event.fetch('change', no_hash)['field']
|
|
86
87
|
when 'checkoff:parent.gid'
|
|
87
|
-
asana_event.fetch('parent',
|
|
88
|
+
asana_event.fetch('parent', no_hash)['gid'] == value
|
|
88
89
|
when 'checkoff:resource.gid'
|
|
89
|
-
asana_event.fetch('resource',
|
|
90
|
+
asana_event.fetch('resource', no_hash)['gid'] == value
|
|
90
91
|
when 'checkoff:fetched.section.gid'
|
|
91
92
|
fields = ['memberships.project.gid', 'memberships.project.name',
|
|
92
93
|
'memberships.section.name', 'assignee', 'assignee_section']
|
|
@@ -37,7 +37,7 @@ module Checkoff
|
|
|
37
37
|
# }}}]
|
|
38
38
|
def project_to_h(project_obj, project: :not_specified)
|
|
39
39
|
project = project_obj.name if project == :not_specified
|
|
40
|
-
project_hash = { **project_obj.to_h, 'project' => project }
|
|
40
|
+
project_hash = { **project_obj.to_h, 'project' => project } #: Hash[String, untyped]
|
|
41
41
|
project_hash['unwrapped'] = {}
|
|
42
42
|
unwrap_custom_fields(project_hash)
|
|
43
43
|
project_hash
|
|
@@ -18,9 +18,9 @@ module Checkoff
|
|
|
18
18
|
# @return [Array(Hash{String => String}, Array<Symbol, Array>)]
|
|
19
19
|
def convert
|
|
20
20
|
# @type args [Hash{String => String}]
|
|
21
|
-
args = {}
|
|
21
|
+
args = {} #: Hash[String, String]
|
|
22
22
|
# @type task_selector [Array<Symbol, Array>]
|
|
23
|
-
task_selector = []
|
|
23
|
+
task_selector = [] #: Array[Symbol | Array[untyped]]
|
|
24
24
|
by_custom_field.each do |gid, single_custom_field_params|
|
|
25
25
|
new_args, new_task_selector = convert_single_custom_field_params(gid,
|
|
26
26
|
single_custom_field_params)
|
|
@@ -61,7 +61,7 @@ module Checkoff
|
|
|
61
61
|
# @return [Array(Hash{String => String}, Array<Array<String>,String>)]
|
|
62
62
|
def convert
|
|
63
63
|
max_value = fetch_solo_param("custom_field_#{gid}.max")
|
|
64
|
-
empty_task_selector = []
|
|
64
|
+
empty_task_selector = [] #: Array[Array[String] | String]
|
|
65
65
|
[{ "custom_fields.#{gid}.less_than" => max_value }, empty_task_selector]
|
|
66
66
|
end
|
|
67
67
|
end
|
|
@@ -71,7 +71,7 @@ module Checkoff
|
|
|
71
71
|
# @return [Array(Hash{String => String}, Array<Array<String>,String>)]
|
|
72
72
|
def convert
|
|
73
73
|
max_value = fetch_solo_param("custom_field_#{gid}.min")
|
|
74
|
-
empty_task_selector = []
|
|
74
|
+
empty_task_selector = [] #: Array[Array[String] | String]
|
|
75
75
|
[{ "custom_fields.#{gid}.greater_than" => max_value }, empty_task_selector]
|
|
76
76
|
end
|
|
77
77
|
end
|
|
@@ -81,7 +81,7 @@ module Checkoff
|
|
|
81
81
|
# @return [Array(Hash{String => String}, Array<Array<String>,String>)]
|
|
82
82
|
def convert
|
|
83
83
|
value = fetch_solo_param("custom_field_#{gid}.value")
|
|
84
|
-
empty_task_selector = []
|
|
84
|
+
empty_task_selector = [] #: Array[Array[String] | String]
|
|
85
85
|
[{ "custom_fields.#{gid}.value" => value }, empty_task_selector]
|
|
86
86
|
end
|
|
87
87
|
end
|
|
@@ -177,7 +177,7 @@ module Checkoff
|
|
|
177
177
|
ensure_no_remaining_params!
|
|
178
178
|
|
|
179
179
|
api_params = { "custom_fields.#{gid}.is_set" => 'true' }
|
|
180
|
-
task_selector = []
|
|
180
|
+
task_selector = [] #: Array[Array[String] | String | Array[untyped]]
|
|
181
181
|
[api_params, task_selector]
|
|
182
182
|
end
|
|
183
183
|
end
|
|
@@ -188,7 +188,7 @@ module Checkoff
|
|
|
188
188
|
def convert
|
|
189
189
|
selected_options = fetch_solo_param("custom_field_#{gid}.selected_options").split('~')
|
|
190
190
|
|
|
191
|
-
empty_task_selector = []
|
|
191
|
+
empty_task_selector = [] #: Array[Array[String] | String | Array[untyped]]
|
|
192
192
|
if selected_options.length == 1
|
|
193
193
|
[{ "custom_fields.#{gid}.value" => selected_options.fetch(0) },
|
|
194
194
|
empty_task_selector]
|
|
@@ -68,7 +68,8 @@ module Checkoff
|
|
|
68
68
|
end
|
|
69
69
|
end.transform_values(&:to_h),
|
|
70
70
|
T::Hash[Symbol, T::Hash[String, T::Array[String]]])
|
|
71
|
-
|
|
71
|
+
no_params = {} #: Hash[String, Array[String]]
|
|
72
|
+
[groups.fetch(:custom_field, no_params), groups.fetch(:date, no_params), groups.fetch(:simple, no_params)]
|
|
72
73
|
end
|
|
73
74
|
end
|
|
74
75
|
end
|
|
@@ -70,10 +70,10 @@ module Checkoff
|
|
|
70
70
|
# @param verb [String]
|
|
71
71
|
# @return [Array<String>]
|
|
72
72
|
def convert_from_projects_and_sections(verb)
|
|
73
|
-
projects = []
|
|
74
|
-
sections = []
|
|
73
|
+
projects = [] #: Array[String]
|
|
74
|
+
sections = [] #: Array[String]
|
|
75
75
|
parse_projects_and_sections(projects, sections)
|
|
76
|
-
out = {}
|
|
76
|
+
out = {} #: Hash[String, String]
|
|
77
77
|
out["projects.#{verb}"] = projects.join(',') unless projects.empty?
|
|
78
78
|
out["sections.#{verb}"] = sections.join(',') unless sections.empty?
|
|
79
79
|
out.to_a.flatten
|
data/lib/checkoff/my_tasks.rb
CHANGED
|
@@ -35,7 +35,7 @@ module Checkoff
|
|
|
35
35
|
# @param project [Asana::Resources::Project]
|
|
36
36
|
# @param only_uncompleted [Boolean]
|
|
37
37
|
# @param extra_fields [Array<String>]
|
|
38
|
-
# @return [Hash{String => Enumerable<Asana::Resources::Task>}]
|
|
38
|
+
# @return [Hash{String, nil => Enumerable<Asana::Resources::Task>}]
|
|
39
39
|
def tasks_by_section_for_my_tasks(project,
|
|
40
40
|
only_uncompleted: true,
|
|
41
41
|
extra_fields: [])
|
|
@@ -59,9 +59,9 @@ module Checkoff
|
|
|
59
59
|
#
|
|
60
60
|
# @param tasks [Enumerable<Asana::Resources::Task>]
|
|
61
61
|
# @param project_gid [String]
|
|
62
|
-
# @return [Hash{String => Enumerable<Asana::Resources::Task>}]
|
|
62
|
+
# @return [Hash{String, nil => Enumerable<Asana::Resources::Task>}]
|
|
63
63
|
def by_my_tasks_section(tasks, project_gid)
|
|
64
|
-
by_section = {}
|
|
64
|
+
by_section = {} #: Hash[String?, Array[Asana::Resources::Task]]
|
|
65
65
|
sections = client.sections.get_sections_for_project(project_gid:,
|
|
66
66
|
options: { fields: ['name'] })
|
|
67
67
|
sections.each_entry { |section| by_section[section_key(section.name)] = [] }
|
data/lib/checkoff/sections.rb
CHANGED
|
@@ -204,7 +204,7 @@ module Checkoff
|
|
|
204
204
|
#
|
|
205
205
|
# @return [Asana::Resources::Section, nil]
|
|
206
206
|
def section_by_gid(gid)
|
|
207
|
-
options = {}
|
|
207
|
+
options = {} #: Hash[Symbol, untyped]
|
|
208
208
|
Asana::Resources::Section.new(parse(client.get("/sections/#{gid}", options:)).first,
|
|
209
209
|
client:)
|
|
210
210
|
rescue Asana::Errors::NotFound => e
|
|
@@ -287,7 +287,7 @@ module Checkoff
|
|
|
287
287
|
# @param project_gid [String]
|
|
288
288
|
# @return [Hash{String, nil => Enumerable<Asana::Resources::Task>}]
|
|
289
289
|
def by_section(tasks, project_gid)
|
|
290
|
-
by_section = {}
|
|
290
|
+
by_section = {} #: Hash[String?, Array[Asana::Resources::Task]]
|
|
291
291
|
sections = client.sections.get_sections_for_project(project_gid:,
|
|
292
292
|
options: { fields: ['name'] })
|
|
293
293
|
sections.each_entry { |section| by_section[section_key(section.name)] = [] }
|
data/lib/checkoff/subtasks.rb
CHANGED
|
@@ -44,7 +44,7 @@ module Checkoff
|
|
|
44
44
|
# @return [Hash{nil,String => Enumerable<Asana::Resources::Task>}]
|
|
45
45
|
def by_section(tasks)
|
|
46
46
|
current_section = nil
|
|
47
|
-
by_section = { nil => [] }
|
|
47
|
+
by_section = { nil => [] } #: Hash[String?, Array[Asana::Resources::Task]]
|
|
48
48
|
tasks.each do |task|
|
|
49
49
|
current_section, by_section = file_task_by_section(current_section,
|
|
50
50
|
by_section, task)
|
|
@@ -75,7 +75,8 @@ module Checkoff
|
|
|
75
75
|
# @type [Hash{Symbol => undefined}]
|
|
76
76
|
all_options = projects.task_options(extra_fields: extra_fields + %w[is_rendered_as_separator],
|
|
77
77
|
only_uncompleted:)
|
|
78
|
-
|
|
78
|
+
no_options = {} #: Hash[Symbol, untyped]
|
|
79
|
+
options = all_options.fetch(:options, no_options)
|
|
79
80
|
client.tasks.get_subtasks_for_task(task_gid:,
|
|
80
81
|
# per_page: 100, # stub doesn't have this arg available
|
|
81
82
|
options:)
|
|
@@ -150,7 +150,7 @@ module Checkoff
|
|
|
150
150
|
# @return [Enumerable<Asana::Resources::Task>]
|
|
151
151
|
def iterated_raw_task_search(api_params, workspace_gid:, extra_fields:)
|
|
152
152
|
# https://developers.asana.com/reference/searchtasksforworkspace
|
|
153
|
-
tasks = []
|
|
153
|
+
tasks = [] #: Array[Asana::Resources::Task]
|
|
154
154
|
new_api_params = api_params.dup
|
|
155
155
|
original_sort_by = new_api_params.delete('sort_by')
|
|
156
156
|
# defaults to false
|
data/lib/checkoff/tasks.rb
CHANGED
|
@@ -164,8 +164,9 @@ module Checkoff
|
|
|
164
164
|
only_uncompleted: true)
|
|
165
165
|
all_options = projects.task_options(extra_fields:,
|
|
166
166
|
only_uncompleted:)
|
|
167
|
+
no_options = {} #: Hash[Symbol, untyped]
|
|
167
168
|
# @type [Hash]
|
|
168
|
-
options = all_options.fetch(:options) {
|
|
169
|
+
options = all_options.fetch(:options) { no_options }
|
|
169
170
|
options[:completed_since] = all_options[:completed_since] unless all_options[:completed_since].nil?
|
|
170
171
|
client.tasks.find_by_id(task_gid, options:)
|
|
171
172
|
rescue Asana::Errors::NotFound => e
|
data/lib/checkoff/version.rb
CHANGED
data/rbi/checkoff.rbi
CHANGED
|
@@ -82,7 +82,7 @@ module Overcommit
|
|
|
82
82
|
end
|
|
83
83
|
|
|
84
84
|
module Checkoff
|
|
85
|
-
VERSION = '0.
|
|
85
|
+
VERSION = '0.278.0'
|
|
86
86
|
|
|
87
87
|
class Attachments
|
|
88
88
|
include Logging
|
|
@@ -2572,7 +2572,7 @@ end
|
|
|
2572
2572
|
# typed: ignore
|
|
2573
2573
|
# Command-line and gem client for Asana (unofficial)
|
|
2574
2574
|
module Checkoff
|
|
2575
|
-
VERSION = T.let('0.
|
|
2575
|
+
VERSION = T.let('0.278.0', T.untyped)
|
|
2576
2576
|
|
|
2577
2577
|
# Move tasks from one place to another
|
|
2578
2578
|
class MvSubcommand
|
|
@@ -3523,7 +3523,7 @@ module Checkoff
|
|
|
3523
3523
|
# _@param_ `only_uncompleted`
|
|
3524
3524
|
#
|
|
3525
3525
|
# _@param_ `extra_fields`
|
|
3526
|
-
sig { params(project: Asana::Resources::Project, only_uncompleted: T::Boolean, extra_fields: T::Array[String]).returns(T::Hash[String, T::Enumerable[Asana::Resources::Task]]) }
|
|
3526
|
+
sig { params(project: Asana::Resources::Project, only_uncompleted: T::Boolean, extra_fields: T::Array[String]).returns(T::Hash[T.nilable(String), T::Enumerable[Asana::Resources::Task]]) }
|
|
3527
3527
|
def tasks_by_section_for_my_tasks(project, only_uncompleted: true, extra_fields: []); end
|
|
3528
3528
|
|
|
3529
3529
|
# _@param_ `name`
|
|
@@ -3536,7 +3536,7 @@ module Checkoff
|
|
|
3536
3536
|
# _@param_ `tasks`
|
|
3537
3537
|
#
|
|
3538
3538
|
# _@param_ `project_gid`
|
|
3539
|
-
sig { params(tasks: T::Enumerable[Asana::Resources::Task], project_gid: String).returns(T::Hash[String, T::Enumerable[Asana::Resources::Task]]) }
|
|
3539
|
+
sig { params(tasks: T::Enumerable[Asana::Resources::Task], project_gid: String).returns(T::Hash[T.nilable(String), T::Enumerable[Asana::Resources::Task]]) }
|
|
3540
3540
|
def by_my_tasks_section(tasks, project_gid); end
|
|
3541
3541
|
|
|
3542
3542
|
sig { returns(Checkoff::Projects) }
|
data/sig/checkoff.rbs
CHANGED
|
@@ -786,7 +786,7 @@ module Checkoff
|
|
|
786
786
|
# _@param_ `only_uncompleted`
|
|
787
787
|
#
|
|
788
788
|
# _@param_ `extra_fields`
|
|
789
|
-
def tasks_by_section_for_my_tasks: (Asana::Resources::Project project, ?only_uncompleted: bool, ?extra_fields: ::Array[String]) -> ::Hash[String
|
|
789
|
+
def tasks_by_section_for_my_tasks: (Asana::Resources::Project project, ?only_uncompleted: bool, ?extra_fields: ::Array[String]) -> ::Hash[String?, ::Enumerable[Asana::Resources::Task]]
|
|
790
790
|
|
|
791
791
|
# _@param_ `name`
|
|
792
792
|
def section_key: (String? name) -> String?
|
|
@@ -797,7 +797,7 @@ module Checkoff
|
|
|
797
797
|
# _@param_ `tasks`
|
|
798
798
|
#
|
|
799
799
|
# _@param_ `project_gid`
|
|
800
|
-
def by_my_tasks_section: (::Enumerable[Asana::Resources::Task] tasks, String project_gid) -> ::Hash[String
|
|
800
|
+
def by_my_tasks_section: (::Enumerable[Asana::Resources::Task] tasks, String project_gid) -> ::Hash[String?, ::Enumerable[Asana::Resources::Task]]
|
|
801
801
|
|
|
802
802
|
attr_reader projects: Checkoff::Projects
|
|
803
803
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: checkoff
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.278.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Vince Broz
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-11-
|
|
11
|
+
date: 2026-11-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|