ecoportal-api-graphql 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31998ba790529d40b944c8ee9160a0b916d951f6c2fba7b356316a039fc2464c
|
4
|
+
data.tar.gz: bf5db71077c3cdc628b09d558c0a5c224bd93339148fd23deff4f0ac8cb4ef7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6d6eef572e2cc6dedf127094e27eca4b2af148b94272f034367ce886d90e228dcbfe9661b101c018c030bf992df1e3624fdcb1fafdda35a7e008ac1b596ea66
|
7
|
+
data.tar.gz: bf1ff8931b054e38904ac0e4df51b3bee5c4826e99b5132cf2ae383192c599aa109ff1140e635ee5feb5e79e22e83f899d6878c5261d1d1d4de1e7ba9cc78993
|
data/CHANGELOG.md
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
# Change Log
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
-
## [0.0.
|
4
|
+
## [0.0.3] - 2022-09-xx
|
5
5
|
|
6
6
|
### Added
|
7
7
|
|
8
8
|
### Changed
|
9
|
+
- `Ecoportal::API::GraphQL` addded `email` and `pass` parameters on initialization
|
10
|
+
- This allows for integration in some client lib
|
9
11
|
|
10
12
|
### Fixed
|
11
13
|
|
@@ -16,6 +18,12 @@ All notable changes to this project will be documented in this file.
|
|
16
18
|
- Analyse how to "DSL" currentOrganization.action.activities
|
17
19
|
- review `path` tracking
|
18
20
|
|
21
|
+
## [0.0.2] - 2022-09-15
|
22
|
+
|
23
|
+
### Changed
|
24
|
+
- `Ecoportal::API::GraphQL` addded `email` and `pass` parameters on initialization
|
25
|
+
- This allows for integration in some client lib
|
26
|
+
|
19
27
|
## [0.0.1] - 2022-09-15
|
20
28
|
|
21
29
|
### Added
|
@@ -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(
|
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:
|
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:
|
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
|
|