pirsch_api 0.0.1 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +9 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +64 -5
  5. data/lib/pirsch_api/client.rb +53 -12
  6. data/lib/pirsch_api/error.rb +4 -0
  7. data/lib/pirsch_api/object.rb +19 -0
  8. data/lib/pirsch_api/objects/active.rb +4 -0
  9. data/lib/pirsch_api/objects/domain.rb +7 -0
  10. data/lib/pirsch_api/objects/duration_page.rb +4 -0
  11. data/lib/pirsch_api/objects/duration_session.rb +4 -0
  12. data/lib/pirsch_api/objects/event.rb +4 -0
  13. data/lib/pirsch_api/objects/growth.rb +4 -0
  14. data/lib/pirsch_api/objects/page.rb +4 -0
  15. data/lib/pirsch_api/objects/referrer.rb +4 -0
  16. data/lib/pirsch_api/objects/token.rb +4 -0
  17. data/lib/pirsch_api/objects/utm_campaign.rb +4 -0
  18. data/lib/pirsch_api/objects/utm_medium.rb +4 -0
  19. data/lib/pirsch_api/objects/utm_source.rb +4 -0
  20. data/lib/pirsch_api/objects/visitor.rb +4 -0
  21. data/lib/pirsch_api/resources/base.rb +57 -0
  22. data/lib/pirsch_api/resources/domain.rb +11 -0
  23. data/lib/pirsch_api/resources/statistics/active.rb +11 -0
  24. data/lib/pirsch_api/resources/statistics/duration_page.rb +11 -0
  25. data/lib/pirsch_api/resources/statistics/duration_session.rb +11 -0
  26. data/lib/pirsch_api/resources/statistics/event.rb +10 -0
  27. data/lib/pirsch_api/resources/statistics/growth.rb +11 -0
  28. data/lib/pirsch_api/resources/statistics/page.rb +11 -0
  29. data/lib/pirsch_api/resources/statistics/referrer.rb +11 -0
  30. data/lib/pirsch_api/resources/statistics/utm_campaign.rb +11 -0
  31. data/lib/pirsch_api/resources/statistics/utm_medium.rb +11 -0
  32. data/lib/pirsch_api/resources/statistics/utm_source.rb +11 -0
  33. data/lib/pirsch_api/resources/statistics/visitor.rb +11 -0
  34. data/lib/pirsch_api/{token.rb → resources/token.rb} +8 -6
  35. data/lib/pirsch_api/version.rb +1 -1
  36. data/lib/pirsch_api.rb +37 -2
  37. metadata +32 -6
  38. data/pkg/plausible_api-0.1.0.gem +0 -0
  39. data/pkg/plausible_api-0.1.7.gem +0 -0
  40. data/pkg/plausible_api-0.1.8.gem +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe170bae8684aadfe97a08ea60a306b3d04d049b993a463f957431479c5139b9
4
- data.tar.gz: 303cf49a7ddc8a1e85cf5566e6302b461828769e87cf627355371deba5a9c8a4
3
+ metadata.gz: e82d43aa436f9f1d2947ecf55d73e236bcaf002cc6a1b706d5e3cea589d6b69b
4
+ data.tar.gz: a5e777c6d97f42df2b332f28cd72530470b4a192ae8c3c70655deaa41bfd70d8
5
5
  SHA512:
6
- metadata.gz: d203d84c0edea9a28b7d919ef1a6ad1f2fa6696d58fec2dff3bfe69c26ad47891a4d733f7299694483415a21cb492e22b6ca4815b59e0bcbc0f608df12677480
7
- data.tar.gz: eaf65a16668affd4db442b338a3eb63e612f8ac0430ee18ca89d879698aa74ca4bdd88b8b230a5dc955ab589c260bb7aeabb1980f66c69702036e2532196d930
6
+ metadata.gz: 9ba33c184b234b4724f41dc1e3739bfe380ecb087e356fae99ca405ec1592dc2b0e1cfec607ffe8dc1631ddbb7c5a8f0ff312ff64f6262541302611034038bce
7
+ data.tar.gz: 2f10015e504aad54aa4abba5719147fc7946870bc533b9dc97f0c1e1dc3342f8e6a469ef317f35dd7a2a016f8e2cc70d98c3c954a6268a67de5f06f40ddfe2f7
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ *.gem
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pirsch_api (0.0.1)
4
+ pirsch_api (0.0.5)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -4,21 +4,80 @@ It's based on the [API guide](https://docs.pirsch.io/api-sdks/api/)
4
4
 
5
5
  ## Usage
6
6
  Add this gem to your Gemfile:
7
+
7
8
  ```rb
8
9
  gem 'pirsch_api'
9
10
  ```
10
- Then you need to initialize a Client with your `client_id` and the `client_secret`.
11
+
12
+ Now you need to initialize a Client with your `client_id` and the `client_secret`.
13
+
11
14
  ```rb
12
- c = PirschApi::Client.new('<client_id>', '<client_secret>')
15
+ client = PirschApi::Client.new(client_id: '<client_id>', client_secret: '<client_secret>')
13
16
 
14
17
  # Test if the credentials are valid
15
- c.valid?
18
+ client.valid?
16
19
  => true
20
+ ```
21
+
22
+ You will need a `Domain` as a parameter to all the following methods. This parameter could be either
23
+ a `PirschApi::Domain` instance or a simple String containing the `id` of one domain.
24
+
25
+ ```rb
26
+ # Get /domains
27
+ client.domains
28
+ => [#<PirschApi::Domain id="0D3a...", user_id="0D3a...", hostname="pirsch.io", subdomain="pirsch", ... >]
29
+ domain = client.domains.first
30
+ ```
31
+
32
+ All the following methods receive a `domain` and an optional `filters` hash as a parameter. You can include any filter defined in the official documentation.
33
+
34
+ ```rb
35
+ # Get /statistics/visitors
36
+ client.visitors(domain: domain, filters: filters)
37
+
38
+ # Get /statistics/active
39
+ client.active(domain: domain, filters: filters)
17
40
 
18
- # Get a new Access Token
19
- c.token
41
+ # Get /statistics/pages
42
+ client.pages(domain: domain, filters: filters)
43
+
44
+ # Get /statistics/referrers
45
+ client.referrers(domain: domain, filters: filters)
46
+
47
+ # Get /statistics/growth
48
+ client.growth(domain: domain, filters: filters)
49
+
50
+ # Get /statistics/events
51
+ client.events(domain: domain, filters: filters)
52
+
53
+ # Get /statistics/utm/source
54
+ client.utm_source(domain: domain, filters: filters)
55
+
56
+ # Get /statistics/utm/medium
57
+ client.utm_medium(domain: domain, filters: filters)
58
+
59
+ # Get /statistics/utm/campaign
60
+ client.utm_campaign(domain: domain, filters: filters)
20
61
  ```
21
62
 
63
+ ## Examples
64
+ ```rb
65
+ client.visitors(domain: domain)
66
+ => [#<PirschApi::Visitor day="2021-08-30T00:00:00Z", visitors=87, views=200, sessions=125, bounces=53, bounce_rate=0.6091954022988506>, #<PirschApi::Visitor day="2021-08-31T00:00:00Z", visitors=77, views=159, sessions=113, bounces=49, bounce_rate=0.6363636363636364>, #<PirschApi::Visitor day="2021-09-01T00:00:00Z", visitors=76, views=161, sessions=110, bounces=48, bounce_rate=0.631578947368421>, #<PirschApi::Visitor day="2021-09-02T00:00:00Z", visitors=79, views=152, sessions=130, bounces=52, bounce_rate=0.6582278481012658>, #<PirschApi::Visitor day="2021-09-03T00:00:00Z", visitors=53, views=109, sessions=68, bounces=26, bounce_rate=0.49056603773584906>, #<PirschApi::Visitor day="2021-09-04T00:00:00Z", visitors=54, views=126, sessions=71, bounces=31, bounce_rate=0.5740740740740741>, #<PirschApi::Visitor day="2021-09-05T00:00:00Z", visitors=116, views=202, sessions=131, bounces=84, bounce_rate=0.7241379310344828>, #<PirschApi::Visitor day="2021-09-06T00:00:00Z", visitors=1, views=1, sessions=1, bounces=1, bounce_rate=1>]
67
+
68
+ client.visitors(domain: domain, filters: { from: '2021-09-01' })
69
+ => [#<PirschApi::Visitor day="2021-09-01T00:00:00Z", visitors=76, views=161, sessions=110, bounces=48, bounce_rate=0.631578947368421>, #<PirschApi::Visitor day="2021-09-02T00:00:00Z", visitors=79, views=152, sessions=130, bounces=52, bounce_rate=0.6582278481012658>, #<PirschApi::Visitor day="2021-09-03T00:00:00Z", visitors=53, views=109, sessions=68, bounces=26, bounce_rate=0.49056603773584906>, #<PirschApi::Visitor day="2021-09-04T00:00:00Z", visitors=54, views=126, sessions=71, bounces=31, bounce_rate=0.5740740740740741>, #<PirschApi::Visitor day="2021-09-05T00:00:00Z", visitors=116, views=202, sessions=131, bounces=84, bounce_rate=0.7241379310344828>, #<PirschApi::Visitor day="2021-09-06T00:00:00Z", visitors=1, views=1, sessions=1, bounces=1, bounce_rate=1>]
70
+
71
+ client.visitors(domain: domain, filters: { from: '2021-09-01' }).first.day
72
+ => "2021-09-01T00:00:00Z"
73
+
74
+ # Get /statistics/active
75
+ client.active(domain: domain)
76
+ => #<PirschApi::Active stats=nil, visitors=0>
77
+
78
+ client.active(domain: domain).visitors
79
+ => 0
80
+ ```
22
81
 
