ecoportal-api-graphql 0.3.11 → 0.3.12
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 +4 -4
- data/CHANGELOG.md +8 -0
- 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 +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b12afa3ea1f58d4473aa457bfb151284e2d4dcf1d5204c4fa659582a7232866
|
4
|
+
data.tar.gz: 62e2fd87c77816df9e4cb34c8f73c11fb07fd6099efa745c156544547671f89a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c7fa3eea6fa7122aa8109f6937a7de14142894a076f8b2a5f12836a3648e096a8d736ea766fb88d569d0cd34ecaad7844a3d516a37552f140be59eb63127e18
|
7
|
+
data.tar.gz: cebe218279a8a77a10af2cc21edddb7da52b68fb0c64c5529e3dc659eb5f44db32b4ed3973d4619d8689a190aa63a19ee7b5bbdf64fa4bfa81fe9336f5514d83
|
data/CHANGELOG.md
CHANGED
@@ -15,6 +15,14 @@ All notable changes to this project will be documented in this file.
|
|
15
15
|
### Changed
|
16
16
|
### Fixed
|
17
17
|
|
18
|
+
## [0.3.12] - 2024-01-27
|
19
|
+
|
20
|
+
### Added
|
21
|
+
- Exposed `graphql` `Action` `update` and get a single `action`
|
22
|
+
|
23
|
+
### Changed
|
24
|
+
### Fixed
|
25
|
+
|
18
26
|
## [0.3.11] - 2023-09-19
|
19
27
|
|
20
28
|
### Added
|
@@ -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.12
|
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-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -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
|