ecoportal-api-v2 0.8.11 → 0.8.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3d906a6021cc5fab91f2b2d8f32084d61449eab23b8162ade9e01308bdce3584
4
- data.tar.gz: fe195a200860d2696acfc465accb16ee8758f5dfc00d9cbeffed836d654c1f8c
3
+ metadata.gz: 692fe87a2a9dd089ee091bae7133915ac5c9ae4b0643be6086b57206569a1044
4
+ data.tar.gz: 4d9866b6e5727b176caaff881cb44a3cd13ca08418884e69283f8c64c0e80272
5
5
  SHA512:
6
- metadata.gz: 74b45e1025b675e5675a0d6822fcefee7c464ae0759deb0da1004913793cef32bd2ad14f3656ab5b2177ae80bd5ac79fe9451e74ff9faefac24179f8ba9b621c
7
- data.tar.gz: 8cab8147deaa80f9d3cd6dd5b31a42d0ba018001ca825e76a9a388999daef2ff686240c546255e6b8ac1785b1b7236ff4c124761b66d7cc414fef3c018480019
6
+ metadata.gz: b812fc350ccdfd173d8ca7b02b05bd0676eda8dac97e2a981cd6c87e1e62c7170744a352ef962144ffb24b3bf9eb43011156c78c09f22a00db154431fd2be5ca
7
+ data.tar.gz: 00c551099e991a339125e5a985f98aa918b8f9844e03b7b6ba79c6cc2fc5d9ffa4303eaee51c2acc6205932472cdf5324692a73d875e647ba0bcd685f676c60c
data/CHANGELOG.md CHANGED
@@ -1,6 +1,18 @@
1
1
  # Change Log
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## [0.8.12] - 2021-08-xx
5
+
6
+ ### Added
7
+ - `Ecoportal::API::V2::Pages::PageStage#current_stage`
8
+
9
+ ### Changed
10
+
11
+ ### Fixed
12
+ - `Ecoportal::API::Common::Content::DocHelpers#get_body` typo and wrong parameters on call.
13
+ - `Ecoportal::API::V2::Pages#update` should always return `Result` object.
14
+ - `Ecoportal::API::V2::Registers#search` was not using `cursor_id` to iterate.
15
+
4
16
  ## [0.8.11] - 2021-08-27
5
17
 
6
18
  ### Added
@@ -13,9 +13,9 @@ module Ecoportal
13
13
  when doc.respond_to?(:as_update)
14
14
  doc.as_update
15
15
  when doc.respond_to?(:as_json)
16
- Common::Content::HashPatchDiff.patch_diff(doc.as_json)
16
+ Common::Content::HashDiffPatch.patch_diff(doc.as_json, nil)
17
17
  when doc.is_a?(Hash)
18
- Common::Content::HashPatchDiff.patch_diff(doc)
18
+ Common::Content::HashDiffPatch.patch_diff(doc, nil)
19
19
  else
20
20
  raise "Could not get body for doc: #{doc}"
21
21
  end
@@ -15,6 +15,13 @@ module Ecoportal
15
15
  doc.dig("active_stage", "id") || doc["current_stage_id"]
16
16
  end
17
17
 
18
+ # @return [Ecoportal::API::V2::Page::Stage]
19
+ def current_stage
20
+ if stage_id = current_stage_id
21
+ stages[stage_id]
22
+ end
23
+ end
24
+
18
25
  end
19
26
  end
20
27
  end
@@ -53,10 +53,9 @@ module Ecoportal
53
53
  def update(doc)
54
54
  body = get_body(doc) # , level: "page"
55
55
  # Launch only if there are changes
56
- if body && body["page"]
57
- id = get_id(doc)
58
- client.patch("/pages/#{CGI.escape(id)}", data: body)
59
- end
56
+ raise "Missing page object" unless body && body["page"]
57
+ id = get_id(doc)
58
+ client.patch("/pages/#{CGI.escape(id)}", data: body)
60
59
  end
61
60
 
62
61
  # Gets a `new` non-existing page via api with all the ids initialized.
@@ -82,8 +82,8 @@ module Ecoportal
82
82
  yield object
83
83
  end
84
84
 
85
- # break unless (cursor_id = data["cursor_id"])
86
- break if total == results
85
+ break if total <= results
86
+ break unless (cursor_id = data["cursor_id"])
87
87
  end
88
88
  self
89
89
  end
@@ -1,5 +1,5 @@
1
1
  module Ecoportal
2
2
  module API
3
- GEM2_VERSION = "0.8.11"
3
+ GEM2_VERSION = "0.8.12"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecoportal-api-v2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.11
4
+ version: 0.8.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: 2021-08-27 00:00:00.000000000 Z
11
+ date: 2021-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler