checkoff 0.232.0 → 0.237.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/cli.rb +8 -0
- data/lib/checkoff/internal/search_url/simple_param_converter.rb +21 -0
- data/lib/checkoff/portfolios.rb +1 -3
- data/lib/checkoff/version.rb +1 -1
- data/rbi/checkoff.rbi +2376 -7
- data/sig/checkoff.rbs +1449 -5
- 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: 3721e81c2b0e616139f7377d6cacc03a772f64c33ec479ebcbb5ecd653e2fe22
|
|
4
|
+
data.tar.gz: 8695cd726cb363ba564283c5f93cbb931e8f2016bcd6f6f02822cf776b97fc80
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 19ab21f6d036a0a3fb78cbdc74553f5b877406b4bd9c4332c10a0638e780ac9ae835f26faa05d73d2d92051a99622e8a86cac8935181265007d41b26f7dad1a3
|
|
7
|
+
data.tar.gz: 0de250ef8a7c625631bdf84442cdee2f0b4df5329a56536715e10179661c07788d2eedcde69e489ad3ba1814369a6c41fa089736133af20ee039c62616852af3
|
data/lib/checkoff/cli.rb
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
# frozen_string_literal: true
|
|
5
5
|
|
|
6
|
+
require 'json'
|
|
6
7
|
require 'ostruct'
|
|
7
8
|
require 'gli'
|
|
8
9
|
require 'cache_method'
|
|
@@ -208,13 +209,16 @@ module Checkoff
|
|
|
208
209
|
|
|
209
210
|
# @param workspace [String, Symbol]
|
|
210
211
|
# @param project [String, Symbol]
|
|
212
|
+
#
|
|
211
213
|
# @return [String]
|
|
214
|
+
# @sg-ignore
|
|
212
215
|
def run_on_project(workspace, project)
|
|
213
216
|
tasks_by_section =
|
|
214
217
|
sections.tasks_by_section(workspace, project)
|
|
215
218
|
tasks_by_section.update(tasks_by_section) do |_key, tasks|
|
|
216
219
|
tasks_to_hash(tasks)
|
|
217
220
|
end
|
|
221
|
+
# @sg-ignore
|
|
218
222
|
tasks_by_section.to_json
|
|
219
223
|
end
|
|
220
224
|
|
|
@@ -222,9 +226,11 @@ module Checkoff
|
|
|
222
226
|
# @param project [String, Symbol]
|
|
223
227
|
# @param section [String, Symbol, nil]
|
|
224
228
|
# @return [String]
|
|
229
|
+
# @sg-ignore
|
|
225
230
|
def run_on_section(workspace, project, section)
|
|
226
231
|
section = nil if section == ''
|
|
227
232
|
tasks = sections.tasks(workspace, project, section) || []
|
|
233
|
+
# @sg-ignore
|
|
228
234
|
tasks_to_hash(tasks).to_json
|
|
229
235
|
end
|
|
230
236
|
|
|
@@ -233,9 +239,11 @@ module Checkoff
|
|
|
233
239
|
# @param section [String, Symbol, nil]
|
|
234
240
|
# @param task_name [String]
|
|
235
241
|
# @return [String]
|
|
242
|
+
# @sg-ignore
|
|
236
243
|
def run_on_task(workspace, project, section, task_name)
|
|
237
244
|
section = nil if section == ''
|
|
238
245
|
task = tasks.task(workspace, project, task_name, section_name: section)
|
|
246
|
+
# @sg-ignore
|
|
239
247
|
task_to_hash(task).to_json
|
|
240
248
|
end
|
|
241
249
|
|
|
@@ -145,6 +145,15 @@ module Checkoff
|
|
|
145
145
|
end
|
|
146
146
|
end
|
|
147
147
|
|
|
148
|
+
# Handle 'all_tags.ids' search url param
|
|
149
|
+
class AllTagsIds < SimpleParam
|
|
150
|
+
# @return [Array<String>]
|
|
151
|
+
def convert
|
|
152
|
+
tag_ids = single_value.split('~')
|
|
153
|
+
['tags.all', tag_ids.join(',')]
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
|
|
148
157
|
# Handle 'sort' search url param
|
|
149
158
|
class Sort < SimpleParam
|
|
150
159
|
# @return [Array<String>]
|
|
@@ -182,6 +191,16 @@ module Checkoff
|
|
|
182
191
|
raise "Teach me how to handle #{key} = #{values}"
|
|
183
192
|
end
|
|
184
193
|
end
|
|
194
|
+
|
|
195
|
+
# Handle 'locatedIn' search url param
|
|
196
|
+
class LocatedIn < SimpleParam
|
|
197
|
+
# @return [Array<String>]
|
|
198
|
+
def convert
|
|
199
|
+
return [] if single_value == 'anywhere'
|
|
200
|
+
|
|
201
|
+
raise "Teach me how to handle #{key} = #{values}"
|
|
202
|
+
end
|
|
203
|
+
end
|
|
185
204
|
end
|
|
186
205
|
|
|
187
206
|
# Convert simple parameters - ones where the param name itself
|
|
@@ -220,10 +239,12 @@ module Checkoff
|
|
|
220
239
|
'completion' => SimpleParam::Completion,
|
|
221
240
|
'not_tags.ids' => SimpleParam::NotTagsIds,
|
|
222
241
|
'any_tags.ids' => SimpleParam::AnyTagsIds,
|
|
242
|
+
'all_tags.ids' => SimpleParam::AllTagsIds,
|
|
223
243
|
'subtask' => SimpleParam::Subtask,
|
|
224
244
|
'sort' => SimpleParam::Sort,
|
|
225
245
|
'milestone' => SimpleParam::Milestone,
|
|
226
246
|
'searched_type' => SimpleParam::SearchedType,
|
|
247
|
+
'locatedIn' => SimpleParam::LocatedIn,
|
|
227
248
|
}.freeze
|
|
228
249
|
private_constant :ARGS
|
|
229
250
|
|
data/lib/checkoff/portfolios.rb
CHANGED
|
@@ -17,6 +17,7 @@ module Checkoff
|
|
|
17
17
|
# Pull portfolios from Asana
|
|
18
18
|
class Portfolios
|
|
19
19
|
extend T::Sig
|
|
20
|
+
|
|
20
21
|
# @!parse
|
|
21
22
|
# extend CacheMethod::ClassMethods
|
|
22
23
|
|
|
@@ -57,7 +58,6 @@ module Checkoff
|
|
|
57
58
|
# @param workspace_name [String]
|
|
58
59
|
# @param portfolio_name [String]
|
|
59
60
|
#
|
|
60
|
-
# @sg-ignore
|
|
61
61
|
# @return [Asana::Resources::Portfolio,nil]
|
|
62
62
|
def portfolio(workspace_name, portfolio_name)
|
|
63
63
|
workspace = workspaces.workspace_or_raise(workspace_name)
|
|
@@ -122,10 +122,8 @@ module Checkoff
|
|
|
122
122
|
class << self
|
|
123
123
|
# @return [void]
|
|
124
124
|
def run
|
|
125
|
-
# @sg-ignore
|
|
126
125
|
# @type [String]
|
|
127
126
|
workspace_name = ARGV[0] || raise('Please pass workspace name as first argument')
|
|
128
|
-
# @sg-ignore
|
|
129
127
|
# @type [String]
|
|
130
128
|
portfolio_name = ARGV[1] || raise('Please pass portfolio name as second argument')
|
|
131
129
|
portfolios = Checkoff::Portfolios.new
|
data/lib/checkoff/version.rb
CHANGED