omniauth-highlevel 0.1.0 → 0.1.1

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: 33ad8030586149002bf21383dc17e6785a684e288147a51b165118b5a44f6a48
4
- data.tar.gz: 7073ffcff33009c41cda887765993df9b8af226566a6b21d36d30e1d7bf41833
3
+ metadata.gz: d80e6c9f55ff7ad3bdab69fd961af0ccc74fcc99e1c6ea14ae6d0784b8df0fb0
4
+ data.tar.gz: 94f9d52f3717981ad947254402ae96cdc07cee46655a872125d99860493fcae9
5
5
  SHA512:
6
- metadata.gz: 0d06bc61abd091e7cd754c6e4e0d9a0f17ee4cd19f73beb5b18ca607f24736d9db49225016007b5c198eb9589982fbc0a786d439c54d2b978c8cb70b07583ac5
7
- data.tar.gz: fc578a6369ea1212564ae61ab996544495fb8429896a2f13dfc769df61ecc529c830837bc1b54d3cdafad39d8f3078d61ff115348df7e1c5b51d32c1a5fd2127
6
+ metadata.gz: bc8f77ec73fa3cef0eee8e23b0bd9ff9176603c673ddd3286f82edaaa08420cf03946ad53e983ec321c3902e2686781c886d6444eb5da39b07cf6c9627c40fc5
7
+ data.tar.gz: d52cae239103d0f900a2939a3afd6c7420bd350b4a1cf5414af6ee266464ef53bd7c92bbbdc7e3894e339d1b83fcac153061eb722e8ec25585e79de94b0cbf00
data/bin/console ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "omniauth/highlevel"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ require "irb"
11
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -1,35 +1,55 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'omniauth-oauth2'
4
+
3
5
  module OmniAuth
4
6
  module Strategies
5
7
  class Highlevel < OmniAuth::Strategies::OAuth2
6
- option :name, "highlevel"
8
+ option :name, 'highlevel'
9
+ option :user_type, 'Company'
7
10
 
8
11
  option :client_options, {
9
- site: "https://services.leadconnectorhq.com",
10
- authorize_url: "https://marketplace.gohighlevel.com/oauth/chooselocation",
11
- token_url: "https://services.leadconnectorhq.com/oauth/token"
12
+ site: 'https://services.leadconnectorhq.com',
13
+ authorize_url: 'https://marketplace.gohighlevel.com/oauth/chooselocation',
14
+ token_url: 'https://services.leadconnectorhq.com/oauth/token'
12
15
  }
13
16
 
14
17
  option :authorize_params, {
15
- scope: "locations.readonly users.readonly opportunities.readonly opportunities.write contacts.readonly contacts.write calendars.readonly calendars.write calendars/events.readonly calendars/events.write workflows.readonly"
18
+ scope: 'locations.readonly users.readonly opportunities.readonly opportunities.write contacts.readonly contacts.write calendars.readonly calendars.write calendars/events.readonly calendars/events.write workflows.readonly'
16
19
  }
17
20
 
18
21
  option :token_options, {
19
22
  method: :post
20
23
  }
21
24
 
22
- option :token_params, {
23
- user_type: "Location"
24
- }
25
+ uid { raw_info['user_id'] }
26
+
27
+ credentials do
28
+ hash = { 'token' => access_token.token }
29
+ hash['refresh_token'] = access_token.refresh_token if access_token.expires? && access_token.refresh_token
30
+ hash['expires_at'] = access_token.expires_at if access_token.expires?
31
+ hash['expires'] = access_token.expires?
32
+ hash['companyId'] = raw_info['companyId']
33
+ hash
34
+ end
25
35
 
26
- uid { access_token.params["locationId"] }
36
+ info do
37
+ info = raw_info || {}
38
+ info = deep_symbolize(info)
39
+ info
40
+ end
41
+
42
+ def raw_info
43
+ @raw_info ||= access_token.params
44
+ end
27
45
 
28
46
  def token_params
29
- super.merge({
30
- client_id: client.id,
31
- client_secret: client.secret
32
- })
47
+ super.merge(
48
+ {
49
+ client_id: client.id,
50
+ client_secret: client.secret
51
+ }
52
+ )
33
53
  end
34
54
  end
35
55
  end
@@ -0,0 +1,5 @@
1
+ module Omniauth
2
+ module Highlevel
3
+ VERSION = '0.1.1'
4
+ end
5
+ end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "omniauth/strategies/oauth2"
4
- require "omniauth/strategies/highlevel"
3
+ require 'omniauth-highlevel/version'
4
+ require 'omniauth/strategies/highlevel'
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-highlevel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Troy Clark
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-06 00:00:00.000000000 Z
11
+ date: 2025-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: omniauth
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '2.0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '2.0'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: omniauth-oauth2
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -41,16 +27,16 @@ dependencies:
41
27
  description:
42
28
  email:
43
29
  - troy@troytc.com
44
- executables: []
30
+ executables:
31
+ - console
32
+ - setup
45
33
  extensions: []
46
34
  extra_rdoc_files: []
47
35
  files:
48
- - ".standard.yml"
49
- - CHANGELOG.md
50
- - LICENSE.txt
51
- - README.md
52
- - Rakefile
36
+ - bin/console
37
+ - bin/setup
53
38
  - lib/omniauth-highlevel.rb
39
+ - lib/omniauth-highlevel/version.rb
54
40
  - lib/omniauth/strategies/highlevel.rb
55
41
  homepage: https://github.com/troytc/omniauth-highlevel
56
42
  licenses:
@@ -64,7 +50,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
64
50
  requirements:
65
51
  - - ">="
66
52
  - !ruby/object:Gem::Version
67
- version: 3.0.0
53
+ version: '0'
68
54
  required_rubygems_version: !ruby/object:Gem::Requirement
69
55
  requirements:
70
56
  - - ">="
data/.standard.yml DELETED
@@ -1,3 +0,0 @@
1
- # For available configuration options, see:
2
- # https://github.com/standardrb/standard
3
- ruby_version: 3.0
data/CHANGELOG.md DELETED
@@ -1,5 +0,0 @@
1
- ## [Unreleased]
2
-
3
- ## [0.1.0] - 2024-12-05
4
-
5
- - Initial release
data/LICENSE.txt DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2024 Troy Clark
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
data/README.md DELETED
@@ -1 +0,0 @@
1
- # Omniauth::Highlevel
data/Rakefile DELETED
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "bundler/gem_tasks"
4
- require "rspec/core/rake_task"
5
-
6
- RSpec::Core::RakeTask.new(:spec)
7
-
8
- require "standard/rake"
9
-
10
- task default: %i[spec standard]