23
82
  ## Development
24
83
 
@@ -1,28 +1,69 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'pirsch_api/token'
4
-
5
- require 'json'
6
- require "net/http"
7
- require "uri"
8
- require "cgi"
9
-
10
3
  module PirschApi
11
4
  class Client
12
5
 
13
- BASE_URL = 'https://api.pirsch.io'
6
+ BASE_URL = 'https://api.pirsch.io/api/v1'
14
7
 
15
- def initialize(client_id, client_secret)
8
+ def initialize(client_id:, client_secret:)
16
9
  @client_id = client_id.to_s
17
10
  @client_secret = client_secret.to_s
18
11
  end
19
12
 
13
+ def valid?
14
+ true if token rescue false
15
+ end
16
+
20
17
  def token
21
- @token ||= PirschApi::Token.new(@client_id, @client_secret).run
18
+ @token ||= TokenResource.new(@client_id, @client_secret).run
22
19
  end
23
20
 
24
- def valid?
25
- true if token rescue false
21
+ def domains
22
+ DomainResource.new(client: self).run
23
+ end
24
+
25
+ def visitors(filters: {}, domain:)
26
+ VisitorResource.new(client: self, filters: filters, domain: domain).run
27
+ end
28
+
29
+ def pages(filters: {}, domain:)
30
+ PageResource.new(client: self, filters: filters, domain: domain).run
31
+ end
32
+
33
+ def referrers(filters: {}, domain:)
34
+ ReferrerResource.new(client: self, filters: filters, domain: domain).run
35
+ end
36
+
37
+ def active(filters: {}, domain:)
38
+ ActiveResource.new(client: self, filters: filters, domain: domain).run
39
+ end
40
+
41
+ def growth(filters: {}, domain:)
42
+ GrowthResource.new(client: self, filters: filters, domain: domain).run
43
+ end
44
+
45
+ def events(filters: {}, domain:)
46
+ EventResource.new(client: self, filters: filters, domain: domain).run
47
+ end
48
+
49
+ def utm_source(filters: {}, domain:)
50
+ UtmSourceResource.new(client: self, filters: filters, domain: domain).run
51
+ end
52
+
53
+ def utm_medium(filters: {}, domain:)
54
+ UtmMediumResource.new(client: self, filters: filters, domain: domain).run
55
+ end
56
+
57
+ def utm_campaign(filters: {}, domain:)
58
+ UtmCampaignResource.new(client: self, filters: filters, domain: domain).run
59
+ end
60
+
61
+ def duration_session(filters: {}, domain:)
62
+ DurationSessionResource.new(client: self, filters: filters, domain: domain).run
63
+ end
64
+
65
+ def duration_page(filters: {}, domain:)
66
+ DurationPageResource.new(client: self, filters: filters, domain: domain).run
26
67
  end
27
68
  end
28
69
  end
@@ -0,0 +1,4 @@
1
+ module PirschApi
2
+ class Error < StandardError
3
+ end
4
+ end
@@ -0,0 +1,19 @@
1
+ require "ostruct"
2
+
3
+ module PirschApi
4
+ class Object < OpenStruct
5
+ def initialize(attributes)
6
+ super to_ostruct(attributes)
7
+ end
8
+
9
+ def to_ostruct(obj)
10
+ if obj.is_a?(Hash)
11
+ OpenStruct.new(obj.map { |key, val| [key, to_ostruct(val)] }.to_h)
12
+ elsif obj.is_a?(Array)
13
+ obj.map { |o| to_ostruct(o) }
14
+ else # Assumed to be a primitive value
15
+ obj
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,4 @@
1
+ module PirschApi
2
+ class Active < Object
3
+ end
4
+ end
@@ -0,0 +1,7 @@
1
+ module PirschApi
2
+ class Domain < Object
3
+ def to_s
4
+ id.to_s
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,4 @@
1
+ module PirschApi
2
+ class DurationPage < Object
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module PirschApi
2
+ class DurationSession < Object
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module PirschApi
2
+ class Event < Object
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module PirschApi
2
+ class Growth < Object
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module PirschApi
2
+ class Page < Object
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module PirschApi
2
+ class Referrer < Object
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module PirschApi
2
+ class Token < Object
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module PirschApi
2
+ class UtmCampaign < Object
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module PirschApi
2
+ class UtmMedium < Object
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module PirschApi
2
+ class UtmSource < Object
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module PirschApi
2
+ class Visitor < Object
3
+ end
4
+ end
@@ -0,0 +1,57 @@
1
+ module PirschApi
2
+ class BaseResource
3
+
4
+ attr_accessor :client, :filters, :domain
5
+
6
+ def initialize(client:, domain: nil, filters: {})
7
+ @client = client
8
+ @filters = filters
9
+ @domain = domain
10
+ @errors = []
11
+ end
12
+
13
+ def request_url
14
+ raise NotImplementedError
15
+ end
16
+
17
+ def parse_response(body)
18
+ raise NotImplementedError
19
+ end
20
+
21
+ def errors
22
+ @errors[:client] = 'client is invalid' unless client.valid?
23
+ @errors
24
+ end
25
+
26
+ def valid?
27
+ errors.empty?
28
+ end
29
+
30
+ def run
31
+ raise PirschApi::Error.new errors unless valid?
32
+
33
+ if domain
34
+ filters[:id] = domain.to_s
35
+ end
36
+
37
+ url = "#{PirschApi::Client::BASE_URL}/#{request_url}"
38
+ url << "?#{filters.to_a.map { |x| "#{x[0]}=#{x[1]}" }.join("&") }" if filters.any?
39
+
40
+ puts "[Pirsch API] run #{url}"
41
+
42
+ uri = URI.parse url
43
+
44
+ req = Net::HTTP::Get.new(uri.request_uri)
45
+ req.add_field('Authorization', "Bearer #{client.token.access_token}")
46
+
47
+ http = Net::HTTP.new(uri.host, uri.port)
48
+ http.use_ssl = true
49
+
50
+ response = http.request(req)
51
+ raise PirschApi::Error.new "Api request failed (#{response.body})" unless response.code == "200"
52
+ raise PirschApi::Error.new "Api request returned nil (#{response.body})" if response.body.nil?
53
+
54
+ parse_response response.body
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,11 @@
1
+ module PirschApi
2
+ class DomainResource < BaseResource
3
+ def request_url
4
+ "domain"
5
+ end
6
+
7
+ def parse_response(body)
8
+ JSON.parse(body).map{ |o| Domain.new o }
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ module PirschApi
2
+ class ActiveResource < BaseResource
3
+ def request_url
4
+ "statistics/active"
5
+ end
6
+
7
+ def parse_response(body)
8
+ Active.new JSON.parse(body)
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ module PirschApi
2
+ class DurationPageResource < BaseResource
3
+ def request_url
4
+ "statistics/duration/page"
5
+ end
6
+
7
+ def parse_response(body)
8
+ JSON.parse(body)&.map{ |o| DurationPage.new o }
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ module PirschApi
2
+ class DurationSessionResource < BaseResource
3
+ def request_url
4
+ "statistics/duration/session"
5
+ end
6
+
7
+ def parse_response(body)
8
+ JSON.parse(body)&.map{ |o| DurationSession.new o }
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,10 @@
1
+ module PirschApi
2
+ class EventResource < BaseResource
3
+ def request_url
4
+ "statistics/events"
5
+ end
6
+ def parse_response(body)
7
+ JSON.parse(body)&.map{ |o| Event.new o }
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,11 @@
1
+ module PirschApi
2
+ class GrowthResource < BaseResource
3
+ def request_url
4
+ "statistics/growth"
5
+ end
6
+
7
+ def parse_response(body)
8
+ Growth.new JSON.parse(body)
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ module PirschApi
2
+ class PageResource < BaseResource
3
+ def request_url
4
+ "statistics/page"
5
+ end
6
+
7
+ def parse_response(body)
8
+ JSON.parse(body)&.map{ |o| Page.new o }
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ module PirschApi
2
+ class ReferrerResource < BaseResource
3
+ def request_url
4
+ "statistics/referrer"
5
+ end
6
+
7
+ def parse_response(body)
8
+ JSON.parse(body)&.map{ |o| Referrer.new o }
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ module PirschApi
2
+ class UtmCampaignResource < BaseResource
3
+ def request_url
4
+ "statistics/utm/campaign"
5
+ end
6
+
7
+ def parse_response(body)
8
+ JSON.parse(body)&.map{ |o| UtmCampaign.new o }
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ module PirschApi
2
+ class UtmMediumResource < BaseResource
3
+ def request_url
4
+ "statistics/utm/medium"
5
+ end
6
+
7
+ def parse_response(body)
8
+ JSON.parse(body)&.map{ |o| UtmMedium.new o }
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ module PirschApi
2
+ class UtmSourceResource < BaseResource
3
+ def request_url
4
+ "statistics/utm/source"
5
+ end
6
+
7
+ def parse_response(body)
8
+ JSON.parse(body)&.map{ |o| UtmSource.new o }
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ module PirschApi
2
+ class VisitorResource < BaseResource
3
+ def request_url
4
+ "statistics/visitor"
5
+ end
6
+
7
+ def parse_response(body)
8
+ JSON.parse(body)&.map{ |o| Visitor.new o }
9
+ end
10
+ end
11
+ end
@@ -1,6 +1,6 @@
1
1
  module PirschApi
