ecoportal-api-graphql 0.1.0 → 0.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8b2c0cedbda4c84748b943f0abb5b6bca595385f79692189aa7bcf6fb5d1f46b
4
- data.tar.gz: 7e0582c067c29772bc89257fbd83aab19d6268c5500b054cb62a69285c86e992
3
+ metadata.gz: 311f8df4b5b299e4a1aa797958c96307247999738f115c6e475da35f262f4668
4
+ data.tar.gz: 64f874379cb32d8df2ca6ae14c51f1cc024b8791dea081f0cf176957c28a1427
5
5
  SHA512:
6
- metadata.gz: f26eb9930114eac84351856978256e470a8c5a89fef4e54ae7c2424829fbc0970d906865a4a1e3b6e205e72e3e915960c97169bff83af5d6cc286c6cd6703e5d
7
- data.tar.gz: 68de94a4e01bb6d7eb97946adff3456920971453665d9a2069511c76def7771a7bb8998b9cf66ee0ff43493ea4e9ba11a6b3883474f19747893a4a11af6f0379
6
+ metadata.gz: 294a8af94c125cf58749562d08c3a1e1c281f6f693586547fe83e2084ae94a56a2291d53c96d1225b6ca11ceec260f9b15e19857cd9ca812a408624303961450
7
+ data.tar.gz: 564eafaab9d6585fa7332d863d26ea7f94d319b07f45c0cbeca84ecb8f57cfab25829690a4f6a60aa337ec5d977f5d123d778b0a698a58017f8f33034404ffc8
data/CHANGELOG.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Change Log
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
- ## [0.0.2] - 2022-09-xx
4
+ ## [0.1.3] - 2022-09-xx
5
5
 
6
6
  ### Added
7
7
 
@@ -16,7 +16,13 @@ All notable changes to this project will be documented in this file.
16
16
  - Analyse how to "DSL" currentOrganization.action.activities
17
17
  - review `path` tracking
18
18
 
19
- ## [0.0.1] - 2022-09-15
19
+ ## [0.1.2] - 2022-09-15
20
+
21
+ ### Changed
22
+ - `Ecoportal::API::GraphQL` addded `email` and `pass` parameters on initialization
23
+ - This allows for integration in some client lib
24
+
25
+ ## [0.1.0] - 2022-09-15
20
26
 
21
27
  ### Added
22
28
  - First commit with some basic structure
@@ -13,9 +13,7 @@ module Ecoportal
13
13
  "email" => user_email,
14
14
  "password" => user_pass
15
15
  }).yield_self do |response|
16
- if response.success?
17
- response.body["access_token"]
18
- end
16
+ response.body["access_token"] if response.success?
19
17
  end
20
18
  end
21
19
 
@@ -26,11 +24,11 @@ module Ecoportal
26
24
  end
27
25
 
28
26
  def user_email
29
- fetch_env_required("USER_EMAIL")
27
+ @user_email || fetch_env_required("USER_EMAIL")
30
28
  end
31
29
 
32
30
  def user_pass
33
- fetch_env_required("USER_PASS")
31
+ @user_pass || fetch_env_required("USER_PASS")
34
32
  end
35
33
 
36
34
  def server(default = DEFAULT_SERVER)
@@ -8,10 +8,13 @@ module Ecoportal
8
8
 
9
9
  include Ecoportal::API::Common::GraphQL::AuthService
10
10
 
11
- def initialize(org_id:, host: server, schema_path: host, no_schema: false)
11
+ def initialize(email: nil, pass: nil, org_id: org_id,
12
+ host: server, schema_path: host, no_schema: false)
12
13
  @org_id = org_id
13
14
  @host = host
14
15
  @no_schema = no_schema
16
+ @user_email = email
17
+ @user_pass = pass
15
18
 
16
19
  puts "Configuring GraphQL Client onto '#{url}'"
17
20
  super(url,
@@ -27,12 +30,16 @@ module Ecoportal
27
30
  )
28
31
  end
29
32
 
30
- def new(org_id: self.org_id, host: self.host, schema_path: self.schema_path, no_schema: @no_schema)
33
+ def new(org_id: self.org_id, host: self.host, schema_path: host, no_schema: @no_schema)
31
34
  self.class.new(org_id: org_id, host: host, schema_path: schema_path, no_schema: no_schema)
32
35
  end
33
36
 
34
37
  private
35
38
 
39
+ def org_id
40
+ @org_id || fetch_env_required("ORGANIZATION_ID")
41
+ end
42
+
36
43
  def url
37
44
  "#{Ecoportal::API::Common::GraphQL::HttpClient.base_url(host)}/api/#{org_id}/graphql"
38
45
  end
@@ -11,8 +11,8 @@ module Ecoportal
11
11
  # @param org_id [String] the id of the target organization.
12
12
  # It defaults to the environmental variable `ORGANIZATION_ID`, if defined
13
13
  # @param logger [Logger] an object with `Logger` interface to generate logs.
14
- def initialize(org_id: ENV['ORGANIZATION_ID'])
15
- @client = Ecoportal::API::Common::GraphQL::Client.new(org_id: org_id, no_schema: true)
14
+ def initialize(email: nil, pass: nil, org_id: nil)
15
+ @client = Ecoportal::API::Common::GraphQL::Client.new(email: email, pass: pass, org_id: org_id, no_schema: true)
16
16
  @fragments = Ecoportal::API::GraphQL::Fragment.new(client)
17
17
  end
18
18
 
@@ -1,5 +1,5 @@
1
1
  module Ecoportal
2
2
  module API
3
- GRAPQL_VERSION = "0.1.0"
3
+ GRAPQL_VERSION = "0.1.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecoportal-api-graphql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Segura
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-09-14 00:00:00.000000000 Z
11
+ date: 2022-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler