allegro_rest_api 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 5ae2111a9684639e37c34216076b46d6c4d206d153fab190d0f51135c4eb623d
4
+ data.tar.gz: 0a4d0d33d0c1fc02683d08222c5c1a37e2737fea1a97d34852aca8798a1239fc
5
+ SHA512:
6
+ metadata.gz: d6b4a244b4bbb8037fc0a72880b0205037a82109f2f8249797c45458ea6339a4fc124d2d804f7d5f0fb431f841ef325929fdbbd6e0290f30670c2c9ffc67fc1c
7
+ data.tar.gz: '0847dcce62d0f047a02a4267606afe003c60555a3fd076761945b182ab0b70dae0e148c962a82889331a998806c7bba74a76c3b61fdfa621251d545bfac464b3'
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,13 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.6
3
+
4
+ Style/StringLiterals:
5
+ Enabled: true
6
+ EnforcedStyle: double_quotes
7
+
8
+ Style/StringLiteralsInInterpolation:
9
+ Enabled: true
10
+ EnforcedStyle: double_quotes
11
+
12
+ Layout/LineLength:
13
+ Max: 120
data/.yardopts ADDED
@@ -0,0 +1,3 @@
1
+ --private
2
+ --list
3
+ --files CHANGELOG.md,LICENSE,README.md
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2022-05-24
4
+
5
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at dawidofdk@o2.pl. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in allegro_rest_api.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rspec", "~> 3.0"
11
+
12
+ gem "rubocop", "~> 1.21"
data/Gemfile.lock ADDED
@@ -0,0 +1,57 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ allegro_rest_api (0.1.0)
5
+ json (>= 1.8.6)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ ast (2.4.2)
11
+ diff-lcs (1.5.0)
12
+ json (2.5.1)
13
+ parallel (1.21.0)
14
+ parser (3.0.3.2)
15
+ ast (~> 2.4.1)
16
+ rainbow (3.0.0)
17
+ rake (13.0.6)
18
+ regexp_parser (2.2.0)
19
+ rexml (3.2.5)
20
+ rspec (3.10.0)
21
+ rspec-core (~> 3.10.0)
22
+ rspec-expectations (~> 3.10.0)
23
+ rspec-mocks (~> 3.10.0)
24
+ rspec-core (3.10.1)
25
+ rspec-support (~> 3.10.0)
26
+ rspec-expectations (3.10.1)
27
+ diff-lcs (>= 1.2.0, < 2.0)
28
+ rspec-support (~> 3.10.0)
29
+ rspec-mocks (3.10.2)
30
+ diff-lcs (>= 1.2.0, < 2.0)
31
+ rspec-support (~> 3.10.0)
32
+ rspec-support (3.10.2)
33
+ rubocop (1.23.0)
34
+ parallel (~> 1.10)
35
+ parser (>= 3.0.0.0)
36
+ rainbow (>= 2.2.2, < 4.0)
37
+ regexp_parser (>= 1.8, < 3.0)
38
+ rexml
39
+ rubocop-ast (>= 1.12.0, < 2.0)
40
+ ruby-progressbar (~> 1.7)
41
+ unicode-display_width (>= 1.4.0, < 3.0)
42
+ rubocop-ast (1.15.0)
43
+ parser (>= 3.0.1.1)
44
+ ruby-progressbar (1.11.0)
45
+ unicode-display_width (2.1.0)
46
+
47
+ PLATFORMS
48
+ x86_64-darwin-20
49
+
50
+ DEPENDENCIES
51
+ allegro_rest_api!
52
+ rake (~> 13.0)
53
+ rspec (~> 3.0)
54
+ rubocop (~> 1.21)
55
+
56
+ BUNDLED WITH
57
+ 2.3.13
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Dmytro Koval
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 all
13
+ 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 THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,82 @@
1
+ # AllegroRestApi
2
+
3
+ ## Installation
4
+
5
+ Install the gem and add to the application's Gemfile by executing:
6
+
7
+ $ bundle add allegro_rest_api
8
+
9
+ If bundler is not being used to manage dependencies, install the gem by executing:
10
+
11
+ $ gem install allegro_rest_api
12
+
13
+ ## Usage
14
+
15
+ ### Example usage
16
+
17
+ ```ruby
18
+ require 'allegro_api'
19
+
20
+ auth = AllegroApi::Auth.new(*Rails.application.credentials.allegro.values)
21
+ # or
22
+ auth = AllegroApi::Auth.new # client_id and secret taken from ENV["ALLEGRO_CLIENT_ID"], ENV["ALLEGRO_SECRET"]
23
+
24
+ auth.fetch_code
25
+ I, [2022-05-24T19:36:53.119343 #20694] INFO -- : confirm in browser: https://allegro.pl/skojarz-aplikacje?code=ehxroj2jz
26
+ =>
27
+ {"device_code"=>"LgR6IU3AuIu8y4KwnEN2eaT241AFetmp",
28
+ "expires_in"=>3600,
29
+ "user_code"=>"ehxroj2jz",
30
+ "interval"=>5,
31
+ "verification_uri"=>"https://allegro.pl/skojarz-aplikacje",
32
+ "verification_uri_complete"=>"https://allegro.pl/skojarz-aplikacje?code=ehxroj2jz"}
33
+
34
+ auth.device_code
35
+ => "LgR6IU3AuIu8y4KwnEN2eaT241AFetmp"
36
+
37
+ # Confirm in browser from link above
38
+
39
+ auth.fetch_access_token
40
+ =>
41
+ {"access_token"=>
42
+ "eyJhbGciOi..gewXuBw",
43
+ "token_type"=>"bearer",
44
+ "refresh_token"=>
45
+ "eyJhbGciOiJSUz..u8BkOxXnqtptdg",
46
+ "expires_in"=>43199,
47
+ "scope"=>"allegro:api:orders:read allegro:api:billing:read allegro:api:payments:read",
48
+ "allegro_api"=>true,
49
+ "jti"=>"61dc1bf1-6921-4831-9a3c-939add1eefaz"}
50
+
51
+ auth.access_token
52
+ => "eyJhbGciOiJSUzI1NiIsInR5cCI6I..D2EjkWgewXuBw"
53
+
54
+ client = AllegroApi::Client.new(auth.access_token)
55
+ client.get('order/checkout-forms')
56
+ "https://api.allegro.pl/order/checkout-forms"
57
+ =>
58
+ {"checkoutForms"=>
59
+ []
60
+ }
61
+
62
+ client.get('order/events')
63
+ => {"events"=>[]}
64
+ ```
65
+
66
+ ## Development
67
+
68
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
69
+
70
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
71
+
72
+ ## Contributing
73
+
74
+ Bug reports and pull requests are welcome on GitHub at https://github.com/dawidof/allegro_rest_api. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/dawidof/allegro_rest_api/blob/main/CODE_OF_CONDUCT.md).
75
+
76
+ ## License
77
+
78
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
79
+
80
+ ## Code of Conduct
81
+
82
+ Everyone interacting in the AllegroApi project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/dawidof/allegro_rest_api/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,12 @@
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 "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/allegro_api/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "allegro_rest_api"
7
+ spec.version = AllegroApi::VERSION
8
+ spec.authors = ["Dmytro Koval"]
9
+ spec.email = ["dawidofdk@o2.pl"]
10
+
11
+ spec.summary = "Simple API REST client for allegro.pl using device auth"
12
+ spec.homepage = "https://github.com/dawidof/allegro_rest_api"
13
+ spec.license = "MIT"
14
+ spec.required_ruby_version = ">= 2.6.0"
15
+
16
+ spec.metadata["homepage_uri"] = spec.homepage
17
+ spec.metadata["source_code_uri"] = "https://github.com/dawidof/allegro_rest_api"
18
+ spec.metadata["changelog_uri"] = "https://github.com/dawidof/allegro_rest_api/blob/main/CHANGELOG.md"
19
+
20
+ # Specify which files should be added to the gem when it is released.
21
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
22
+ spec.files = Dir.chdir(__dir__) do
23
+ `git ls-files -z`.split("\x0").reject do |f|
24
+ (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
25
+ end
26
+ end
27
+ spec.bindir = "exe"
28
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
29
+ spec.require_paths = ["lib"]
30
+
31
+ spec.add_dependency "json", ">= 1.8.6"
32
+ end
@@ -0,0 +1,94 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "logger"
4
+
5
+ module AllegroApi
6
+ #
7
+ # Class Agent provides to make get, post requests, handle simple errors and parse result
8
+ #
9
+ class Agent
10
+ attr_accessor :options, :logger
11
+
12
+ def initialize(options = {})
13
+ @logger = Logger.new($stdout)
14
+ @options = options
15
+ end
16
+
17
+ def fetch(uri, params = {})
18
+ uri = URI(uri)
19
+ body = nil
20
+ begin
21
+ session = Net::HTTP.new(uri.host, uri.port)
22
+ session.use_ssl = uri.scheme == "https"
23
+ response = session.start do |http|
24
+ response, body = make_request(build_request(uri, params), http)
25
+ response
26
+ end
27
+
28
+ parsed_body = parse_response(response, body)
29
+ rescue StandardError => e
30
+ logger.error e.message
31
+
32
+ raise e
33
+ end
34
+ parsed_body
35
+ end
36
+
37
+ protected
38
+
39
+ def build_request(uri, params)
40
+ request_params = params.reject { |k, _v| %i[method headers].include?(k) }
41
+ headers = params[:headers]
42
+ request = case params[:method]
43
+ when :get
44
+ uri.query = URI.encode_www_form(params)
45
+ Net::HTTP::Get.new(uri.request_uri)
46
+ when :post
47
+ request = Net::HTTP::Post.new(uri.path)
48
+ request.set_form_data(request_params)
49
+ request
50
+ end
51
+ headers.each { |k, v| request[k.to_s] = v }
52
+ request
53
+ end
54
+
55
+ def make_request(request, http)
56
+ body = []
57
+ response = begin
58
+ http.request(request) do |resp|
59
+ resp.read_body do |segment|
60
+ body << segment
61
+ end
62
+ end
63
+ rescue StandardError => e
64
+ logger.error e.message
65
+ ensure
66
+ body = body.join
67
+ end
68
+
69
+ [response, body]
70
+ end
71
+
72
+ def parse_response(response, body)
73
+ case response
74
+ when Net::HTTPSuccess
75
+ parse_body(body, response.content_type)
76
+ when Net::HTTPRedirection
77
+ raise StandardError, response.message
78
+ else
79
+ body = parse_body(body, response.content_type)
80
+ return body if body.is_a?(Hash)
81
+
82
+ raise StandardError, response.message
83
+ end
84
+ end
85
+
86
+ def parse_body(body, content_type)
87
+ json?(content_type) ? JSON.parse(body) : body
88
+ end
89
+
90
+ def json?(content_type)
91
+ !!content_type.match(%r{application/(vnd\.allegro\.public\.v\d+\+json|json)})
92
+ end
93
+ end
94
+ end
@@ -0,0 +1,91 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "logger"
4
+
5
+ module AllegroApi
6
+ #
7
+ # Class Auth provides Authorisation to get device code or access token
8
+ #
9
+ class Auth
10
+ AUTH_URI = "https://allegro.pl/auth/oauth"
11
+
12
+ attr_reader :http_agent, :access_token, :token_type, :device_code
13
+ attr_accessor :logger
14
+
15
+ #
16
+ # Provide client_id and secret
17
+ #
18
+ # @param [String] client_id Allegro client_id
19
+ # @param [Integer] secret Allegro secret
20
+ # @param [Hash] options options for agent
21
+ #
22
+ def initialize(client_id = ENV["ALLEGRO_CLIENT_ID"], secret = ENV["ALLEGRO_SECRET"], options = {})
23
+ @client_id = client_id
24
+ @secret = secret
25
+ @http_agent = AllegroApi::Agent.new(options)
26
+ @logger = Logger.new($stdout)
27
+ end
28
+
29
+ #
30
+ # Fetching device_code
31
+ # Also it's needing to confirm, info will show
32
+ #
33
+ #
34
+ # @return [JSON] response with device_code
35
+ #
36
+ def fetch_code
37
+ response = @http_agent.fetch(
38
+ auth_url("device"),
39
+ default_params.merge(client_id: @client_id)
40
+ )
41
+ logger.info "confirm in browser: #{response["verification_uri_complete"]}"
42
+ @device_code = response["device_code"]
43
+ response
44
+ end
45
+
46
+ #
47
+ # Method to get access_token to make request to allegro API
48
+ # auth = AllegroApi::Auth.new
49
+ # auth.fetch_code
50
+ # auth.fetch_access_token(auth.device_code)
51
+ #
52
+ # @param [String] code Device code received from `fetch_code` method
53
+ # Could be fetched by
54
+ # auth = AllegroApi::Auth.new
55
+ # auth.fetch_code
56
+ # auth.device_code
57
+ #
58
+ # @return [JSON] response with access_token
59
+ #
60
+ def fetch_access_token(code = @device_code)
61
+ response = @http_agent.fetch(
62
+ auth_url("token"),
63
+ default_params.merge(
64
+ grant_type: "urn:ietf:params:oauth:grant-type:device_code",
65
+ device_code: code
66
+ )
67
+ )
68
+ @access_token = response["access_token"]
69
+ @token_type = response["token_type"]
70
+ response
71
+ end
72
+
73
+ def auth_url(url)
74
+ [AUTH_URI, url.to_s].join("/")
75
+ end
76
+
77
+ def default_params
78
+ {
79
+ method: :post, headers: default_headers
80
+ }
81
+ end
82
+
83
+ def default_headers
84
+ auth_token = Base64.strict_encode64("#{@client_id}:#{@secret}")
85
+ {
86
+ authorization: "Basic #{auth_token}",
87
+ content_type: "application/x-www-form-urlencoded"
88
+ }
89
+ end
90
+ end
91
+ end
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "logger"
4
+
5
+ module AllegroApi
6
+ API_URI = "https://api.allegro.pl"
7
+
8
+ #
9
+ # Class Client provides client to make get and post requests
10
+ #
11
+ class Client
12
+ attr_reader :http_agent
13
+ attr_accessor :logger
14
+
15
+ def initialize(access_token, token_type = "bearer", options = {})
16
+ @http_agent = AllegroApi::Agent.new(options)
17
+ @logger = Logger.new($stdout)
18
+ @access_token = access_token
19
+ @token_type = token_type
20
+ end
21
+
22
+ def get(resource, params = {})
23
+ @http_agent.fetch(
24
+ api_url(resource), default_params.merge(params)
25
+ )
26
+ end
27
+
28
+ def post(resource, params)
29
+ @http_agent.fetch(
30
+ api_url(resource), { headers: default_headers, method: :post }.merge(params)
31
+ )
32
+ end
33
+
34
+ def search(params)
35
+ @http_agent.fetch(
36
+ api_url("offers/listing"), default_params.merge(params)
37
+ )
38
+ end
39
+
40
+ def api_url(url)
41
+ [API_URI, url.to_s].join("/")
42
+ end
43
+
44
+ def default_params
45
+ {
46
+ method: :get, headers: default_headers
47
+ }
48
+ end
49
+
50
+ def default_headers
51
+ {
52
+ accept: "application/vnd.allegro.public.v1+json",
53
+ authorization: "#{@token_type} #{@access_token}"
54
+ }
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AllegroApi
4
+ VERSION = "0.1.0"
5
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "net/http"
4
+ require "json"
5
+ require "base64"
6
+ require_relative "allegro_api/version"
7
+ require_relative "allegro_api/auth"
8
+ require_relative "allegro_api/client"
9
+ require_relative "allegro_api/agent"
10
+
11
+ module AllegroApi
12
+ class Error < StandardError; end
13
+ end
@@ -0,0 +1,4 @@
1
+ module AllegroApi
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,77 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: allegro_rest_api
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Dmytro Koval
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2022-05-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: json
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 1.8.6
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 1.8.6
27
+ description:
28
+ email:
29
+ - dawidofdk@o2.pl
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - ".rspec"
35
+ - ".rubocop.yml"
36
+ - ".yardopts"
37
+ - CHANGELOG.md
38
+ - CODE_OF_CONDUCT.md
39
+ - Gemfile
40
+ - Gemfile.lock
41
+ - LICENSE
42
+ - README.md
43
+ - Rakefile
44
+ - allegro_rest_api.gemspec
45
+ - lib/allegro_api.rb
46
+ - lib/allegro_api/agent.rb
47
+ - lib/allegro_api/auth.rb
48
+ - lib/allegro_api/client.rb
49
+ - lib/allegro_api/version.rb
50
+ - sig/allegro_api.rbs
51
+ homepage: https://github.com/dawidof/allegro_rest_api
52
+ licenses:
53
+ - MIT
54
+ metadata:
55
+ homepage_uri: https://github.com/dawidof/allegro_rest_api
56
+ source_code_uri: https://github.com/dawidof/allegro_rest_api
57
+ changelog_uri: https://github.com/dawidof/allegro_rest_api/blob/main/CHANGELOG.md
58
+ post_install_message:
59
+ rdoc_options: []
60
+ require_paths:
61
+ - lib
62
+ required_ruby_version: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: 2.6.0
67
+ required_rubygems_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ requirements: []
73
+ rubygems_version: 3.2.15
74
+ signing_key:
75
+ specification_version: 4
76
+ summary: Simple API REST client for allegro.pl using device auth
77
+ test_files: []