timely-app 1.3.0 → 1.3.2

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.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +34 -22
  3. data/README.md +20 -1
  4. data/bin/timely-app +6 -118
  5. data/lib/timely-app/cli.rb +132 -0
  6. data/lib/timely-app/client/accounts.rb +1 -1
  7. data/lib/timely-app/client/auth.rb +1 -1
  8. data/lib/timely-app/client/clients.rb +1 -1
  9. data/lib/timely-app/client.rb +29 -24
  10. data/lib/timely-app/errors.rb +1 -1
  11. data/lib/timely-app/link_header.rb +2 -2
  12. data/lib/timely-app/params.rb +5 -4
  13. data/lib/timely-app/record.rb +3 -3
  14. data/lib/timely-app/response.rb +6 -5
  15. data/lib/timely-app.rb +16 -16
  16. data/sig/timely-app/cli.rbs +33 -0
  17. data/sig/timely-app/client/accounts.rbs +10 -0
  18. data/sig/timely-app/client/auth.rbs +8 -0
  19. data/sig/timely-app/client/clients.rbs +12 -0
  20. data/sig/timely-app/client/events.rbs +36 -0
  21. data/sig/timely-app/client/forecasts.rbs +12 -0
  22. data/sig/timely-app/client/labels.rbs +16 -0
  23. data/sig/timely-app/client/permissions.rbs +8 -0
  24. data/sig/timely-app/client/projects.rbs +14 -0
  25. data/sig/timely-app/client/reports.rbs +8 -0
  26. data/sig/timely-app/client/roles.rbs +6 -0
  27. data/sig/timely-app/client/teams.rbs +14 -0
  28. data/sig/timely-app/client/user_capacities.rbs +8 -0
  29. data/sig/timely-app/client/users.rbs +16 -0
  30. data/sig/timely-app/client/webhooks.rbs +14 -0
  31. data/sig/timely-app/client.rbs +24 -0
  32. data/sig/timely-app/errors.rbs +24 -0
  33. data/sig/timely-app/link_header.rbs +8 -0
  34. data/sig/timely-app/params.rbs +14 -0
  35. data/sig/timely-app/record.rbs +15 -0
  36. data/sig/timely-app/response.rbs +10 -0
  37. data/sig/timely-app.rbs +6 -0
  38. data/timely-app.gemspec +26 -18
  39. metadata +174 -14
