ecoportal-api-v2 0.8.33 → 0.9.1
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 +12 -2
- data/lib/ecoportal/api/v2/page/force/helper.rb +43 -0
- data/lib/ecoportal/api/v2/page/force.rb +19 -1
- data/lib/ecoportal/api/v2_version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd6779bebb389337e0a18e355c36cbb5c2ba0ed84f31b7cdbca3bec051a30bd2
|
4
|
+
data.tar.gz: 32e9cc407394ef5ae7ef56f87650180789d229930daf5d7e65d44c33768041ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2e84e20a4952e07ce7575f98a32b7cd216dbdc163fed0dcf9b9e383062e509d0702cff679b51e02b235afa0b68add386638d41eb5dc7cfcaaabfd965288530b
|
7
|
+
data.tar.gz: d0b3a2d2043a31cca656c98a812dc2e632ae565c121cc85991c211b51acafebb58206be305dbc9da1fcfaf23acc83218ddb1db952d43b76fb5fccc1bc933bde9
|
data/CHANGELOG.md
CHANGED
@@ -1,12 +1,22 @@
|
|
1
1
|
# Change Log
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
-
## [0.
|
4
|
+
## [0.9.2] - 2022-09-26
|
5
5
|
|
6
6
|
### Added
|
7
|
-
|
8
7
|
### Changed
|
8
|
+
### Fixed
|
9
|
+
|
10
|
+
|
11
|
+
## [0.9.1] - 2022-09-26
|
9
12
|
|
13
|
+
### Added
|
14
|
+
- `Ecoportal::API::V2::Page::Force::Helper`
|
15
|
+
|
16
|
+
### Changed
|
17
|
+
- `Ecoportal::API::V2::Page::Force`, logic around `helpers` (remote forces)
|
18
|
+
- **breaking change**: `script` is not writable anymore. You should use `custom_script` instead.
|
19
|
+
|
10
20
|
### Fixed
|
11
21
|
|
12
22
|
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require "base64"
|
2
|
+
module Ecoportal
|
3
|
+
module API
|
4
|
+
class V2
|
5
|
+
class Page
|
6
|
+
class Force
|
7
|
+
class Helper < Common::Content::DoubleModel
|
8
|
+
class << self
|
9
|
+
def new_doc
|
10
|
+
{
|
11
|
+
"id" => new_uuid
|
12
|
+
}
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
passkey :id
|
17
|
+
passforced :patch_ver, default: 1
|
18
|
+
passthrough :script
|
19
|
+
passthrough :name, :file_path, :content_b64, read_only: true
|
20
|
+
|
21
|
+
def ooze
|
22
|
+
self._parent.ooze
|
23
|
+
end
|
24
|
+
|
25
|
+
def force
|
26
|
+
self._parent._parent
|
27
|
+
end
|
28
|
+
|
29
|
+
def script=(value)
|
30
|
+
doc["content_b64"] = Base64.encode64(value)
|
31
|
+
doc["script"] = value
|
32
|
+
force.update_script
|
33
|
+
value
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
require 'ecoportal/api/v2/page/force/binding'
|
43
|
+
require 'ecoportal/api/v2/page/force/bindings'
|
@@ -15,11 +15,16 @@ module Ecoportal
|
|
15
15
|
end
|
16
16
|
|
17
17
|
class_resolver :bindings_class, "Ecoportal::API::V2::Page::Force::Bindings"
|
18
|
+
class_resolver :helper_class, "Ecoportal::API::V2::Page::Force::Helper"
|
18
19
|
|
19
20
|
passkey :id
|
20
21
|
passforced :patch_ver, default: 1
|
21
|
-
passthrough :name, :weight
|
22
|
+
passthrough :name, :weight
|
23
|
+
passdate :last_synced_at
|
24
|
+
passthrough :custom_script
|
25
|
+
passthrough :script, read_only: true
|
22
26
|
embeds_many :bindings, enum_class: :bindings_class
|
27
|
+
embeds_many :helpers, klass: :helper_class
|
23
28
|
|
24
29
|
def ooze
|
25
30
|
self._parent.ooze
|
@@ -29,11 +34,24 @@ module Ecoportal
|
|
29
34
|
def bind(reference, **kargs, &block)
|
30
35
|
bindings.add(reference, **kargs, &block)
|
31
36
|
end
|
37
|
+
|
38
|
+
# It updates `script` by using `helpers`
|
39
|
+
def custom_script=(value)
|
40
|
+
doc["custom_script"] = value
|
41
|
+
update_script
|
42
|
+
value
|
43
|
+
end
|
44
|
+
|
45
|
+
# It sets the `script` value by using `custom_script` and `helpers[N..1].script`
|
46
|
+
def update_script
|
47
|
+
doc["script"] = helpers.to_a.reverse.map(&:script).push(self.custom_script).join("\n")
|
48
|
+
end
|
32
49
|
end
|
33
50
|
end
|
34
51
|
end
|
35
52
|
end
|
36
53
|
end
|
37
54
|
|
55
|
+
require 'ecoportal/api/v2/page/force/helper'
|
38
56
|
require 'ecoportal/api/v2/page/force/binding'
|
39
57
|
require 'ecoportal/api/v2/page/force/bindings'
|
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.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oscar Segura
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-09-
|
11
|
+
date: 2022-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -222,6 +222,7 @@ files:
|
|
222
222
|
- lib/ecoportal/api/v2/page/force.rb
|
223
223
|
- lib/ecoportal/api/v2/page/force/binding.rb
|
224
224
|
- lib/ecoportal/api/v2/page/force/bindings.rb
|
225
|
+
- lib/ecoportal/api/v2/page/force/helper.rb
|
225
226
|
- lib/ecoportal/api/v2/page/forces.rb
|
226
227
|
- lib/ecoportal/api/v2/page/mould_counter.rb
|
227
228
|
- lib/ecoportal/api/v2/page/permission_flags.rb
|