ecoportal-api-graphql 0.3.15 → 0.3.17

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: 2c155d6c7fa282ad8cf9ccae9682cec2ce1560b1716802cf6dabfbdd20d84587
4
- data.tar.gz: 39d410c6e6082e3cb36e86739bcd3c04e45c3d8e56b0905a97ecb6839160cde7
3
+ metadata.gz: 22fc169e27555e55157e336492851a42ff0e924bedd9a91efdd7b1b8f02fc9a5
4
+ data.tar.gz: '045038332d30bb9377cd6d2be4c06f25c1ef3ab2b725272f9dc3d98bb408246e'
5
5
  SHA512:
6
- metadata.gz: 9c48ec8bbe4f40597e59fa6463a9244e350e6bbe4a7558dcb8cad79e35c8fab0bcde02c0e09a8a4e66ac7bc7f504a0bad0ac1a260edda8775565014cfa080cf6
7
- data.tar.gz: 40f80dd98b63c3a8c83073d30037bf080e3fa282096c9f435b84dabe663ad578d0dd92acafeaed4856531dc64abbd75fc9b4cb434b7adad9536bd5f5ef632024
6
+ metadata.gz: 220537461d551cdb364521804d4bdf50a12e49596398dd400f8afdabec84aa91839805e632184da60d3b837276fbd373ce943512bd4ce20aecfbfe6d2f822adb
7
+ data.tar.gz: 477d15cd024fbe35279b0aa35377bc92e95615317a5aef537afa039f46b1e0b8b88766baebb6676195dd73bf2278c69c3592bd5ceb92bd82c5794def56ddfddc
data/CHANGELOG.md CHANGED
@@ -8,14 +8,36 @@ All notable changes to this project will be documented in this file.
8
8
  - Analyse how to "DSL" currentOrganization.action.activities
9
9
  - review `path` tracking
10
10
 