@@ -0,0 +1,33 @@
1
+ module TimelyApp
2
+ class CLI
3
+ attr_reader options: Hash[Symbol, untyped]
4
+ attr_reader client: TimelyApp::Client
5
+
6
+ def initialize: (?Hash[Symbol, untyped] options) -> void
7
+
8
+ def get_config: (String key) -> untyped?
9
+
10
+ def set_config: (String key, untyped value) -> void
11
+
12
+ def command_exists?: (String? cmd) -> bool
13
+
14
+ def call: (String cmd, *untyped args) -> untyped
15
+
16
+ def auth: (String? client_id, String? client_secret) -> void
17
+
18
+ private
19
+
20
+ def config_file_path: () -> String
21
+
22
+ def read_config_file: () -> Hash[String, untyped]?
23
+
24
+ def fetch_account_id: () -> untyped?
25
+
26
+ def fetch_access_token: () -> untyped?
27
+
28
+ def check_access_token: () -> void
29
+
30
+ def save_config_file: (**Hash[Symbol, untyped] options) -> void
31
+ end
32
+ end
33
+
@@ -0,0 +1,10 @@
1
+ module TimelyApp
2
+ class Client
3
+ def get_accounts: () -> untyped
4
+
5
+ def get_account_activities: (Integer account_id, **untyped) -> untyped
6
+
7
+ def get_account: (Integer id) -> untyped
8
+ end
9
+ end
10
+
@@ -0,0 +1,8 @@
1
+ module TimelyApp
2
+ class Client
3
+ def get_oauth_authorize_url: (client_id: String, redirect_uri: String) -> String
4
+
5
+ def post_oauth_token: (client_id: String, client_secret: String, code: String, redirect_uri: String, ?String grant_type) -> untyped
6
+ end
7
+ end
8
+
@@ -0,0 +1,12 @@
1
+ module TimelyApp
2
+ class Client
3
+ def create_client: (name: String, **untyped) -> untyped
4
+
5
+ def get_clients: (**untyped) -> untyped
6
+
7
+ def get_client: (Integer id) -> untyped
8
+
9
+ def update_client: (Integer id, name: String, **untyped) -> untyped
10
+ end
11
+ end
12
+
@@ -0,0 +1,36 @@
1
+ module TimelyApp
2
+ class Client
3
+ def create_event: (day: String, hours: Integer, minutes: Integer, **untyped) -> untyped
4
+
5
+ def create_project_event: (Integer project_id, day: String, hours: Integer, minutes: Integer, **untyped) -> untyped
6
+
7
+ def create_user_event: (Integer user_id, day: String, hours: Integer, minutes: Integer, **untyped) -> untyped
8
+
9
+ def create_bulk_events: (Hash[untyped, untyped] create) -> untyped
10
+
11
+ def delete_event: (Integer id) -> untyped
12
+
13
+ def delete_bulk_events: (Hash[untyped, untyped] delete) -> untyped
14
+
15
+ def get_events: (**untyped) -> untyped
16
+
17
+ def get_project_events: (Integer project_id, **untyped) -> untyped
18
+
19
+ def get_user_events: (Integer user_id, **untyped) -> untyped
20
+
21
+ def update_user_event: (Integer id, Integer user_id, day: String, hours: Integer, minutes: Integer, **untyped) -> untyped
22
+
23
+ def update_project_event: (Integer id, Integer project_id, day: String, hours: Integer, minutes: Integer, **untyped) -> untyped
24
+
25
+ def get_event: (Integer id) -> untyped
26
+
27
+ def start_event_timer: (Integer id) -> untyped
28
+
29
+ def stop_event_timer: (Integer id) -> untyped
30
+
31
+ def update_event: (Integer id, day: String, hours: Integer, minutes: Integer, **untyped) -> untyped
32
+
33
+ def update_bulk_events: (Hash[untyped, untyped] update) -> untyped
34
+ end
35
+ end
36
+
@@ -0,0 +1,12 @@
1
+ module TimelyApp
2
+ class Client
3
+ def create_forecast: (project_id: Integer, **untyped) -> untyped
4
+
5
+ def delete_forecast: (Integer id) -> untyped
6
+
7
+ def get_forecasts: (**untyped) -> untyped
8
+
9
+ def update_forecast: (Integer id, project_id: Integer, estimated_minutes: Integer, **untyped) -> untyped
10
+ end
11
+ end
12
+
@@ -0,0 +1,16 @@
1
+ module TimelyApp
2
+ class Client
3
+ def create_label: (name: String, **untyped) -> untyped
4
+
5
+ def delete_label: (Integer id) -> untyped
6
+
7
+ def get_child_labels: (Integer parent_id) -> untyped
8
+
9
+ def get_labels: (**untyped) -> untyped
10
+
11
+ def get_label: (Integer id) -> untyped
12
+
13
+ def update_label: (Integer id, name: String, **untyped) -> untyped
14
+ end
15
+ end
16
+
@@ -0,0 +1,8 @@
1
+ module TimelyApp
2
+ class Client
3
+ def get_current_user_permissions: () -> untyped
4
+
5
+ def get_user_permissions: (Integer user_id) -> untyped
6
+ end
7
+ end
8
+
@@ -0,0 +1,14 @@
1
+ module TimelyApp
2
+ class Client
3
+ def create_project: (name: String, color: String, client_id: Integer, users: Array[untyped], **untyped) -> untyped
4
+
5
+ def delete_project: (Integer id) -> untyped
6
+
7
+ def get_projects: (**untyped) -> untyped
8
+
9
+ def get_project: (Integer id) -> untyped
10
+
11
+ def update_project: (Integer id, name: String, color: String, client_id: Integer, users: Array[untyped], **untyped) -> untyped
12
+ end
13
+ end
14
+
@@ -0,0 +1,8 @@
1
+ module TimelyApp
2
+ class Client
3
+ def get_reports: (**untyped) -> untyped
4
+
5
+ def get_filter_reports: (**untyped) -> untyped
6
+ end
7
+ end
8
+
@@ -0,0 +1,6 @@
1
+ module TimelyApp
2
+ class Client
3
+ def get_roles: () -> untyped
4
+ end
5
+ end
6
+
@@ -0,0 +1,14 @@
1
+ module TimelyApp
2
+ class Client
3
+ def create_team: (name: String, users: Array[untyped], **untyped) -> untyped
4
+
5
+ def delete_team: (Integer id) -> untyped
6
+
7
+ def get_teams: (**untyped) -> untyped
8
+
9
+ def get_team: (Integer id) -> untyped
10
+
11
+ def update_team: (Integer id, name: String, users: Array[untyped], **untyped) -> untyped
12
+ end
13
+ end
14
+
@@ -0,0 +1,8 @@
1
+ module TimelyApp
2
+ class Client
3
+ def get_users_capacities: (**untyped) -> untyped
4
+
5
+ def get_user_capacities: (user_id: Integer) -> untyped
6
+ end
7
+ end
8
+
@@ -0,0 +1,16 @@
1
+ module TimelyApp
2
+ class Client
3
+ def create_user: (name: String, email: String, role_id: Integer, **untyped) -> untyped
4
+
5
+ def delete_user: (Integer id) -> untyped
6
+
7
+ def get_users: (**untyped) -> untyped
8
+
9
+ def get_user: (Integer id) -> untyped
10
+
11
+ def get_current_user: () -> untyped
12
+
13
+ def update_user: (Integer id, name: String, email: String, role_id: Integer, **untyped) -> untyped
14
+ end
15
+ end
16
+
@@ -0,0 +1,14 @@
1
+ module TimelyApp
2
+ class Client
3
+ def create_webhook: (url: String, **untyped) -> untyped
4
+
5
+ def delete_webhook: (Integer id) -> untyped
6
+
7
+ def get_webhooks: (**untyped) -> untyped
8
+
9
+ def get_webhook: (Integer id) -> untyped
10
+
11
+ def update_webhook: (Integer id, url: String, **untyped) -> untyped
12
+ end
13
+ end
14
+
@@ -0,0 +1,24 @@
1
+ module TimelyApp
2
+ class Client
3
+ attr_accessor account_id: Integer?
4
+
5
+ def initialize: (?Hash[Symbol, untyped] options) -> void
6
+
7
+ def get: (String path, ?Hash[untyped, untyped]? params) -> untyped
8
+
9
+ private
10
+
11
+ def verbose?: () -> bool
12
+
13
+ def host_uri_join: (String path, Hash[untyped, untyped] params) -> String
14
+
15
+ def post: (String path, Hash[untyped, untyped] attributes) -> untyped
16
+
17
+ def put: (String path, ?Hash[untyped, untyped]? attributes) -> untyped
18
+
19
+ def delete: (String path) -> untyped
20
+
21
+ def request: (Net::HTTPRequest http_request, ?Hash[untyped, untyped]? body_object) -> untyped
22
+ end
23
+ end
24
+
@@ -0,0 +1,24 @@
1
+ module TimelyApp
2
+ class Error < StandardError
3
+ attr_reader response: Net::HTTPResponse
4
+ attr_reader errors: untyped?
5
+
6
+ def initialize: (?String? message, response: Net::HTTPResponse, ?untyped? errors) -> void
7
+ end
8
+
9
+ class ClientError < Error
10
+ end
11
+
12
+ class ServerError < Error
13
+ end
14
+
15
+ class UnauthorizedError < ClientError
16
+ end
17
+
18
+ class NotFoundError < ClientError
19
+ end
20
+
21
+ class ForbiddenError < ClientError
22
+ end
23
+ end
24
+
@@ -0,0 +1,8 @@
1
+ module TimelyApp
2
+ module LinkHeader
3
+ REGEXP: Regexp
4
+
5
+ def self.parse: (String string) -> TimelyApp::Record
6
+ end
7
+ end
8
+
@@ -0,0 +1,14 @@
1
+ module TimelyApp
2
+ module Params
3
+ def self.join: (String path, ?Hash[untyped, untyped]? params) -> String
4
+
5
+ def self.encode: (Hash[untyped, untyped] params) -> String
6
+
7
+ private
8
+
9
+ def self.array_escape: (untyped object) -> String
10
+
11
+ def self.escape: (untyped component) -> String
12
+ end
13
+ end
14
+
@@ -0,0 +1,15 @@
1
+ module TimelyApp
2
+ class Record
3
+ def initialize: (?Hash[Symbol, untyped] attributes) -> void
4
+
5
+ def []: (Symbol name) -> untyped
6
+ def []=: (Symbol name, untyped value) -> untyped
7
+
8
+ def method_missing: (Symbol name, *untyped args) { (*untyped) -> untyped } -> untyped
9
+
10
+ def respond_to_missing?: (Symbol name, ?bool include_private) -> bool
11
+
12
+ def to_h: () -> Hash[Symbol, untyped]
13
+ end
14
+ end
15
+
@@ -0,0 +1,10 @@
1
+ module TimelyApp
2
+ module Response
3
+ def self.parse: (Net::HTTPResponse response) -> (TimelyApp::Record | String | :no_content)
4
+
5
+ def self.error: (Net::HTTPResponse response) -> TimelyApp::Error
6
+
7
+ def self.error_class: (Net::HTTPResponse object) -> singleton(TimelyApp::Error)
8
+ end
9
+ end
10
+
@@ -0,0 +1,6 @@
1
+ # RBS type definitions for timely-app gem
2
+
3
+ module TimelyApp
4
+ VERSION: String
5
+ end
6
+
data/timely-app.gemspec CHANGED
@@ -1,38 +1,46 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = "timely-app"
3
- gem.version = File.read(File.expand_path('../lib/timely-app.rb', __FILE__)).match(/VERSION\s*=\s*'(.*?)'/)[1]
3
+ gem.version = File.read(File.expand_path("../lib/timely-app.rb", __FILE__)).match(/VERSION\s*=\s*"(.*?)"/)[1]
4
4
 
