ecoportal-api-v2 2.0.12 → 2.0.14
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/.gitignore +3 -0
- data/CHANGELOG.md +29 -3
- data/ecoportal-api-v2.gemspec +1 -1
- data/lib/ecoportal/api/common/content/array_model.rb +20 -3
- data/lib/ecoportal/api/common/content/class_helpers.rb +4 -2
- data/lib/ecoportal/api/common/content/client.rb +12 -6
- data/lib/ecoportal/api/common/content/collection_model/doc/items.rb +33 -0
- data/lib/ecoportal/api/common/content/collection_model/doc/rooted_key.rb +68 -0
- data/lib/ecoportal/api/common/content/collection_model/doc.rb +25 -0
- data/lib/ecoportal/api/common/content/collection_model/doc_mutation/delete.rb +33 -0
- data/lib/ecoportal/api/common/content/collection_model/doc_mutation/position.rb +42 -0
- data/lib/ecoportal/api/common/content/collection_model/doc_mutation/upsert.rb +45 -0
- data/lib/ecoportal/api/common/content/collection_model/doc_mutation.rb +27 -0
- data/lib/ecoportal/api/common/content/collection_model/model/cache.rb +44 -0
- data/lib/ecoportal/api/common/content/collection_model/model/items.rb +43 -0
- data/lib/ecoportal/api/common/content/collection_model/model/iterable.rb +44 -0
- data/lib/ecoportal/api/common/content/collection_model/model/lookup.rb +45 -0
- data/lib/ecoportal/api/common/content/collection_model/model/numeric_key.rb +40 -0
- data/lib/ecoportal/api/common/content/collection_model/model/var_tracking.rb +50 -0
- data/lib/ecoportal/api/common/content/collection_model/model.rb +33 -0
- data/lib/ecoportal/api/common/content/collection_model/modifiers/items_key.rb +57 -0
- data/lib/ecoportal/api/common/content/collection_model/modifiers/items_klass.rb +144 -0
- data/lib/ecoportal/api/common/content/collection_model/modifiers/items_order.rb +38 -0
- data/lib/ecoportal/api/common/content/collection_model/modifiers.rb +27 -0
- data/lib/ecoportal/api/common/content/collection_model/mutation/clear.rb +30 -0
- data/lib/ecoportal/api/common/content/collection_model/mutation/delete.rb +42 -0
- data/lib/ecoportal/api/common/content/collection_model/mutation/upsert.rb +56 -0
- data/lib/ecoportal/api/common/content/collection_model/mutation.rb +27 -0
- data/lib/ecoportal/api/common/content/collection_model.rb +19 -351
- data/lib/ecoportal/api/common/content/doc_helpers.rb +18 -16
- data/lib/ecoportal/api/common/content/double_model/attributable/base.rb +23 -0
- data/lib/ecoportal/api/common/content/double_model/attributable/enforce.rb +62 -0
- data/lib/ecoportal/api/common/content/double_model/attributable/nesting/cascaded_callback.rb +104 -0
- data/lib/ecoportal/api/common/content/double_model/attributable/nesting/embeddable.rb +76 -0
- data/lib/ecoportal/api/common/content/double_model/attributable/nesting/keyable.rb +119 -0
- data/lib/ecoportal/api/common/content/double_model/attributable/nesting.rb +136 -0
- data/lib/ecoportal/api/common/content/double_model/attributable/passthrough.rb +70 -0
- data/lib/ecoportal/api/common/content/double_model/attributable/simple.rb +48 -0
- data/lib/ecoportal/api/common/content/double_model/attributable.rb +30 -0
- data/lib/ecoportal/api/common/content/double_model/base.rb +29 -0
- data/lib/ecoportal/api/common/content/double_model/diffable_model.rb +43 -0
- data/lib/ecoportal/api/common/content/double_model/double_doc/base.rb +23 -0
- data/lib/ecoportal/api/common/content/double_model/double_doc/linkable_doc.rb +87 -0
- data/lib/ecoportal/api/common/content/double_model/double_doc/replaceable_doc.rb +61 -0
- data/lib/ecoportal/api/common/content/double_model/double_doc/reset_consolidate.rb +54 -0
- data/lib/ecoportal/api/common/content/double_model/double_doc/rooted_key.rb +49 -0
- data/lib/ecoportal/api/common/content/double_model/double_doc.rb +31 -0
- data/lib/ecoportal/api/common/content/double_model/hash_helpers.rb +40 -0
- data/lib/ecoportal/api/common/content/double_model/modifiers/read_only_able.rb +73 -0
- data/lib/ecoportal/api/common/content/double_model/modifiers/rootable.rb +64 -0
- data/lib/ecoportal/api/common/content/double_model/modifiers.rb +24 -0
- data/lib/ecoportal/api/common/content/double_model/parented.rb +22 -0
- data/lib/ecoportal/api/common/content/double_model/var_tracking.rb +45 -0
- data/lib/ecoportal/api/common/content/double_model.rb +28 -486
- data/lib/ecoportal/api/common/content/hash_diff_patch.rb +2 -1
- data/lib/ecoportal/api/common/content/includer.rb +16 -0
- data/lib/ecoportal/api/common/content/model_helpers.rb +14 -16
- data/lib/ecoportal/api/common/content.rb +1 -0
- data/lib/ecoportal/api/v2/page/component.rb +46 -46
- data/lib/ecoportal/api/v2/page/components.rb +2 -2
- data/lib/ecoportal/api/v2/page.rb +14 -14
- data/lib/ecoportal/api/v2/pages/page_stage/task.rb +2 -2
- data/lib/ecoportal/api/v2/pages/page_stage/tasks.rb +3 -3
- data/lib/ecoportal/api/v2/pages/page_stage.rb +8 -8
- data/lib/ecoportal/api/v2/pages/stages.rb +2 -2
- data/lib/ecoportal/api/v2/pages.rb +15 -15
- data/lib/ecoportal/api/v2/registers.rb +20 -19
- data/lib/ecoportal/api/v2/s3/files/batch_upload.rb +1 -0
- data/lib/ecoportal/api/v2/s3/files/poll.rb +5 -5
- data/lib/ecoportal/api/v2/s3/files/poll_status.rb +3 -3
- data/lib/ecoportal/api/v2/s3/files.rb +6 -6
- data/lib/ecoportal/api/v2/s3.rb +5 -5
- data/lib/ecoportal/api/v2.rb +18 -8
- data/lib/ecoportal/api/v2_version.rb +1 -1
- metadata +50 -4
data/lib/ecoportal/api/v2.rb
CHANGED
@@ -13,7 +13,7 @@ module Ecoportal
|
|
13
13
|
extend Ecoportal::API::Common::BaseClass
|
14
14
|
include Ecoportal::API::Common::Logging
|
15
15
|
|
16
|
-
VERSION =
|
16
|
+
VERSION = 'v2'.freeze
|
17
17
|
|
18
18
|
class << self
|
19
19
|
def v2key(ukey, gkey)
|
@@ -24,10 +24,10 @@ module Ecoportal
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
class_resolver :people_class,
|
28
|
-
class_resolver :registers_class,
|
29
|
-
class_resolver :pages_class,
|
30
|
-
class_resolver :s3_class,
|
27
|
+
class_resolver :people_class, 'Ecoportal::API::V2::People'
|
28
|
+
class_resolver :registers_class, 'Ecoportal::API::V2::Registers'
|
29
|
+
class_resolver :pages_class, 'Ecoportal::API::V2::Pages'
|
30
|
+
class_resolver :s3_class, 'Ecoportal::API::V2::S3'
|
31
31
|
|
32
32
|
attr_reader :client, :logger
|
33
33
|
|
@@ -41,7 +41,13 @@ module Ecoportal
|
|
41
41
|
# @param org_key [String] the org key used for the api connection (requires `user_key`).
|
42
42
|
# @param host [String] api server domain.
|
43
43
|
# @param logger [Logger] an object with `Logger` interface to generate logs.
|
44
|
-
def initialize(
|
44
|
+
def initialize(
|
45
|
+
api_key = nil,
|
46
|
+
user_key: nil,
|
47
|
+
org_key: nil,
|
48
|
+
host: 'live.ecoportal.com',
|
49
|
+
logger: default_logger
|
50
|
+
)
|
45
51
|
v2key = get_key(api_key: api_key, user_key: user_key, org_key: org_key)
|
46
52
|
@logger = logger
|
47
53
|
@client = Common::Content::Client.new(
|
@@ -81,8 +87,12 @@ module Ecoportal
|
|
81
87
|
def get_key(api_key: nil, user_key: nil, org_key: nil)
|
82
88
|
return self.class.v2key(user_key, org_key) if user_key && org_key
|
83
89
|
return api_key if api_key #|| ENV['X_ECOPORTAL_API_KEY']
|
84
|
-
|
85
|
-
|
90
|
+
|
91
|
+
msg = 'You need to provide either an api_key or user_key'
|
92
|
+
raise msg unless user_key
|
93
|
+
|
94
|
+
msg = 'You need to provide an org_key as well (not just a user_key)'
|
95
|
+
raise msg unless org_key
|
86
96
|
end
|
87
97
|
end
|
88
98
|
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: 2.0.
|
4
|
+
version: 2.0.14
|
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: 2025-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -135,7 +135,7 @@ dependencies:
|
|
135
135
|
version: '0.10'
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 0.10.
|
138
|
+
version: 0.10.8
|
139
139
|
type: :runtime
|
140
140
|
prerelease: false
|
141
141
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -145,7 +145,7 @@ dependencies:
|
|
145
145
|
version: '0.10'
|
146
146
|
- - ">="
|
147
147
|
- !ruby/object:Gem::Version
|
148
|
-
version: 0.10.
|
148
|
+
version: 0.10.8
|
149
149
|
- !ruby/object:Gem::Dependency
|
150
150
|
name: mime-types
|
151
151
|
requirement: !ruby/object:Gem::Requirement
|
@@ -197,9 +197,55 @@ files:
|
|
197
197
|
- lib/ecoportal/api/common/content/class_helpers.rb
|
198
198
|
- lib/ecoportal/api/common/content/client.rb
|
199
199
|
- lib/ecoportal/api/common/content/collection_model.rb
|
200
|
+
- lib/ecoportal/api/common/content/collection_model/doc.rb
|
201
|
+
- lib/ecoportal/api/common/content/collection_model/doc/items.rb
|
202
|
+
- lib/ecoportal/api/common/content/collection_model/doc/rooted_key.rb
|
203
|
+
- lib/ecoportal/api/common/content/collection_model/doc_mutation.rb
|
204
|
+
- lib/ecoportal/api/common/content/collection_model/doc_mutation/delete.rb
|
205
|
+
- lib/ecoportal/api/common/content/collection_model/doc_mutation/position.rb
|
206
|
+
- lib/ecoportal/api/common/content/collection_model/doc_mutation/upsert.rb
|
207
|
+
- lib/ecoportal/api/common/content/collection_model/model.rb
|
208
|
+
- lib/ecoportal/api/common/content/collection_model/model/cache.rb
|
209
|
+
- lib/ecoportal/api/common/content/collection_model/model/items.rb
|
210
|
+
- lib/ecoportal/api/common/content/collection_model/model/iterable.rb
|
211
|
+
- lib/ecoportal/api/common/content/collection_model/model/lookup.rb
|
212
|
+
- lib/ecoportal/api/common/content/collection_model/model/numeric_key.rb
|
213
|
+
- lib/ecoportal/api/common/content/collection_model/model/var_tracking.rb
|
214
|
+
- lib/ecoportal/api/common/content/collection_model/modifiers.rb
|
215
|
+
- lib/ecoportal/api/common/content/collection_model/modifiers/items_key.rb
|
216
|
+
- lib/ecoportal/api/common/content/collection_model/modifiers/items_klass.rb
|
217
|
+
- lib/ecoportal/api/common/content/collection_model/modifiers/items_order.rb
|
218
|
+
- lib/ecoportal/api/common/content/collection_model/mutation.rb
|
219
|
+
- lib/ecoportal/api/common/content/collection_model/mutation/clear.rb
|
220
|
+
- lib/ecoportal/api/common/content/collection_model/mutation/delete.rb
|
221
|
+
- lib/ecoportal/api/common/content/collection_model/mutation/upsert.rb
|
200
222
|
- lib/ecoportal/api/common/content/doc_helpers.rb
|
201
223
|
- lib/ecoportal/api/common/content/double_model.rb
|
224
|
+
- lib/ecoportal/api/common/content/double_model/attributable.rb
|
225
|
+
- lib/ecoportal/api/common/content/double_model/attributable/base.rb
|
226
|
+
- lib/ecoportal/api/common/content/double_model/attributable/enforce.rb
|
227
|
+
- lib/ecoportal/api/common/content/double_model/attributable/nesting.rb
|
228
|
+
- lib/ecoportal/api/common/content/double_model/attributable/nesting/cascaded_callback.rb
|
229
|
+
- lib/ecoportal/api/common/content/double_model/attributable/nesting/embeddable.rb
|
230
|
+
- lib/ecoportal/api/common/content/double_model/attributable/nesting/keyable.rb
|
231
|
+
- lib/ecoportal/api/common/content/double_model/attributable/passthrough.rb
|
232
|
+
- lib/ecoportal/api/common/content/double_model/attributable/simple.rb
|
233
|
+
- lib/ecoportal/api/common/content/double_model/base.rb
|
234
|
+
- lib/ecoportal/api/common/content/double_model/diffable_model.rb
|
235
|
+
- lib/ecoportal/api/common/content/double_model/double_doc.rb
|
236
|
+
- lib/ecoportal/api/common/content/double_model/double_doc/base.rb
|
237
|
+
- lib/ecoportal/api/common/content/double_model/double_doc/linkable_doc.rb
|
238
|
+
- lib/ecoportal/api/common/content/double_model/double_doc/replaceable_doc.rb
|
239
|
+
- lib/ecoportal/api/common/content/double_model/double_doc/reset_consolidate.rb
|
240
|
+
- lib/ecoportal/api/common/content/double_model/double_doc/rooted_key.rb
|
241
|
+
- lib/ecoportal/api/common/content/double_model/hash_helpers.rb
|
242
|
+
- lib/ecoportal/api/common/content/double_model/modifiers.rb
|
243
|
+
- lib/ecoportal/api/common/content/double_model/modifiers/read_only_able.rb
|
244
|
+
- lib/ecoportal/api/common/content/double_model/modifiers/rootable.rb
|
245
|
+
- lib/ecoportal/api/common/content/double_model/parented.rb
|
246
|
+
- lib/ecoportal/api/common/content/double_model/var_tracking.rb
|
202
247
|
- lib/ecoportal/api/common/content/hash_diff_patch.rb
|
248
|
+
- lib/ecoportal/api/common/content/includer.rb
|
203
249
|
- lib/ecoportal/api/common/content/model_helpers.rb
|
204
250
|
- lib/ecoportal/api/common/content/string_digest.rb
|
205
251
|
- lib/ecoportal/api/common/content/wrapped_response.rb
|