bloomy 0.11.4 → 0.11.5

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: 54194503af40ece6bf43213c629ef356ace57155c5a2e8a482b0fe6aee05db3d
4
- data.tar.gz: 331f8e7ee2c8b8a81430e8189637516f0de6749ebe015c4088bb5891722b645b
3
+ metadata.gz: d071b4ec08a9bf16f615031f8bf83901546630686140df746419c8f1c1740673
4
+ data.tar.gz: 76788aef37b387aaaf778485764cd1155db7b08ac0dce50c697bf4ffa49c0d86
5
5
  SHA512:
6
- metadata.gz: 6edf8e382af72ec5ad3fe708958437c9e5af9cf84029453002c42a0237bcc327f544642e748da56d0d5fffd50c96722807fd7db6a11393754c8a1bae0986cc44
7
- data.tar.gz: c2e67dfc490dc5cedf8f3994989ff57c30f0e60161d7a6673e40678b24e091277a4a58d8cedd93f702dfe1e7123031b4d55473a33d7706debeb46e66657034c8
6
+ metadata.gz: 12d11081a1bd2789961c9862724dffa5cac215855086c995eecc5753ddaaa07e5f51100a9bb153432654e4cfc2caa9d23e68b0ce3036913ef44f7a91cfa68c21
7
+ data.tar.gz: 233d127739f77c8c4d608a979fb0bc53277945f2af6d1f62c00081c668a22aa3741015d5b1c2d43f08c7c2f4988e41c03377c7f846eda6bdd65e06a24d44304a
@@ -44,8 +44,19 @@ module Bloomy
44
44
  # @return [String] the fetched API key
45
45
  def fetch_api_key(username, password)
46
46
  conn = Faraday.new(url: "https://app.bloomgrowth.com")
47
- response = conn.post("/Token", "grant_type=password&userName=#{username}&password=#{password}",
48
- {"Content-Type" => "application/x-www-form-urlencoded"})
47
+ response = conn.post("/Token") do |req|
48
+ req.headers["Content-Type"] = "application/x-www-form-urlencoded"
49
+ req.body = URI.encode_www_form(
50
+ grant_type: "password",
51
+ userName: username,
52
+ password: password
53
+ )
54
+ end
55
+
56
+ unless response.success?
57
+ raise "Failed to fetch API key: #{response.status} - #{response.body}"
58
+ end
59
+
49
60
  JSON.parse(response.body)["access_token"]
50
61
  end
51
62
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bloomy
4
- VERSION = "0.11.4"
4
+ VERSION = "0.11.5"
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bloomy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.4
4
+ version: 0.11.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franccesco Orozco
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-11-23 00:00:00.000000000 Z
10
+ date: 2025-01-23 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: faraday
@@ -38,7 +37,6 @@ dependencies:
38
37
  - - "~>"
39
38
  - !ruby/object:Gem::Version
40
39
  version: '3.13'
41
- description:
42
40
  email:
43
41
  - franccesco@thatai.dev
44
42
  executables:
@@ -77,7 +75,6 @@ licenses:
77
75
  metadata:
78
76
  homepage_uri: https://github.com/franccesco/bloomy
79
77
  rubygems_mfa_required: 'true'
80
- post_install_message:
81
78
  rdoc_options: []
82
79
  require_paths:
83
80
  - lib
@@ -92,8 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
89
  - !ruby/object:Gem::Version
93
90
  version: '0'
94
91
  requirements: []
95
- rubygems_version: 3.5.23
96
- signing_key:
92
+ rubygems_version: 3.6.2
97
93
  specification_version: 4
98
94
  summary: Manage your Bloom Growth account from the command line.
99
95
  test_files: []