2
2
 
3
- class Token
3
+ class TokenResource
4
4
 
5
5
  def initialize(client_id, client_secret)
6
6
  @client_id = client_id
@@ -8,7 +8,7 @@ module PirschApi
8
8
  end
9
9
 
10
10
  def request_url
11
- "https://api.pirsch.io/api/v1/token"
11
+ "token"
12
12
  end
13
13
 
14
14
  def request_body
@@ -19,12 +19,13 @@ module PirschApi
19
19
  end
20
20
 
21
21
  def parse_response(body)
22
- JSON.parse(body)['access_token']
22
+ puts "[Pirsch API] Token received"
23
+ Token.new JSON.parse(body)
23
24
  end
24
25
 
25
26
  def run
26
- uri = URI.parse request_url
27
-
27
+ uri = URI.parse "#{PirschApi::Client::BASE_URL}/#{request_url}"
28
+ puts "[Pirsch API] Requesting Token..."
28
29
  http = Net::HTTP.new(uri.host, uri.port)
29
30
  http.use_ssl = true
30
31
  http.verify_mode = OpenSSL::SSL::VERIFY_NONE
@@ -34,7 +35,8 @@ module PirschApi
34
35
  request.body = request_body
35
36
 
36
37
  response = http.request(request)
37
- raise PirschApi::Error.new "Token request failed. (#{response.body})" unless response.code == "200"
38
+
39
+ raise Error.new "Token request failed. (#{response.body})" unless response.code == "200"
38
40
 
39
41
  parse_response(response.body)
40
42
  end
@@ -1,3 +1,3 @@
1
1
  module PirschApi
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.5"
3
3
  end
data/lib/pirsch_api.rb CHANGED
@@ -1,6 +1,41 @@
1
+ require 'json'
2
+ require "net/http"
3
+ require "uri"
4
+ require "cgi"
5
+
1
6
  require 'pirsch_api/version'
2
- require 'pirsch_api/client'
3
7
 
4
8
  module PirschApi
5
- class Error < StandardError; end
9
+ autoload :Client, "pirsch_api/client"
10
+ autoload :Error, "pirsch_api/error"
11
+
12
+ autoload :BaseResource, "pirsch_api/resources/base"
13
+ autoload :TokenResource, "pirsch_api/resources/token"
14
+ autoload :DomainResource, "pirsch_api/resources/domain"
15
+ autoload :VisitorResource, "pirsch_api/resources/statistics/visitor"
16
+ autoload :PageResource, "pirsch_api/resources/statistics/page"
17
+ autoload :ReferrerResource, "pirsch_api/resources/statistics/referrer"
18
+ autoload :ActiveResource, "pirsch_api/resources/statistics/active"
19
+ autoload :GrowthResource, "pirsch_api/resources/statistics/growth"
20
+ autoload :EventResource, "pirsch_api/resources/statistics/event"
21
+ autoload :UtmSourceResource, "pirsch_api/resources/statistics/utm_source"
22
+ autoload :UtmCampaignResource, "pirsch_api/resources/statistics/utm_campaign"
23
+ autoload :UtmMediumResource, "pirsch_api/resources/statistics/utm_medium"
24
+ autoload :DurationSessionResource, "pirsch_api/resources/statistics/duration_session"
25
+ autoload :DurationPageResource, "pirsch_api/resources/statistics/duration_page"
26
+
27
+ autoload :Object, "pirsch_api/object"
28
+ autoload :Token, "pirsch_api/objects/token"
29
+ autoload :Domain, "pirsch_api/objects/domain"
30
+ autoload :Visitor, "pirsch_api/objects/visitor"
31
+ autoload :Page, "pirsch_api/objects/page"
32
+ autoload :Referrer, "pirsch_api/objects/referrer"
33
+ autoload :Active, "pirsch_api/objects/active"
34
+ autoload :Growth, "pirsch_api/objects/growth"
35
+ autoload :Event, "pirsch_api/objects/event"
36
+ autoload :UtmSource, "pirsch_api/objects/utm_source"
37
+ autoload :UtmCampaign, "pirsch_api/objects/utm_campaign"
38
+ autoload :UtmMedium, "pirsch_api/objects/utm_medium"
39
+ autoload :DurationSession, "pirsch_api/objects/duration_session"
40
+ autoload :DurationPage, "pirsch_api/objects/duration_page"
6
41
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pirsch_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gustavo Garcia
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-04 00:00:00.000000000 Z
11
+ date: 2021-09-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A very humble wrapper for the API by Pirsch.io
14
14
  email:
@@ -17,6 +17,7 @@ executables: []
17
17
  extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
+ - ".gitignore"
20
21
  - CODE_OF_CONDUCT.md
21
22
  - Gemfile
22
23
  - Gemfile.lock
@@ -27,12 +28,37 @@ files:
27
28
  - bin/setup
28
29
  - lib/pirsch_api.rb
29
30
  - lib/pirsch_api/client.rb
30
- - lib/pirsch_api/token.rb
31
+ - lib/pirsch_api/error.rb
32
+ - lib/pirsch_api/object.rb
33
+ - lib/pirsch_api/objects/active.rb
34
+ - lib/pirsch_api/objects/domain.rb
35
+ - lib/pirsch_api/objects/duration_page.rb
36
+ - lib/pirsch_api/objects/duration_session.rb
37
+ - lib/pirsch_api/objects/event.rb
38
+ - lib/pirsch_api/objects/growth.rb
39
+ - lib/pirsch_api/objects/page.rb
40
+ - lib/pirsch_api/objects/referrer.rb
41
+ - lib/pirsch_api/objects/token.rb
42
+ - lib/pirsch_api/objects/utm_campaign.rb
43
+ - lib/pirsch_api/objects/utm_medium.rb
44
+ - lib/pirsch_api/objects/utm_source.rb
45
+ - lib/pirsch_api/objects/visitor.rb
46
+ - lib/pirsch_api/resources/base.rb
47
+ - lib/pirsch_api/resources/domain.rb
48
+ - lib/pirsch_api/resources/statistics/active.rb
49
+ - lib/pirsch_api/resources/statistics/duration_page.rb
50
+ - lib/pirsch_api/resources/statistics/duration_session.rb
51
+ - lib/pirsch_api/resources/statistics/event.rb
52
+ - lib/pirsch_api/resources/statistics/growth.rb
53
+ - lib/pirsch_api/resources/statistics/page.rb
54
+ - lib/pirsch_api/resources/statistics/referrer.rb
55
+ - lib/pirsch_api/resources/statistics/utm_campaign.rb
56
+ - lib/pirsch_api/resources/statistics/utm_medium.rb
57
+ - lib/pirsch_api/resources/statistics/utm_source.rb
58
+ - lib/pirsch_api/resources/statistics/visitor.rb
59
+ - lib/pirsch_api/resources/token.rb
31
60
  - lib/pirsch_api/version.rb
32
61
  - pirsch_api.gemspec
33
- - pkg/plausible_api-0.1.0.gem
34
- - pkg/plausible_api-0.1.7.gem
35
- - pkg/plausible_api-0.1.8.gem
36
62
  homepage: https://github.com/dailytics/pirsch_api
37
63
  licenses:
38
64
  - MIT
Binary file
Binary file
Binary file