checkoff 0.139.0 → 0.147.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: 62b3b8a6d0c4f413c114a5dae032f078c21db566333168896a02f9206f3d1c7a
4
- data.tar.gz: 3611366f9bfb7be6556fc704ea69e5c50b8293ec463606d425e97f118e008298
3
+ metadata.gz: d2cf77737db4f96b50336287995a535b56d94febab4a2de78e83e6467f4fcaa0
4
+ data.tar.gz: 63285583fcd06b843bc5c6679bdb9af2ddf1ae157a966b9c5a0c04966812ff3d
5
5
  SHA512:
6
- metadata.gz: 5d646bcb803baff2c70873e6706d4fe7db2eb0ad20343efe85f839cf9d18716760cf1c1a95329deeb3bf773610589468d4ce645bc3c7c64f916be9e274474654
7
- data.tar.gz: 488b3bc30fbabe4cfd721ad9b23061793dd6989eaea628c197d348ad6dd6084fb96e63e03af1da49ef932732cc11f630428622582a626f7968e62fabb0af4c4c
6
+ metadata.gz: fe8ff80ae724dd967d4faf53c833388a31b159a6154341d3abfe11400ae7eea3e849b34bc21f9f61bf06e9f52a325766dba5f4c60bb01071d6753c832693569e
7
+ data.tar.gz: 3177e4244331287d5ef7435e99568c16910d5dd2c9f28a2977b0b11640c46f18d50d242e78e4e355381299b0b409a012c709f4045958014c45d258a5638c3f04
data/.rubocop.yml CHANGED
@@ -1,4 +1,8 @@
1
1
  ---
2
+ Gemspec/RequireMFA:
3
+ # We publish via CI/CD, so MFA is not possible.
4
+ Enabled: false
5
+
2
6
  Layout/LineLength:
3
7
  Max: 120
4
8
 
data/Gemfile.lock CHANGED
@@ -12,7 +12,7 @@ GIT
12
12
  PATH
13
13
  remote: .
14
14
  specs:
15
- checkoff (0.139.0)
15
+ checkoff (0.147.0)
16
16
  activesupport
17
17
  asana (> 0.10.0)
18
18
  cache_method
data/checkoff.gemspec CHANGED
@@ -31,6 +31,6 @@ Gem::Specification.new do |spec|
31
31
  spec.add_runtime_dependency 'gli'
32
32
 
33
33
  spec.metadata = {
34
- 'rubygems_mfa_required' => 'true',
34
+ 'rubygems_mfa_required' => 'false',
35
35
  }
36
36
  end
@@ -51,6 +51,8 @@ module Checkoff
51
51
  handle_between(prefix)
52
52
  when 'within_last'
53
53
  handle_within_last(prefix)
54
+ when 'within_next'
55
+ handle_within_next(prefix)
54
56
  else
55
57
  raise "Teach me how to handle date mode: #{operator.inspect}."
56
58
  end
@@ -115,6 +117,20 @@ module Checkoff
115
117
  [{ "#{API_PREFIX.fetch(prefix)}.after" => after.to_s }, []]
116
118
  end
117
119
 
120
+ # @param prefix [String]
121
+ # @return [Array(Hash<String, String>, Array<[Symbol, Array]>)] See https://developers.asana.com/docs/search-tasks-in-a-workspace
122
+ def handle_within_next(prefix)
123
+ value = get_single_param("#{prefix}.value").to_i
124
+
125
+ validate_unit_is_day!(prefix)
126
+
127
+ # @sg-ignore
128
+ # @type [Date]
129
+ before = Date.today + value + 1
130
+
131
+ [{ "#{API_PREFIX.fetch(prefix)}.before" => before.to_s }, []]
132
+ end
133
+
118
134
  # @param param_key [String]
119
135
  # @return [String]
120
136
  def get_single_param(param_key)
@@ -65,7 +65,7 @@ module Checkoff
65
65
 
66
66
  # pulls an Asana API project class given a name
67
67
  # @param [String] workspace_name
68
- # @param [String] project_name
68
+ # @param [String,Symbol<:my_tasks>] project_name
69
69
  # @param [Array<String>] extra_fields
70
70
  #
71
71
  # @return [Asana::Resources::Project, nil]
@@ -83,7 +83,7 @@ module Checkoff
83
83
  cache_method :project, LONG_CACHE_TIME
84
84
 
85
85
  # @param workspace_name [String]
86
- # @param project_name [String]
86
+ # @param project_name [String,Symbol<:my_tasks>]
87
87
  # @param [Array<String>] extra_fields
88
88
  #
89
89
  # @return [Asana::Resources::Project]
@@ -13,6 +13,7 @@ require 'asana/resource_includes/collection'
13
13
  require 'asana/resource_includes/response_helper'
14
14
 
15
15
  require 'checkoff/internal/search_url'
16
+ require 'checkoff/internal/logging'
16
17
 
17
18
  # https://developers.asana.com/reference/searchtasksforworkspace
18
19
  module Checkoff
@@ -25,6 +26,7 @@ module Checkoff
25
26
  LONG_CACHE_TIME = MINUTE * 15
26
27
  SHORT_CACHE_TIME = MINUTE
27
28
 
29
+ include Logging
28
30
  include Asana::Resources::ResponseHelper
29
31
 
30
32
  # @!parse
@@ -70,6 +72,7 @@ module Checkoff
70
72
  workspace = workspaces.workspace_or_raise(workspace_name)
71
73
  # @sg-ignore
72
74
  api_params, task_selector = @search_url_parser.convert_params(url)
75
+ debug { "Task search params: api_params=#{api_params}, task_selector=#{task_selector}" }
73
76
  raw_task_search(api_params, workspace_gid: workspace.gid, task_selector: task_selector,
74
77
  extra_fields: extra_fields)
75
78
  end
@@ -95,9 +98,23 @@ module Checkoff
95
98
  options: options)),
96
99
  type: Asana::Resources::Task,
97
100
  client: client)
101
+
102
+ if tasks.length == 100
103
+ raise 'Too many results returned. ' \
104
+ 'Please narrow your search in ways expressible through task search API: ' \
105
+ 'https://developers.asana.com/reference/searchtasksforworkspace'
106
+ end
107
+
108
+ debug { "#{tasks.length} raw tasks returned" }
109
+
98
110
  tasks.select { |task| task_selectors.filter_via_task_selector(task, task_selector) }
99
111
  end
100
112
 
113
+ # @return [Hash]
114
+ def as_cache_key
115
+ {}
116
+ end
117
+
101
118
  private
102
119
 
103
120
  # @param [Array<String>] extra_fields
@@ -3,5 +3,5 @@
3
3
  # Command-line and gem client for Asana (unofficial)
4
4
  module Checkoff
5
5
  # Version of library
6
- VERSION = '0.139.0'
6
+ VERSION = '0.147.0'
7
7
  end
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.139.0
4
+ version: 0.147.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: 2023-11-26 00:00:00.000000000 Z
11
+ date: 2023-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -214,7 +214,7 @@ homepage: https://github.com/apiology/checkoff
214
214
  licenses:
215
215
  - MIT license
216
216
  metadata:
217
- rubygems_mfa_required: 'true'
217
+ rubygems_mfa_required: 'false'
218
218
  post_install_message:
219
219
  rdoc_options: []
220
220
  require_paths: