ecoportal-api-graphql 0.3.11 → 0.3.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -1
- data/ecoportal-api-graphql.gemspec +6 -6
- data/lib/ecoportal/api/graphql/base/action.rb +4 -0
- data/lib/ecoportal/api/graphql/builder/action.rb +8 -0
- data/lib/ecoportal/api/graphql/fragment/action.rb +1 -0
- data/lib/ecoportal/api/graphql/input/action/update.rb +14 -0
- data/lib/ecoportal/api/graphql/input/action.rb +1 -0
- data/lib/ecoportal/api/graphql/logic/base_query.rb +2 -2
- data/lib/ecoportal/api/graphql/model/action.rb +2 -1
- data/lib/ecoportal/api/graphql/model/organization.rb +1 -0
- data/lib/ecoportal/api/graphql/mutation/action/update.rb +40 -0
- data/lib/ecoportal/api/graphql/mutation/action.rb +1 -0
- data/lib/ecoportal/api/graphql/payload/action/update.rb +13 -0
- data/lib/ecoportal/api/graphql/payload/action.rb +1 -0
- data/lib/ecoportal/api/graphql/query/action.rb +33 -0
- data/lib/ecoportal/api/graphql/query.rb +1 -0
- data/lib/ecoportal/api/graphql_version.rb +1 -1
- metadata +20 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84a9f39a8061d4b353f10cfb5e9fd5b2dded406387e60226b6e5bf2bb0d8ed48
|
4
|
+
data.tar.gz: bb50d826e6337eff2003df61040028ebf4e894c6926f99b5a62c77b69250359a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c104b66bc6d0d131d0a7af1db10773517562423db29c79e755358618b135cefc308d603bbefaa3046a132ab99dcd19a077d2e84d5ea5e661099e31b4652a8057
|
7
|
+
data.tar.gz: aca1f93af54014e401bf854afbdcd1692682002ca01b5191c99776cffc2ef1525ce34def3d3da0d154d01b0555410cd15b369b8d37b7d0db3fecc243a85ac0a9
|
data/CHANGELOG.md
CHANGED
@@ -9,12 +9,22 @@ All notable changes to this project will be documented in this file.
|
|
9
9
|
- review `path` tracking
|
10
10
|
|
11
11
|
|
12
|
-
## [0.3.
|
12
|
+
## [0.3.14] - 2024-02-xx
|
13
13
|
|
14
14
|
### Added
|
15
15
|
### Changed
|
16
16
|
### Fixed
|
17
17
|
|
18
|
+
## [0.3.13] - 2024-02-03
|
19
|
+
|
20
|
+
### Changed
|
21
|
+
- upgrade `ecoportal-api-v2`
|
22
|
+
|
23
|
+
## [0.3.12] - 2024-01-27
|
24
|
+
|
25
|
+
### Added
|
26
|
+
- Exposed `graphql` `Action` `update` and get a single `action`
|
27
|
+
|
18
28
|
## [0.3.11] - 2023-09-19
|
19
29
|
|
20
30
|
### Added
|
@@ -22,13 +22,13 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
23
|
spec.require_paths = ["lib"]
|
24
24
|
|
25
|
-
spec.add_development_dependency "bundler", ">= 2.4.
|
26
|
-
spec.add_development_dependency "rspec", ">= 3.
|
25
|
+
spec.add_development_dependency "bundler", ">= 2.4.12", "< 3"
|
26
|
+
spec.add_development_dependency "rspec", ">= 3.12.0", "< 4"
|
27
27
|
spec.add_development_dependency "rake", ">= 13.0.3", "< 14"
|
28
|
-
spec.add_development_dependency "yard", ">= 0.9.
|
29
|
-
spec.add_development_dependency "redcarpet", ">= 3.
|
28
|
+
spec.add_development_dependency "yard", ">= 0.9.34", "< 1"
|
29
|
+
spec.add_development_dependency "redcarpet", ">= 3.6.0", "< 4"
|
30
30
|
spec.add_development_dependency "pry" , ">= 0.14"
|
31
31
|
|
32
|
-
spec.add_dependency 'ecoportal-api-v2', '>= 1.1.
|
33
|
-
spec.add_dependency 'graphlient', '>= 0.
|
32
|
+
spec.add_dependency 'ecoportal-api-v2', '>= 1.1.5', '< 1.2'
|
33
|
+
spec.add_dependency 'graphlient', '>= 0.8.0', '< 0.9'
|
34
34
|
end
|
@@ -30,6 +30,10 @@ module Ecoportal
|
|
30
30
|
embeds_one :openededAt, klass: Base::DateTime
|
31
31
|
embeds_one :closedAt, klass: Base::DateTime
|
32
32
|
embeds_one :dueOrClosedDate, klass: Base::DateTime
|
33
|
+
|
34
|
+
passboolean :completed
|
35
|
+
passthrough :closeDetail
|
36
|
+
#passthrough :dueIn # only for templates
|
33
37
|
end
|
34
38
|
end
|
35
39
|
end
|
@@ -13,11 +13,19 @@ module Ecoportal
|
|
13
13
|
archiveMutation.query(**kargs, &block)
|
14
14
|
end
|
15
15
|
|
16
|
+
def update(**kargs, &block)
|
17
|
+
updateMutation.query(**kargs, &block)
|
18
|
+
end
|
19
|
+
|
16
20
|
private
|
17
21
|
|
18
22
|
def archiveMutation
|
19
23
|
Ecoportal::API::GraphQL::Mutation::Action::Archive.new(client)
|
20
24
|
end
|
25
|
+
|
26
|
+
def updateMutation
|
27
|
+
Ecoportal::API::GraphQL::Mutation::Action::Update.new(client)
|
28
|
+
end
|
21
29
|
end
|
22
30
|
end
|
23
31
|
end
|
@@ -78,11 +78,11 @@ module Ecoportal
|
|
78
78
|
raise "This method should be implemented in the child class #{self.class}"
|
79
79
|
end
|
80
80
|
|
81
|
-
def graphql_query(path: self.path, **kargs, &block)
|
81
|
+
def graphql_query(path: self.path, raw_response: {}, **kargs, &block)
|
82
82
|
default_params = self.class.param_defaults.dup
|
83
83
|
query_params = self.class.slice_params(default_params.merge(kargs))
|
84
84
|
request(*path) do
|
85
|
-
client.query(query_params, &block)
|
85
|
+
raw_response[:data] = client.query(query_params, &block)
|
86
86
|
end
|
87
87
|
rescue Faraday::ParsingError, Graphlient::Errors::GraphQLError => e
|
88
88
|
puts "Internal Error with these params:"
|
@@ -12,7 +12,8 @@ module Ecoportal
|
|
12
12
|
embeds_one :completer, klass: Model::PersonMember
|
13
13
|
embeds_many :fileContainers, klass: Model::FileContainer
|
14
14
|
embeds_many :linkedResources, klass: Model::Resource
|
15
|
-
#embeds_many :activities, klass: GraphQL::
|
15
|
+
#embeds_many :activities, klass: GraphQL::Model::Action::Activity
|
16
|
+
#embeds_one :recurrence, klass: GraphQL::Model::Action::Recurrence
|
16
17
|
end
|
17
18
|
end
|
18
19
|
end
|
@@ -16,6 +16,7 @@ module Ecoportal
|
|
16
16
|
query :locationStructures, subpath: "locations", query_klass: "Ecoportal::API::GraphQL::Query::LocationStructures"
|
17
17
|
query :contractorEntities, query_klass: "Ecoportal::API::GraphQL::Query::ContractorEntities"
|
18
18
|
#contractorEntity,
|
19
|
+
query :action, query_klass: "Ecoportal::API::GraphQL::Query::Action"
|
19
20
|
query :actions, query_klass: "Ecoportal::API::GraphQL::Query::Actions"
|
20
21
|
query :archiveAction, query_klass: "Ecoportal::API::GraphQL::Mutation::Action::Archive"
|
21
22
|
#action, actionsByPage, actionsCounter
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module Ecoportal
|
2
|
+
module API
|
3
|
+
class GraphQL
|
4
|
+
module Mutation
|
5
|
+
module Action
|
6
|
+
class Update < Ecoportal::API::GraphQL::Logic::Mutation
|
7
|
+
field_name :updateAction
|
8
|
+
|
9
|
+
class_resolver :payload_class, Ecoportal::API::GraphQL::Payload::Action::Update
|
10
|
+
class_resolver :input_class, Ecoportal::API::GraphQL::Input::Action::Update
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def basic_block(&block)
|
15
|
+
payload_block = block || default_payload_block
|
16
|
+
Proc.new {
|
17
|
+
mutation(input: :UpdateActionInput!) {
|
18
|
+
updateAction(input: :input, &payload_block)
|
19
|
+
}
|
20
|
+
}
|
21
|
+
end
|
22
|
+
|
23
|
+
def default_payload_block
|
24
|
+
Proc.new {
|
25
|
+
clientMutationId
|
26
|
+
errors {
|
27
|
+
details
|
28
|
+
fullMessages
|
29
|
+
}
|
30
|
+
item {
|
31
|
+
___Fragment__Action
|
32
|
+
}
|
33
|
+
}
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Ecoportal
|
2
|
+
module API
|
3
|
+
class GraphQL
|
4
|
+
module Query
|
5
|
+
class Action < Ecoportal::API::GraphQL::Logic::Query
|
6
|
+
field_name :action
|
7
|
+
|
8
|
+
accepted_params :id
|
9
|
+
class_resolver :item_class, Ecoportal::API::GraphQL::Model::Action
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def basic_block(&block)
|
14
|
+
action_block = block || default_block
|
15
|
+
Proc.new {
|
16
|
+
query(id: :id!) {
|
17
|
+
currentOrganization {
|
18
|
+
action(id: :id, &action_block)
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
22
|
+
end
|
23
|
+
|
24
|
+
def default_block
|
25
|
+
Proc.new {
|
26
|
+
___Ecoportal__API__GraphQL__Fragment__Action
|
27
|
+
}
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -9,5 +9,6 @@ end
|
|
9
9
|
|
10
10
|
require 'ecoportal/api/graphql/query/location_structure'
|
11
11
|
require 'ecoportal/api/graphql/query/location_structures'
|
12
|
+
require 'ecoportal/api/graphql/query/action'
|
12
13
|
require 'ecoportal/api/graphql/query/actions'
|
13
14
|
require 'ecoportal/api/graphql/query/contractor_entities'
|
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.3.
|
4
|
+
version: 0.3.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oscar Segura
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.4.
|
19
|
+
version: 2.4.12
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: '3'
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 2.4.
|
29
|
+
version: 2.4.12
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '3'
|
@@ -36,7 +36,7 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: 3.
|
39
|
+
version: 3.12.0
|
40
40
|
- - "<"
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: '4'
|
@@ -46,7 +46,7 @@ dependencies:
|
|
46
46
|
requirements:
|
47
47
|
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 3.
|
49
|
+
version: 3.12.0
|
50
50
|
- - "<"
|
51
51
|
- !ruby/object:Gem::Version
|
52
52
|
version: '4'
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
requirements:
|
77
77
|
- - ">="
|
78
78
|
- !ruby/object:Gem::Version
|
79
|
-
version: 0.9.
|
79
|
+
version: 0.9.34
|
80
80
|
- - "<"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '1'
|
@@ -86,7 +86,7 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 0.9.
|
89
|
+
version: 0.9.34
|
90
90
|
- - "<"
|
91
91
|
- !ruby/object:Gem::Version
|
92
92
|
version: '1'
|
@@ -96,7 +96,7 @@ dependencies:
|
|
96
96
|
requirements:
|
97
97
|
- - ">="
|
98
98
|
- !ruby/object:Gem::Version
|
99
|
-
version: 3.
|
99
|
+
version: 3.6.0
|
100
100
|
- - "<"
|
101
101
|
- !ruby/object:Gem::Version
|
102
102
|
version: '4'
|
@@ -106,7 +106,7 @@ dependencies:
|
|
106
106
|
requirements:
|
107
107
|
- - ">="
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: 3.
|
109
|
+
version: 3.6.0
|
110
110
|
- - "<"
|
111
111
|
- !ruby/object:Gem::Version
|
112
112
|
version: '4'
|
@@ -130,7 +130,7 @@ dependencies:
|
|
130
130
|
requirements:
|
131
131
|
- - ">="
|
132
132
|
- !ruby/object:Gem::Version
|
133
|
-
version: 1.1.
|
133
|
+
version: 1.1.5
|
134
134
|
- - "<"
|
135
135
|
- !ruby/object:Gem::Version
|
136
136
|
version: '1.2'
|
@@ -140,7 +140,7 @@ dependencies:
|
|
140
140
|
requirements:
|
141
141
|
- - ">="
|
142
142
|
- !ruby/object:Gem::Version
|
143
|
-
version: 1.1.
|
143
|
+
version: 1.1.5
|
144
144
|
- - "<"
|
145
145
|
- !ruby/object:Gem::Version
|
146
146
|
version: '1.2'
|
@@ -150,20 +150,20 @@ dependencies:
|
|
150
150
|
requirements:
|
151
151
|
- - ">="
|
152
152
|
- !ruby/object:Gem::Version
|
153
|
-
version: 0.
|
153
|
+
version: 0.8.0
|
154
154
|
- - "<"
|
155
155
|
- !ruby/object:Gem::Version
|
156
|
-
version: '0.
|
156
|
+
version: '0.9'
|
157
157
|
type: :runtime
|
158
158
|
prerelease: false
|
159
159
|
version_requirements: !ruby/object:Gem::Requirement
|
160
160
|
requirements:
|
161
161
|
- - ">="
|
162
162
|
- !ruby/object:Gem::Version
|
163
|
-
version: 0.
|
163
|
+
version: 0.8.0
|
164
164
|
- - "<"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: '0.
|
166
|
+
version: '0.9'
|
167
167
|
description:
|
168
168
|
email:
|
169
169
|
- oscar@ecoportal.co.nz
|
@@ -236,6 +236,7 @@ files:
|
|
236
236
|
- lib/ecoportal/api/graphql/input.rb
|
237
237
|
- lib/ecoportal/api/graphql/input/action.rb
|
238
238
|
- lib/ecoportal/api/graphql/input/action/archive.rb
|
239
|
+
- lib/ecoportal/api/graphql/input/action/update.rb
|
239
240
|
- lib/ecoportal/api/graphql/input/contractor_entity.rb
|
240
241
|
- lib/ecoportal/api/graphql/input/contractor_entity/create.rb
|
241
242
|
- lib/ecoportal/api/graphql/input/contractor_entity/destroy.rb
|
@@ -279,6 +280,7 @@ files:
|
|
279
280
|
- lib/ecoportal/api/graphql/mutation.rb
|
280
281
|
- lib/ecoportal/api/graphql/mutation/action.rb
|
281
282
|
- lib/ecoportal/api/graphql/mutation/action/archive.rb
|
283
|
+
- lib/ecoportal/api/graphql/mutation/action/update.rb
|
282
284
|
- lib/ecoportal/api/graphql/mutation/contractor_entity.rb
|
283
285
|
- lib/ecoportal/api/graphql/mutation/contractor_entity/create.rb
|
284
286
|
- lib/ecoportal/api/graphql/mutation/contractor_entity/update.rb
|
@@ -287,6 +289,7 @@ files:
|
|
287
289
|
- lib/ecoportal/api/graphql/payload.rb
|
288
290
|
- lib/ecoportal/api/graphql/payload/action.rb
|
289
291
|
- lib/ecoportal/api/graphql/payload/action/archive.rb
|
292
|
+
- lib/ecoportal/api/graphql/payload/action/update.rb
|
290
293
|
- lib/ecoportal/api/graphql/payload/contractor_entity.rb
|
291
294
|
- lib/ecoportal/api/graphql/payload/contractor_entity/create.rb
|
292
295
|
- lib/ecoportal/api/graphql/payload/contractor_entity/destroy.rb
|
@@ -296,6 +299,7 @@ files:
|
|
296
299
|
- lib/ecoportal/api/graphql/payload/location_structure/command_execution_result.rb
|
297
300
|
- lib/ecoportal/api/graphql/payload/location_structure/command_interface.rb
|
298
301
|
- lib/ecoportal/api/graphql/query.rb
|
302
|
+
- lib/ecoportal/api/graphql/query/action.rb
|
299
303
|
- lib/ecoportal/api/graphql/query/actions.rb
|
300
304
|
- lib/ecoportal/api/graphql/query/contractor_entities.rb
|
301
305
|
- lib/ecoportal/api/graphql/query/location_structure.rb
|