11
- ## [0.3.15] - 2024-04-xx
11
+ ## [0.3.18] - 2024-05-xx
12
+
13
+ ### Added
14
+ ### Changed
15
+ ### Fixed
16
+
17
+ ## [0.3.17] - 2024-05-14
18
+
19
+ ### Added
20
+ ### Changed
21
+ ### Fixed
22
+ - `field_name` should add up to the path
23
+
24
+ ## [0.3.16] - 2024-04-29
25
+
26
+ ### Added
27
+ - Exposed `graphql` `ContractorEntity` `destroy`
28
+ ### Fixed
29
+ - incorrect loading
30
+
31
+ ### Changed
32
+ - Input for ContractorEntity create moved as `update` (as it wasn't correct)
33
+
34
+ ## [0.3.15] - 2024-04-13
12
35
 
13
36
  ### Added
14
37
  - `Ecoportal::API::GraphQL::Logic::BaseQuery`
15
38
  - `::base_path` class instance var.
16
39
  - query to retrieve `currentOrganization.classifications`
17
40
 
18
- ### Changed
19
41
  ### Fixed
20
42
  - upgraded `ecoportal-api-v2` gem
21
43
 
@@ -17,6 +17,10 @@ module Ecoportal
17
17
  updateMutation.query(**kargs, &block)
18
18
  end
19
19
 
20
+ def destroy(**kargs, &block)
21
+ destroyMutation.query(**kargs, &block)
22
+ end
23
+
20
24
  private
21
25
 
22
26
  def createMutation
@@ -26,6 +30,10 @@ module Ecoportal
26
30
  def updateMutation
27
31
  Ecoportal::API::GraphQL::Mutation::ContractorEntity::Update.new(client)
28
32
  end
33
+
34
+ def destroyMutation
35
+ Ecoportal::API::GraphQL::Mutation::ContractorEntity::Destroy.new(client)
36
+ end
29
37
  end
30
38
  end
31
39
  end
@@ -5,9 +5,7 @@ module Ecoportal
5
5
  module ContractorEntity
6
6
  class Create < Ecoportal::API::GraphQL::Base::ContractorEntity
7
7
  passthrough :clientMutationId
8
- class_resolver :id_diff_input, "Ecoportal::API::GraphQL::Input::IdDiff"
9
- embeds_one :associatedPeopleIds, klass: :id_diff_input
10
- embeds_one :leadContractorIds, klass: :id_diff_input
8
+ passboolean :overrideAutoApproval
11
9
  end
12
10
  end
13
11
  end
@@ -4,6 +4,7 @@ module Ecoportal
4
4
  module Input
5
5
  module ContractorEntity
6
6
  class Destroy < Ecoportal::API::GraphQL::Base::Model
7
+ passthrough :clientMutationId
7
8
  passkey :id
8
9
  end
9
10
  end
@@ -2,7 +2,13 @@ module Ecoportal
2
2
  module API
3
3
  class GraphQL
4
4
  module Input
5
- class Update < Ecoportal::API::GraphQL::Input::ContractorEntity::Create
5
+ module ContractorEntity
6
+ class Update < Ecoportal::API::GraphQL::Input::ContractorEntity::Create
7
+ passthrough :clientMutationId
8
+ class_resolver :id_diff_input, "Ecoportal::API::GraphQL::Input::IdDiff"
9
+ embeds_one :associatedPeopleIds, klass: :id_diff_input
10
+ embeds_one :leadContractorIds, klass: :id_diff_input
11
+ end
6
12
  end
7
13
  end
8
14
  end
@@ -65,6 +65,7 @@ module Ecoportal
65
65
  result = @path
66
66
  result ||= default_path if respond_to?(:default_path, true)
67
67
  result ||= (base_path + [field_name]) if base_path && field_name
68
+ result ||= [field_name]
68
69
  result
69
70
  end
70
71
 
@@ -113,6 +114,7 @@ module Ecoportal
113
114
  msg = "Complete failure on request. Path: #{path}\n#{response.to_h.pretty_inspect}"
114
115
  raise msg
115
116
  end
117
+
116
118
  data = Ecoportal::API::Common::GraphQL::HashHelpers.deep_dup(res)
117
119
  response_class.new(data)
118
120
  end
@@ -14,7 +14,7 @@ module Ecoportal
14
14
 
15
15
  def basic_block(&block)
16
16
  payload_block = block || default_payload_block
17
- Proc.new {
17
+ proc {
18
18
  mutation(input: :ArchiveActionInput!) {
19
19
  archiveAction(input: :input, &payload_block)
20
20
  }
@@ -22,7 +22,7 @@ module Ecoportal
22
22
  end
23
23
 
24
24
  def default_payload_block
25
- Proc.new {
25
+ proc {
26
26
  clientMutationId
27
27
  errors {
28
28
  details
@@ -13,7 +13,7 @@ module Ecoportal
13
13
 
14
14
  def basic_block(&block)
15
15
  payload_block = block || default_payload_block
16
- Proc.new {
16
+ proc {
17
17
  mutation(input: :UpdateActionInput!) {
18
18
  updateAction(input: :input, &payload_block)
19
19
  }
@@ -21,7 +21,7 @@ module Ecoportal
21
21
  end
22
22
 
23
23
  def default_payload_block
24
- Proc.new {
24
+ proc {
25
25
  clientMutationId
26
26
  errors {
27
27
  details
@@ -7,13 +7,13 @@ module Ecoportal
7
7
  field_name :createContractorEntity
8
8
 
9
9
  class_resolver :payload_class, Ecoportal::API::GraphQL::Payload::ContractorEntity::Create
10
- class_resolver :input_class, Ecoportal::API::GraphQL::Model::ContractorEntity
10
+ class_resolver :input_class, Ecoportal::API::GraphQL::Input::ContractorEntity::Create
11
11
 
12
12
  private
13
13
 
14
14
  def basic_block(&block)
15
15
  payload_block = block || default_payload_block
16
- Proc.new {
16
+ proc {
17
17
  mutation(input: :CreateContractorEntityInput!) {
18
18
  createContractorEntity(input: :input, &payload_block)
19
19
  }
@@ -21,7 +21,7 @@ module Ecoportal
21
21
  end
22
22
 
23
23
  def default_payload_block
24
- Proc.new {
24
+ proc {
25
25
  clientMutationId
26
26
  errors {
27
27
  details
@@ -0,0 +1,40 @@
1
+ module Ecoportal
2
+ module API
3
+ class GraphQL
4
+ module Mutation
5
+ module ContractorEntity
6
+ class Destroy < Ecoportal::API::GraphQL::Logic::Mutation
7
+ field_name :destroyContractorEntity
8
+
9
+ class_resolver :payload_class, Ecoportal::API::GraphQL::Payload::ContractorEntity::Destroy
10
+ class_resolver :input_class, Ecoportal::API::GraphQL::Input::ContractorEntity::Destroy
11
+
12
+ private
13
+
14
+ def basic_block(&block)
15
+ payload_block = block || default_payload_block
16
+ proc {
17
+ mutation(input: :DestroyContractorEntityInput!) {
18
+ destroyContractorEntity(input: :input, &payload_block)
19
+ }
20
+ }
21
+ end
22
+
23
+ def default_payload_block
24
+ proc {
25
+ clientMutationId
26
+ errors {
27
+ details
28
+ fullMessages
29
+ }
30
+ item {
31
+ ___Fragment__ContractorEntity
32
+ }
33
+ }
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -7,13 +7,13 @@ module Ecoportal
7
7
  field_name :updateContractorEntity
8
8
 
9
9
  class_resolver :payload_class, Ecoportal::API::GraphQL::Payload::ContractorEntity::Update
10
- class_resolver :input_class, Ecoportal::API::GraphQL::Model::ContractorEntity
10
+ class_resolver :input_class, Ecoportal::API::GraphQL::Input::ContractorEntity::Update
11
11
 
12
12
  private
13
13
 
14
14
  def basic_block(&block)
15
15
  payload_block = block || default_payload_block
16
- Proc.new {
16
+ proc {
17
17
  mutation(input: :UpdateContractorEntityInput!) {
18
18
  updateContractorEntity(input: :input, &payload_block)
19
19
  }
@@ -21,7 +21,7 @@ module Ecoportal
21
21
  end
22
22
 
23
23
  def default_payload_block
24
- Proc.new {
24
+ proc {
25
25
  clientMutationId
26
26
  errors {
27
27
  details
@@ -10,5 +10,5 @@ module Ecoportal
10
10
  end
11
11
 
12
12
  require_relative 'contractor_entity/create'
13
- # require_relative 'contractor_entity/destroy'
13
+ require_relative 'contractor_entity/destroy'
14
14
  require_relative 'contractor_entity/update'
@@ -31,12 +31,12 @@ module Ecoportal
31
31
  }
32
32
  }
33
33
  results {
34
+ ok
34
35
  command {
35
36
  id
36
37
  state
37
38
  __typename
38
39
  }
39
- ok
40
40
  error {
41
41
  conflictingIds
42
42
  message
@@ -12,7 +12,7 @@ module Ecoportal
12
12
 
13
13
  def basic_block(&block)
14
14
  action_block = block || default_block
15
- Proc.new {
15
+ proc {
16
16
  query(id: :id!) {
17
17
  currentOrganization {
18
18
  action(id: :id, &action_block)
@@ -22,7 +22,7 @@ module Ecoportal
22
22
  end
23
23
 
24
24
  def default_block
25
- Proc.new {
25
+ proc {
26
26
  ___Ecoportal__API__GraphQL__Fragment__Action
27
27
  }
28
28
  end
@@ -12,7 +12,7 @@ module Ecoportal
12
12
 
13
13
  def basic_block(&block)
14
14
  connection_block = block || default_connection_block
15
- Proc.new {
15
+ proc {
16
16
  query(searchConf: :Search, after: :string, before: :string, first: :int, last: :int) {
17
17
  currentOrganization {
18
18
  actions(
@@ -29,7 +29,7 @@ module Ecoportal
29
29
  end
30
30
 
31
31
  def default_connection_block
32
- Proc.new {
32
+ proc {
33
33
  ___Ecoportal__API__GraphQL__Fragment__Pagination
34
34
  nodes {
35
35
  ___Ecoportal__API__GraphQL__Fragment__Action
@@ -12,7 +12,7 @@ module Ecoportal
12
12
 
13
13
  def basic_block(&block)
14
14
  connection_block = block || default_connection_block
15
- Proc.new {
15
+ proc {
16
16
  query(searchConf: :Search, after: :string, before: :string, first: :int, last: :int) {
17
17
  currentOrganization {
18
18
  contractorEntities(
@@ -29,7 +29,7 @@ module Ecoportal
29
29
  end
30
30
 
31
31
  def default_connection_block
32
- Proc.new {
32
+ proc {
33
33
  totalCount
34
34
  pageInfo {
35
35
  endCursor
@@ -1,5 +1,5 @@
1
1
  module Ecoportal
2
2
  module API
3
- GRAPQL_VERSION = "0.3.15"
3
+ GRAPQL_VERSION = '0.3.17'.freeze
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.3.15
4
+ version: 0.3.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Segura
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-04-12 00:00:00.000000000 Z
11
+ date: 2024-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -282,6 +282,7 @@ files:
282
282
  - lib/ecoportal/api/graphql/mutation/action/update.rb
283
283
  - lib/ecoportal/api/graphql/mutation/contractor_entity.rb
284
284
  - lib/ecoportal/api/graphql/mutation/contractor_entity/create.rb
285
+ - lib/ecoportal/api/graphql/mutation/contractor_entity/destroy.rb
285
286
  - lib/ecoportal/api/graphql/mutation/contractor_entity/update.rb
286
287
  - lib/ecoportal/api/graphql/mutation/location_structure.rb
287
288
  - lib/ecoportal/api/graphql/mutation/location_structure/apply_commands.rb