5
5
  gem.license = "MIT"
6
6
 
7
7
  gem.platform = Gem::Platform::RUBY
8
8
 
9
- repository_url = "https://github.com/amkisko/timely_app.rb"
10
-
11
9
  gem.authors = ["Andrei Makarov"]
12
- gem.email = ["andrei@kiskolabs.com"]
13
- gem.homepage = repository_url
10
+ gem.email = ["contact@kiskolabs.com"]
11
+ gem.homepage = "https://github.com/amkisko/timely_app.rb"
14
12
  gem.description = "Ruby client for the Timely API"
15
13
  gem.summary = "See description"
16
14
  gem.metadata = {
17
- "homepage" => repository_url,
18
- "source_code_uri" => repository_url,
19
- "bug_tracker_uri" => "#{repository_url}/issues",
20
- "changelog_uri" => "#{repository_url}/blob/main/CHANGELOG.md",
15
+ "homepage" => "https://github.com/amkisko/timely_app.rb",
16
+ "source_code_uri" => "https://github.com/amkisko/timely_app.rb",
17
+ "bug_tracker_uri" => "https://github.com/amkisko/timely_app.rb/issues",
18
+ "changelog_uri" => "https://github.com/amkisko/timely_app.rb/blob/main/CHANGELOG.md",
21
19
  "rubygems_mfa_required" => "true"
22
20
  }
23
21
 
24
- gem.files = Dir.glob("lib/**/*.rb") + Dir.glob("bin/**/*") + %w(CHANGELOG.md LICENSE.md README.md timely-app.gemspec)
22
+ gem.files = Dir.glob("lib/**/*.rb") + Dir.glob("bin/**/*") + Dir.glob("sig/**/*.rbs") + %w[CHANGELOG.md LICENSE.md README.md timely-app.gemspec]
25
23
 
26
- gem.bindir = "bin"
24
+ gem.bindir = "bin"
27
25
  gem.executables = ["timely-app"]
28
26
 
29
- gem.required_ruby_version = ">= 2.5.0"
27
+ gem.required_ruby_version = ">= 3.4"
30
28
  gem.require_path = "lib"
31
29
 
32
- gem.add_development_dependency 'rspec-core', '~> 3'
33
- gem.add_development_dependency 'rspec-expectations', '~> 3'
34
- gem.add_development_dependency 'webmock', '~> 3'
35
- gem.add_development_dependency 'pry', '~> 0.14'
36
- gem.add_development_dependency 'simplecov', '~> 0.21'
37
- gem.add_development_dependency 'simplecov-cobertura', '~> 2'
30
+ gem.add_development_dependency "rspec-core", "~> 3"
31
+ gem.add_development_dependency "polyrun", ">= 2.2.0"
32
+ gem.add_development_dependency "rspec-expectations", "~> 3"
33
+ gem.add_development_dependency "rspec_junit_formatter", "~> 0.6"
34
+ gem.add_development_dependency "simplecov", "~> 0.22"
35
+ gem.add_development_dependency "simplecov-cobertura", "~> 3"
36
+ gem.add_development_dependency "webmock", "~> 3"
37
+ gem.add_development_dependency "pry", "~> 0.15"
38
+ gem.add_development_dependency "standard", "~> 1.52"
39
+ gem.add_development_dependency "standard-custom", "~> 1.0"
40
+ gem.add_development_dependency "standard-performance", "~> 1.8"
41
+ gem.add_development_dependency "standard-rspec", "~> 0.3"
42
+ gem.add_development_dependency "rubocop-rspec", "~> 3.8"
43
+ gem.add_development_dependency "rubocop-thread_safety", "~> 0.7"
44
+ gem.add_development_dependency "rbs", "~> 3"
45
+ gem.add_development_dependency "appraisal", "~> 2"
38
46
  end