checkoff 0.221.0 → 0.222.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +1 -2
- data/Gemfile.lock +1 -1
- data/config/{definitions.rb → annotations_asana.rb} +31 -38
- data/config/annotations_misc.rb +33 -1
- data/lib/checkoff/attachments.rb +4 -4
- data/lib/checkoff/cli.rb +2 -1
- data/lib/checkoff/clients.rb +3 -4
- data/lib/checkoff/custom_fields.rb +6 -3
- data/lib/checkoff/internal/project_hashes.rb +1 -1
- data/lib/checkoff/internal/selector_classes/project.rb +1 -1
- data/lib/checkoff/internal/selector_classes/task.rb +1 -1
- data/lib/checkoff/projects.rb +6 -6
- data/lib/checkoff/tags.rb +6 -4
- data/lib/checkoff/task_searches.rb +4 -4
- data/lib/checkoff/tasks.rb +9 -9
- data/lib/checkoff/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cddefb59c6b268a9501c151a8c5482baedc1626ff56090a02bacd09a34e4f530
|
4
|
+
data.tar.gz: 733b5e95bab3a468e4fbe54e8215c70bd4d1094e48464b25e04053d29023653e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21d8c9e39760f92e503efbcd98707a3935dffb077677f92e7165767cd7c305673a27810f75bd8640fe79bd6ffc1cd5f616e4787234d9ac4c84ddf4008be344d9
|
7
|
+
data.tar.gz: 2d6aaadfd50a74cccca45efe6ccf866e4da393f2a70bac001e7afbc912acf071a95e765de2f4ee4fb67dbf515e46db61f01c4ddb2ad507dd34e4cb213885b9fc
|
data/.rubocop_todo.yml
CHANGED
@@ -80,12 +80,11 @@ Performance/RedundantEqualityComparisonBlock:
|
|
80
80
|
Exclude:
|
81
81
|
- 'lib/checkoff/internal/selector_classes/task.rb'
|
82
82
|
|
83
|
-
# Offense count:
|
83
|
+
# Offense count: 10
|
84
84
|
# Configuration parameters: RequireForNonPublicMethods.
|
85
85
|
Style/DocumentationMethod:
|
86
86
|
Exclude:
|
87
87
|
- 'spec/**/*'
|
88
88
|
- 'test/**/*'
|
89
89
|
- 'lib/checkoff/cli.rb'
|
90
|
-
- 'lib/checkoff/clients.rb'
|
91
90
|
- 'lib/checkoff/tags.rb'
|
data/Gemfile.lock
CHANGED
@@ -1,34 +1,8 @@
|
|
1
|
+
# typed: strict
|
1
2
|
# frozen_string_literal: true
|
2
3
|
#
|
3
4
|
# rubocop:disable Layout/LineLength
|
4
5
|
# @!parse
|
5
|
-
# module OpenSSL
|
6
|
-
# module SSL
|
7
|
-
# # @type [Integer]
|
8
|
-
# VERIFY_PEER = 1
|
9
|
-
# # @type [Integer]
|
10
|
-
# VERIFY_NONE = 0
|
11
|
-
# end
|
12
|
-
# end
|
13
|
-
# class Time
|
14
|
-
# class << self
|
15
|
-
# # @param time [String]
|
16
|
-
# # @return [Time]
|
17
|
-
# def parse(time); end
|
18
|
-
# end
|
19
|
-
# # https://ruby-doc.org/3.2.2/exts/date/Time.html#method-i-to_date#
|
20
|
-
# # @return [Date]
|
21
|
-
# def to_date; end
|
22
|
-
# end
|
23
|
-
# class Date
|
24
|
-
# class << self
|
25
|
-
# # @param date [String]
|
26
|
-
# # @return [Date]
|
27
|
-
# def parse(date); end
|
28
|
-
# # @return [Date]
|
29
|
-
# def today; end
|
30
|
-
# end
|
31
|
-
# end
|
32
6
|
# module Asana
|
33
7
|
# class Client
|
34
8
|
# # @return [Asana::ProxiedResourceClasses::Task]
|
@@ -48,7 +22,6 @@
|
|
48
22
|
# # @return [Asana::ProxiedResourceClasses::CustomField]
|
49
23
|
# def custom_fields; end
|
50
24
|
# end
|
51
|
-
# class Collection < Asana::Resources::Collection; end
|
52
25
|
# module Resources
|
53
26
|
# # https://developers.asana.com/reference/gettask
|
54
27
|
# class Task
|
@@ -69,6 +42,10 @@
|
|
69
42
|
# # @return [Array<Hash{String => Hash{String => String}}>]
|
70
43
|
# def memberships; end
|
71
44
|
# class << self
|
45
|
+
# # @param client [Asana::Client]
|
46
|
+
# # @param assignee [String]
|
47
|
+
# # @param workspace [String]
|
48
|
+
# # @param name [String]
|
72
49
|
# # @return [Asana::Resources::Task]
|
73
50
|
# def create(client, assignee:, workspace:, name:); end
|
74
51
|
# end
|
@@ -84,18 +61,22 @@
|
|
84
61
|
# def due_date; end
|
85
62
|
# end
|
86
63
|
# class Portfolio
|
64
|
+
# # @param options [Hash] the request I/O options
|
87
65
|
# # @return [Enumerable<Asana::Resources::Project>]
|
88
66
|
# def get_items(options = {}); end
|
89
67
|
# end
|
90
68
|
# end
|
91
69
|
# module Errors
|
92
|
-
# class NotFound <
|
70
|
+
# class NotFound < ::Asana::Errors::APIError; end
|
93
71
|
# end
|
94
72
|
# module Resources
|
95
73
|
# class Workspace
|
96
74
|
# # @return [String, nil]
|
97
75
|
# def html_notes; end
|
98
76
|
# class << self
|
77
|
+
# # @param client [Asana::Client]
|
78
|
+
# # @param id [String]
|
79
|
+
# # @param options [Hash]
|
99
80
|
# # @return [Asana::Resources::Workspace]
|
100
81
|
# def find_by_id(client, id, options: {}); end
|
101
82
|
# end
|
@@ -136,9 +117,9 @@
|
|
136
117
|
# # @param assignee [String] The assignee to filter tasks on.
|
137
118
|
# # @param workspace [String] The workspace or organization to filter tasks on.
|
138
119
|
# # @param project [String] The project to filter tasks on.
|
139
|
-
# # @param section [
|
140
|
-
# # @param tag [
|
141
|
-
# # @param user_task_list [
|
120
|
+
# # @param section [String] The section to filter tasks on.
|
121
|
+
# # @param tag [String] The tag to filter tasks on.
|
122
|
+
# # @param user_task_list [String] The user task list to filter tasks on.
|
142
123
|
# # @param completed_since [String] Only return tasks that are either incomplete or that have been
|
143
124
|
# # completed since this time.
|
144
125
|
# #
|
@@ -164,7 +145,14 @@
|
|
164
145
|
# def find_all(assignee: nil, workspace: nil, project: nil, section: nil,
|
165
146
|
# tag: nil, user_task_list: nil, completed_since: nil,
|
166
147
|
# modified_since: nil, per_page: 20, options: {}); end
|
167
|
-
# # @param
|
148
|
+
# # @param assignee [String]
|
149
|
+
# # @param project [String]
|
150
|
+
# # @param section [String]
|
151
|
+
# # @param workspace [String]
|
152
|
+
# # @param completed_since [Time]
|
153
|
+
# # @param per_page [Integer]
|
154
|
+
# # @param modified_since [Time]
|
155
|
+
# # @param section [Asana::Resources::Section]
|
168
156
|
# # @param options [Hash] the request I/O options.
|
169
157
|
# # @return [Enumerable<Asana::Resources::Task>]
|
170
158
|
# def get_tasks(assignee: nil,
|
@@ -182,6 +170,7 @@
|
|
182
170
|
# end
|
183
171
|
# class Section
|
184
172
|
# # @param project_gid [String]
|
173
|
+
# # @param options [Hash]
|
185
174
|
# # @return [Enumerable<Asana::Resources::Section>]
|
186
175
|
# def get_sections_for_project(project_gid:, options: {}); end
|
187
176
|
# # Returns the complete record for a single section.
|
@@ -194,13 +183,14 @@
|
|
194
183
|
# class Project
|
195
184
|
# # Returns the compact project records for all projects in the workspace.
|
196
185
|
# #
|
197
|
-
# # @param workspace [
|
186
|
+
# # @param workspace [String] The workspace or organization to find projects in.
|
198
187
|
# # @param is_template [Boolean] **Note: This parameter can only be included if a team is also defined, or the workspace is not an organization**
|
199
188
|
# # Filters results to include only template projects.
|
200
189
|
# #
|
201
190
|
# # @param archived [Boolean] Only return projects whose `archived` field takes on the value of
|
202
191
|
# # this parameter.
|
203
192
|
# #
|
193
|
+
# # @param client [Asana::Client]
|
204
194
|
# # @param per_page [Integer] the number of records to fetch per page.
|
205
195
|
# # @param options [Hash] the request I/O options.
|
206
196
|
# # @return [Enumerable<Asana::Resources::Project>]
|
@@ -217,14 +207,14 @@
|
|
217
207
|
# # @param workspace [String] (required) The workspace in which to get the user task list.
|
218
208
|
# # @param options [Hash] the request I/O options
|
219
209
|
# # @return [Asana::Resources::UserTaskList]
|
220
|
-
# def get_user_task_list_for_user(
|
210
|
+
# def get_user_task_list_for_user(user_gid:,
|
221
211
|
# workspace: nil, options: {}); end
|
222
212
|
# end
|
223
213
|
# class Portfolio
|
224
214
|
# # Returns a list of the portfolios in compact representation that are owned
|
225
215
|
# # by the current API user.
|
226
216
|
# #
|
227
|
-
# # @param workspace [
|
217
|
+
# # @param workspace [String] The workspace or organization to filter portfolios on.
|
228
218
|
# # @param owner [String] The user who owns the portfolio. Currently, API users can only get a
|
229
219
|
# # list of portfolios that they themselves own.
|
230
220
|
# #
|
@@ -235,11 +225,11 @@
|
|
235
225
|
# def find_all(workspace: required("workspace"), owner: required("owner"), per_page: 20, options: {}); end
|
236
226
|
# # Returns the complete record for a single portfolio.
|
237
227
|
# #
|
238
|
-
# # @param id [
|
228
|
+
# # @param id [String] The portfolio to get.
|
239
229
|
# # @param options [Hash] the request I/O options.
|
240
230
|
#
|
241
231
|
# # @return [Asana::Resources::Portfolio,nil]
|
242
|
-
# def find_by_id(
|
232
|
+
# def find_by_id(id, options: {}); end
|
243
233
|
# # Get portfolio items
|
244
234
|
# #
|
245
235
|
# # @param portfolio_gid [String] (required) Globally unique identifier for the portfolio.
|
@@ -258,4 +248,7 @@
|
|
258
248
|
# end
|
259
249
|
# end
|
260
250
|
# end
|
251
|
+
# module Asana
|
252
|
+
# include ::Asana::Resources
|
253
|
+
# end
|
261
254
|
# rubocop:enable Layout/LineLength
|
data/config/annotations_misc.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# typed: strict
|
1
2
|
# frozen_string_literal: true
|
2
3
|
|
3
4
|
#
|
@@ -19,7 +20,7 @@
|
|
19
20
|
# # @param key [String]
|
20
21
|
# # @param default [Object]
|
21
22
|
# #
|
22
|
-
# # @return [String,
|
23
|
+
# # @return [String,:none,nil]
|
23
24
|
# def self.fetch(key, default = :none); end
|
24
25
|
# # @param key [String]
|
25
26
|
# #
|
@@ -34,3 +35,34 @@
|
|
34
35
|
# def require(*groups); end
|
35
36
|
# end
|
36
37
|
# end
|
38
|
+
# module OpenSSL
|
39
|
+
# module SSL
|
40
|
+
# # @type [Integer]
|
41
|
+
# VERIFY_PEER = 1
|
42
|
+
# # @type [Integer]
|
43
|
+
# VERIFY_NONE = 0
|
44
|
+
# end
|
45
|
+
# end
|
46
|
+
# class Time
|
47
|
+
# class << self
|
48
|
+
# # @param time [String]
|
49
|
+
# # @param now [nil,Time]
|
50
|
+
# # @return [Time]
|
51
|
+
# def parse(time, now=nil); end
|
52
|
+
# end
|
53
|
+
# # https://ruby-doc.org/3.2.2/exts/date/Time.html#method-i-to_date#
|
54
|
+
# # @return [Date]
|
55
|
+
# def to_date; end
|
56
|
+
# end
|
57
|
+
# class Date
|
58
|
+
# class << self
|
59
|
+
# # @param date [String]
|
60
|
+
# # @param comp [Boolean]
|
61
|
+
# # @param state [Object]
|
62
|
+
# # @return [Date]
|
63
|
+
# def parse(date='-4712-01-01', comp=true, state=Date::ITALY); end
|
64
|
+
# # @param start [Integer]
|
65
|
+
# # @return [Date]
|
66
|
+
# def today(start=Date::ITALY); end
|
67
|
+
# end
|
68
|
+
# end
|
data/lib/checkoff/attachments.rb
CHANGED
@@ -56,7 +56,7 @@ module Checkoff
|
|
56
56
|
# @param resource [Asana::Resources::Resource]
|
57
57
|
# @param attachment_name [String,nil]
|
58
58
|
# @param just_the_url [Boolean]
|
59
|
-
# @param verify_mode [Integer
|
59
|
+
# @param verify_mode [Integer] - e.g., OpenSSL::SSL::VERIFY_NONE or OpenSSL::SSL::VERIFY_PEER
|
60
60
|
#
|
61
61
|
# @return [Asana::Resources::Attachment]
|
62
62
|
def create_attachment_from_url!(url,
|
@@ -79,7 +79,7 @@ module Checkoff
|
|
79
79
|
# not succesful
|
80
80
|
#
|
81
81
|
# @param uri [URI]
|
82
|
-
# @param verify_mode [OpenSSL::SSL::VERIFY_NONE,OpenSSL::SSL::VERIFY_PEER
|
82
|
+
# @param verify_mode [Integer] - e.g., OpenSSL::SSL::VERIFY_NONE,OpenSSL::SSL::VERIFY_PEER
|
83
83
|
#
|
84
84
|
# @return [Object]
|
85
85
|
# @sg-ignore
|
@@ -121,7 +121,7 @@ module Checkoff
|
|
121
121
|
# @param url [String]
|
122
122
|
# @param resource [Asana::Resources::Resource]
|
123
123
|
# @param attachment_name [String,nil]
|
124
|
-
# @param verify_mode [Integer
|
124
|
+
# @param verify_mode [Integer] - e.g., OpenSSL::SSL::VERIFY_NONE,OpenSSL::SSL::VERIFY_PEER
|
125
125
|
#
|
126
126
|
# @return [Asana::Resources::Attachment]
|
127
127
|
def create_attachment_from_downloaded_url!(url, resource, attachment_name:,
|
@@ -141,7 +141,7 @@ module Checkoff
|
|
141
141
|
# @param resource [Asana::Resources::Resource]
|
142
142
|
# @param attachment_name [String,nil]
|
143
143
|
#
|
144
|
-
# @return [Asana::Resources::Attachment
|
144
|
+
# @return [Asana::Resources::Attachment]
|
145
145
|
def create_attachment_from_url_alone!(url, resource, attachment_name:)
|
146
146
|
with_params = {
|
147
147
|
'parent' => resource.gid,
|
data/lib/checkoff/cli.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# typed: ignore
|
2
3
|
|
3
4
|
# frozen_string_literal: true
|
4
5
|
|
@@ -222,7 +223,7 @@ module Checkoff
|
|
222
223
|
|
223
224
|
# Provide ability for CLI to pull Asana items
|
224
225
|
class CheckoffGLIApp
|
225
|
-
extend GLI::App
|
226
|
+
extend ::GLI::App
|
226
227
|
|
227
228
|
program_desc 'Command-line client for Asana (unofficial)'
|
228
229
|
|
data/lib/checkoff/clients.rb
CHANGED
@@ -18,6 +18,8 @@ module Checkoff
|
|
18
18
|
LONG_CACHE_TIME = MINUTE * 15
|
19
19
|
SHORT_CACHE_TIME = MINUTE
|
20
20
|
|
21
|
+
# @param config [Hash]
|
22
|
+
# @param asana_client_class [Class<Asana::Client>]
|
21
23
|
def initialize(config: Checkoff::Internal::ConfigLoader.load(:asana),
|
22
24
|
asana_client_class: Asana::Client)
|
23
25
|
@config = config
|
@@ -33,13 +35,10 @@ module Checkoff
|
|
33
35
|
end
|
34
36
|
end
|
35
37
|
|
36
|
-
private
|
37
|
-
|
38
|
-
attr_reader :workspaces
|
39
|
-
|
40
38
|
# bundle exec ./clients.rb
|
41
39
|
# :nocov:
|
42
40
|
class << self
|
41
|
+
# @return [void]
|
43
42
|
def run
|
44
43
|
clients = Checkoff::Clients.new
|
45
44
|
client = clients.client
|
@@ -143,15 +143,18 @@ module Checkoff
|
|
143
143
|
|
144
144
|
private
|
145
145
|
|
146
|
+
# @param custom_field [Hash{String => [Hash,Array<Hash>]}]
|
147
|
+
#
|
146
148
|
# @sg-ignore
|
147
|
-
# @
|
148
|
-
# @return [Array<String>]
|
149
|
+
# @return [Array<Hash>]
|
149
150
|
def resource_custom_field_enum_values(custom_field)
|
150
151
|
resource_subtype = custom_field.fetch('resource_subtype')
|
151
152
|
case resource_subtype
|
152
153
|
when 'enum'
|
154
|
+
# @type [Array<Hash>]
|
153
155
|
[custom_field.fetch('enum_value')]
|
154
156
|
when 'multi_enum'
|
157
|
+
# @type [Array<Hash>]
|
155
158
|
custom_field.fetch('multi_enum_values')
|
156
159
|
else
|
157
160
|
raise "Teach me how to handle resource_subtype #{resource_subtype}"
|
@@ -159,7 +162,7 @@ module Checkoff
|
|
159
162
|
end
|
160
163
|
|
161
164
|
# @param custom_field [Hash]
|
162
|
-
# @param enum_value [
|
165
|
+
# @param enum_value [Hash{String => String}, nil]
|
163
166
|
# @return [Array<String>]
|
164
167
|
def find_gids(custom_field, enum_value)
|
165
168
|
if enum_value.nil?
|
@@ -9,7 +9,7 @@ module Checkoff
|
|
9
9
|
def initialize(_deps = {}); end
|
10
10
|
|
11
11
|
# @param project_obj [Asana::Resources::Project]
|
12
|
-
# @param project [String, Symbol
|
12
|
+
# @param project [String, Symbol] - :not_specified, :my_tasks
|
13
13
|
#
|
14
14
|
# @return [Hash]
|
15
15
|
def project_to_h(project_obj, project: :not_specified)
|
@@ -30,7 +30,7 @@ module Checkoff
|
|
30
30
|
end
|
31
31
|
|
32
32
|
# @param project [Asana::Resources::Project]
|
33
|
-
# @param period [Symbol
|
33
|
+
# @param period [Symbol] - :now_or_before or :this_week
|
34
34
|
# @return [Boolean]
|
35
35
|
def evaluate(project, period = :now_or_before)
|
36
36
|
@projects.project_ready?(project, period: period)
|
@@ -154,7 +154,7 @@ module Checkoff
|
|
154
154
|
end
|
155
155
|
|
156
156
|
# @param task [Asana::Resources::Task]
|
157
|
-
# @param period [Symbol
|
157
|
+
# @param period [Symbol] - :now_or_before or :this_week
|
158
158
|
# @param ignore_dependencies [Boolean]
|
159
159
|
# @return [Boolean]
|
160
160
|
# rubocop:disable Style/OptionalBooleanParameter
|
data/lib/checkoff/projects.rb
CHANGED
@@ -66,7 +66,7 @@ module Checkoff
|
|
66
66
|
# @param extra_fields [Array<String>]
|
67
67
|
# @param [Boolean] only_uncompleted
|
68
68
|
#
|
69
|
-
# @return [Hash
|
69
|
+
# @return [Hash{Symbol => Object}]
|
70
70
|
def task_options(extra_fields: [], only_uncompleted: false)
|
71
71
|
options = {
|
72
72
|
per_page: 100,
|
@@ -96,7 +96,7 @@ module Checkoff
|
|
96
96
|
|
97
97
|
# pulls an Asana API project class given a name
|
98
98
|
# @param [String] workspace_name
|
99
|
-
# @param [String,Symbol
|
99
|
+
# @param [String,Symbol] project_name - :my_tasks or a project name
|
100
100
|
# @param [Array<String>] extra_fields
|
101
101
|
#
|
102
102
|
# @return [Asana::Resources::Project, nil]
|
@@ -115,7 +115,7 @@ module Checkoff
|
|
115
115
|
cache_method :project, REALLY_LONG_CACHE_TIME
|
116
116
|
|
117
117
|
# @param workspace_name [String]
|
118
|
-
# @param project_name [String,Symbol
|
118
|
+
# @param project_name [String,Symbol] - :my_tasks or a project name
|
119
119
|
# @param [Array<String>] extra_fields
|
120
120
|
#
|
121
121
|
# @return [Asana::Resources::Project]
|
@@ -195,7 +195,7 @@ module Checkoff
|
|
195
195
|
cache_method :projects_by_workspace_name, REALLY_LONG_CACHE_TIME
|
196
196
|
|
197
197
|
# @param project_obj [Asana::Resources::Project]
|
198
|
-
# @param project [String, Symbol
|
198
|
+
# @param project [String, Symbol] - :not_specified, :my_tasks or a project name
|
199
199
|
#
|
200
200
|
# @return [Hash]
|
201
201
|
def project_to_h(project_obj, project: :not_specified)
|
@@ -210,14 +210,14 @@ module Checkoff
|
|
210
210
|
# date is today or in the past.
|
211
211
|
#
|
212
212
|
# @param project [Asana::Resources::Project]
|
213
|
-
# @param period [Symbol
|
213
|
+
# @param period [Symbol,Array] See Checkoff::Timing#in_period? - :now_or_before,:this_week
|
214
214
|
def project_ready?(project, period: :now_or_before)
|
215
215
|
in_period?(project, :ready, period)
|
216
216
|
end
|
217
217
|
|
218
218
|
# @param project [Asana::Resources::Project]
|
219
219
|
# @param field_name [Symbol,Array]
|
220
|
-
# @param period [Symbol
|
220
|
+
# @param period [Symbol,Array] See Checkoff::Timing#in_period? - :now_or_before,:this_week
|
221
221
|
def in_period?(project, field_name, period)
|
222
222
|
# @type [Date,Time,nil]
|
223
223
|
project_date = project_timing.date_or_time_field_by_name(project, field_name)
|
data/lib/checkoff/tags.rb
CHANGED
@@ -41,12 +41,13 @@ module Checkoff
|
|
41
41
|
|
42
42
|
params = build_params(options)
|
43
43
|
|
44
|
-
Asana::Collection.new(parse(client.get("/tags/#{tag.gid}/tasks",
|
45
|
-
|
46
|
-
|
47
|
-
|
44
|
+
Asana::Resources::Collection.new(parse(client.get("/tags/#{tag.gid}/tasks",
|
45
|
+
params: params, options: options[:options])),
|
46
|
+
type: Asana::Resources::Task,
|
47
|
+
client: client)
|
48
48
|
end
|
49
49
|
|
50
|
+
# @return [Asana::Resources::Tag]
|
50
51
|
def tag_or_raise(workspace_name, tag_name)
|
51
52
|
tag = tag(workspace_name, tag_name)
|
52
53
|
raise "Could not find tag #{tag_name} under workspace #{workspace_name}." if tag.nil?
|
@@ -55,6 +56,7 @@ module Checkoff
|
|
55
56
|
end
|
56
57
|
cache_method :tag_or_raise, LONG_CACHE_TIME
|
57
58
|
|
59
|
+
# @return [Asana::Resources::Tag,nil]
|
58
60
|
def tag(workspace_name, tag_name)
|
59
61
|
workspace = workspaces.workspace_or_raise(workspace_name)
|
60
62
|
tags = client.tags.get_tags_for_workspace(workspace_gid: workspace.gid)
|
@@ -82,7 +82,7 @@ module Checkoff
|
|
82
82
|
#
|
83
83
|
# https://developers.asana.com/reference/searchtasksforworkspace
|
84
84
|
#
|
85
|
-
# @param [Hash<
|
85
|
+
# @param [Hash<String, Object>] api_params
|
86
86
|
# @param [String] workspace_gid
|
87
87
|
# @param [Array<String>] extra_fields
|
88
88
|
# @param [Array] task_selector
|
@@ -120,7 +120,7 @@ module Checkoff
|
|
120
120
|
#
|
121
121
|
# https://developers.asana.com/reference/searchtasksforworkspace
|
122
122
|
#
|
123
|
-
# @param [Hash<
|
123
|
+
# @param [Hash<String, Object>] api_params
|
124
124
|
# @param [String] workspace_gid
|
125
125
|
# @param [Array<String>] extra_fields
|
126
126
|
#
|
@@ -146,7 +146,7 @@ module Checkoff
|
|
146
146
|
# see sort_by field at
|
147
147
|
# https://developers.asana.com/reference/searchtasksforworkspace
|
148
148
|
#
|
149
|
-
# @param [Hash<
|
149
|
+
# @param [Hash<String, Object>] api_params
|
150
150
|
# @param [String] workspace_gid
|
151
151
|
# @param [String] url
|
152
152
|
# @param [Array<String>] extra_fields
|
@@ -190,7 +190,7 @@ module Checkoff
|
|
190
190
|
end
|
191
191
|
|
192
192
|
# @param [Array<String>] extra_fields
|
193
|
-
# @return [Hash<
|
193
|
+
# @return [Hash<String, Object>]
|
194
194
|
def calculate_api_options(extra_fields)
|
195
195
|
# @type [Hash<Symbol, Object>]
|
196
196
|
all_options = projects.task_options(extra_fields: ['custom_fields'] + extra_fields)
|
data/lib/checkoff/tasks.rb
CHANGED
@@ -77,7 +77,7 @@ module Checkoff
|
|
77
77
|
# * start at is before now
|
78
78
|
#
|
79
79
|
# @param task [Asana::Resources::Task]
|
80
|
-
# @param period [Symbol
|
80
|
+
# @param period [Symbol] - :now_or_before or :this_week
|
81
81
|
# @param ignore_dependencies [Boolean]
|
82
82
|
def task_ready?(task, period: :now_or_before, ignore_dependencies: false)
|
83
83
|
return false if !ignore_dependencies && incomplete_dependencies?(task)
|
@@ -87,7 +87,7 @@ module Checkoff
|
|
87
87
|
|
88
88
|
# @param task [Asana::Resources::Task]
|
89
89
|
# @param field_name [Symbol,Array]
|
90
|
-
# @param period [Symbol
|
90
|
+
# @param period [Symbol,Array] :now_or_before, :this_week - See Checkoff::Timing#in_period?_
|
91
91
|
def in_period?(task, field_name, period)
|
92
92
|
# @type [Date,Time,nil]
|
93
93
|
task_date_or_time = task_timing.date_or_time_field_by_name(task, field_name)
|
@@ -123,6 +123,7 @@ module Checkoff
|
|
123
123
|
only_uncompleted: true,
|
124
124
|
extra_fields: [])
|
125
125
|
thread_local = Checkoff::Internal::ThreadLocal.new
|
126
|
+
# @type [String]
|
126
127
|
task_gid = thread_local.with_thread_local_variable(:suppress_asana_webhook_watch_creation,
|
127
128
|
true) do
|
128
129
|
gid_for_task(workspace_name, project_name, section_name, task_name)
|
@@ -161,7 +162,6 @@ module Checkoff
|
|
161
162
|
def task_by_gid(task_gid,
|
162
163
|
extra_fields: [],
|
163
164
|
only_uncompleted: true)
|
164
|
-
# @type [Hash{Symbol => Object}]
|
165
165
|
all_options = projects.task_options(extra_fields: extra_fields,
|
166
166
|
only_uncompleted: only_uncompleted)
|
167
167
|
# @type [Hash]
|
@@ -223,17 +223,17 @@ module Checkoff
|
|
223
223
|
parent_task_gid = parent_task_info.fetch('gid')
|
224
224
|
|
225
225
|
parent_task = task_by_gid(parent_task_gid, only_uncompleted: false)
|
226
|
-
parent_task.completed_at.nil?
|
226
|
+
T.must(parent_task).completed_at.nil?
|
227
227
|
end
|
228
228
|
end
|
229
229
|
|
230
230
|
# @param task [Asana::Resources::Task]
|
231
231
|
# @param extra_task_fields [Array<String>]
|
232
232
|
#
|
233
|
-
# @return [Array<
|
233
|
+
# @return [Array<Asana::Resources::Task>]
|
234
234
|
def all_dependent_tasks(task, extra_task_fields: [])
|
235
|
-
# @type [Array<
|
236
|
-
dependent_tasks = T.let([], T::Array[
|
235
|
+
# @type [Array<Asana::Resources::Task>]
|
236
|
+
dependent_tasks = T.let([], T::Array[Asana::Resources::Task])
|
237
237
|
# See note above - same applies as does in @dependencies
|
238
238
|
#
|
239
239
|
# @type [Array<Hash>]
|
@@ -249,7 +249,7 @@ module Checkoff
|
|
249
249
|
dependent_task = task_by_gid(dependent_task_hash.fetch('gid'),
|
250
250
|
only_uncompleted: true,
|
251
251
|
extra_fields: ['dependents'] + extra_task_fields)
|
252
|
-
debug { "#{task.name} has dependent task #{dependent_task.name}" }
|
252
|
+
debug { "#{task.name} has dependent task #{T.must(dependent_task).name}" }
|
253
253
|
next if dependent_task.nil?
|
254
254
|
|
255
255
|
dependent_tasks << dependent_task
|
@@ -343,7 +343,7 @@ module Checkoff
|
|
343
343
|
|
344
344
|
# @param workspace_name [String]
|
345
345
|
# @param project_name [String, Symbol]
|
346
|
-
# @param section_name [String, nil, Symbol
|
346
|
+
# @param section_name [String, nil, Symbol] - :unspecified
|
347
347
|
# @param only_uncompleted [Boolean]
|
348
348
|
# @param extra_fields [Array<String>]
|
349
349
|
#
|
data/lib/checkoff/version.rb
CHANGED
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.222.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: 2024-12-
|
11
|
+
date: 2024-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -143,8 +143,8 @@ files:
|
|
143
143
|
- bin/tapioca
|
144
144
|
- bin/yard
|
145
145
|
- checkoff.gemspec
|
146
|
+
- config/annotations_asana.rb
|
146
147
|
- config/annotations_misc.rb
|
147
|
-
- config/definitions.rb
|
148
148
|
- config/env.1p
|
149
149
|
- docs/.gitignore
|
150
150
|
- docs/cookiecutter_input.json
|