ecoportal-api 0.8.5 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +20 -20
  3. data/.rspec +3 -3
  4. data/.rubocop.yml +55 -55
  5. data/.travis.yml +5 -5
  6. data/.yardopts +10 -10
  7. data/CHANGELOG.md +257 -236
  8. data/Gemfile +6 -6
  9. data/LICENSE +21 -21
  10. data/README.md +34 -34
  11. data/Rakefile +27 -27
  12. data/bin/console +14 -14
  13. data/bin/setup +8 -8
  14. data/ecoportal-api.gemspec +36 -36
  15. data/lib/ecoportal/api/common/base_class.rb +33 -29
  16. data/lib/ecoportal/api/common/base_model.rb +195 -177
  17. data/lib/ecoportal/api/common/batch_operation.rb +119 -119
  18. data/lib/ecoportal/api/common/batch_response.rb +34 -34
  19. data/lib/ecoportal/api/common/client.rb +198 -196
  20. data/lib/ecoportal/api/common/doc_helpers.rb +29 -29
  21. data/lib/ecoportal/api/common/elastic_apm_integration.rb +112 -112
  22. data/lib/ecoportal/api/common/hash_diff.rb +41 -41
  23. data/lib/ecoportal/api/common/logging.rb +12 -12
  24. data/lib/ecoportal/api/common/response.rb +31 -31
  25. data/lib/ecoportal/api/common/wrapped_response.rb +54 -54
  26. data/lib/ecoportal/api/common.rb +18 -18
  27. data/lib/ecoportal/api/errors/base.rb +8 -8
  28. data/lib/ecoportal/api/errors/time_out.rb +8 -8
  29. data/lib/ecoportal/api/errors.rb +9 -9
  30. data/lib/ecoportal/api/internal/account.rb +99 -100
  31. data/lib/ecoportal/api/internal/login_provider.rb +9 -9
  32. data/lib/ecoportal/api/internal/login_providers.rb +33 -33
  33. data/lib/ecoportal/api/internal/people.rb +14 -14
  34. data/lib/ecoportal/api/internal/permissions.rb +14 -13
  35. data/lib/ecoportal/api/internal/person.rb +101 -53
  36. data/lib/ecoportal/api/internal/person_details.rb +9 -9
  37. data/lib/ecoportal/api/internal/person_schema.rb +10 -10
  38. data/lib/ecoportal/api/internal/person_schemas.rb +11 -11
  39. data/lib/ecoportal/api/internal/policy_group.rb +9 -9
  40. data/lib/ecoportal/api/internal/policy_groups.rb +32 -32
  41. data/lib/ecoportal/api/internal/preferences.rb +31 -31
  42. data/lib/ecoportal/api/internal/schema_field.rb +8 -8
  43. data/lib/ecoportal/api/internal/schema_field_value.rb +8 -8
  44. data/lib/ecoportal/api/internal.rb +31 -31
  45. data/lib/ecoportal/api/logger.rb +62 -62
  46. data/lib/ecoportal/api/v1/people.rb +218 -218
  47. data/lib/ecoportal/api/v1/person.rb +138 -135
  48. data/lib/ecoportal/api/v1/person_details.rb +94 -82
  49. data/lib/ecoportal/api/v1/person_schema.rb +53 -53
  50. data/lib/ecoportal/api/v1/person_schemas.rb +48 -48
  51. data/lib/ecoportal/api/v1/schema_field.rb +34 -34
  52. data/lib/ecoportal/api/v1/schema_field_value.rb +65 -65
  53. data/lib/ecoportal/api/v1.rb +49 -49
  54. data/lib/ecoportal/api/version.rb +5 -5
  55. data/lib/ecoportal/api.rb +16 -16
  56. metadata +3 -3
data/CHANGELOG.md CHANGED
@@ -1,236 +1,257 @@
1
- # Change Log
2
- All notable changes to this project will be documented in this file.
3
-
4
- ## [0.8.5] - 2022-02-28
5
-
6
- ### Added
7
- - `Ecoportal::API::V1::PersonDetails#[]` to raise a specific error type to allow handling
8
- - `Ecoportal::API::V1::PersonDetails.key?` to allow to check if a field exists
9
- - `Ecoportal::API::Internal::Account#force_send_invites` support for back-end new method
10
-
11
- ### Fixed
12
- - `Ecoportal::API::V1::People#get` fixed typo
13
- - `Ecoportal::API::Common::BaseModel` `#original_doc` and `#initial_doc` maybe empty for the parent object
14
-
15
- ### Changed
16
- - `Ecoportal::API::V1::People#each` limited the `GET` retries to `5`
17
- - `Ecoportal::API::Internal::Account#default_tag=`
18
- - Controls input type to be `String` or `nil`
19
- - Inherent `upcase`
20
-
21
- ## [0.8.4] - 2021-11-05
22
-
23
- ### Added
24
- - `Ecoportal::API::Internal::Permissions` added abilities
25
- - `visitor_management`, `cross_register_reporting` and `broadcast_notifications`
26
- - Some yardocs too
27
- - Some callbacks are done in a non-obvious way and the returned object type was not documented
28
- - For this reason, some yardocs have been added to some of the parts that have been worked on.
29
-
30
- ### Fixed
31
- - `Ecoportal::API::V1::People#create_job`
32
- - **Removed** call to `BatchOperation#process_response`
33
- - The method was is already called by `job_result`
34
- - As a consequence there was a double up of `callbacks`
35
- - **Fixed** line in wrong position
36
- - `Ecoportal::API::V1::People#batch`
37
- - `Ecoportal::API::Common::ElasticApmIntegration#unexpected_server_error?`
38
- - No code or code lesser than 100 is a server error as well
39
-
40
- ### Changed
41
- - `Ecoportal::API::Common::Client`: changed
42
- - Logging the **response** of batches or batch jobs can be handy when debugging the back-end
43
- - **removed** method `#without_response_logging`
44
- - This change entailed to remove dependencies in `Ecoportal::API::V1::People`
45
- - Specifically in methods `#batch`, `#job_result` and `#create_job`
46
- - `@response_logging_enabled` to be set in initialization stage (added parameter for `.new`)
47
-
48
- ## [0.8.3] - 2021-05-24
49
-
50
- ### Added
51
- - `Ecoportal::API::Errors` namespace
52
- - `Ecoportal::API::Errors::Base` base error class.
53
- - `Ecoportal::API::Errors::TimeOut` error when an api request fails with time out.
54
- - This serves the purpose to allow a client script to re-start the process where it stopped by capturing this specific Error
55
- - `Ecoportal::API::Common::BaseModel::UnlinkedModel` added more description to track down the source of the error.
56
- - `Ecoportal::API::Common::BaseModel#reset!` added parameter `key`, which should try to recover `doc[key]` from `original_doc[key]`
57
- - Thanks to this, you are supposed to be able to do things like:
58
- - `person.account = nil && person.reset!("account")`
59
- - `person.name = nil && person.reset!("name")`
60
- - `Ecoportal::API::V1::People#job` methods to provide more information on failure.
61
- - Specific changes due to eP **release `1.5.9.70`** (_Policy Group Abilities_)
62
- - `Ecoportal::API::Internal::Account#permissions_merged`
63
- - `Ecoportal::API::Internal::Permissions#person_abilities` (new ability)
64
- - `Ecoportal::API::Internal::Account#user_id`
65
-
66
- ### Fixed
67
- - `Ecoportal::API::Internal::Account`: consistency in setting arrays (`uniq!` & `compact`)
68
- - `#policy_group_ids=`, `#login_provider_ids=`, `#starred_ids=`
69
- - `Ecoportal::API::Common::HashDiff.diff` was including empty `{}` objects
70
- - This change sacrifices the case `account: {}` (which will be also removed from `as_update`), but it should be fine.
71
-
72
- ### Changed
73
- - `Ecoportal::API::V1::People#job` to raise specific error on time out `API::Errors::TimeOut`
74
- - Specific changes due to eP **release `1.5.9.70`** (_Policy Group Abilities_)
75
- - `Ecoportal::API::Internal::Account` **removed** methods: `#permissions_preset`, `#preset` and `#preset=`
76
- - `Ecoportal::API::Internal::Person#account=` added support for `user_id` which should remain unchanged when existing
77
- - **remove** from `as_update` **read-only** data
78
- - `Ecoportal::API::Common::HashDiff.diff` added parameter `:ignore` (`Array`)
79
- - `Ecoportal::API::Common::BaseModel#as_update` added parameter `:ignore`
80
- - `Ecoportal::API::V1::Person#as_update` added method, which ignores `subordinates`
81
- - `Ecoportal::API::Internal::Person#as_update` added method, which ignores `user_id`, `permissions_merged` and `prefilter`
82
- - `Ecoportal::API::Internal::Account#as_update` added method, which ignores `user_id`, `permissions_merged` and `prefilter`
83
- - `Ecoportal::API::Common::Client` native support for `elastic-apm`
84
- - Via new module `Ecoportal::API::Common::ElasticApmIntegration` with method `log_unexpected_server_error`, which will only log an `UnexpectedServerError` to _ElasticAPM_ if
85
- 1. There's a correct configuration: environmental variables `ELASTIC_APM_KEY` and `ELASTIC_APM_ACCOUNT_ID` are defined
86
- 2. The `Response` from the server gave `code` in the range `5xx` (which are those under server responsibility)
87
- - `Ecoportal::API::Common::Client` added retry logics when `response.status == 5xx`
88
-
89
- ## [0.8.2] - 2021-02-24
90
-
91
- ### Added
92
-
93
- ### Fixed
94
- - `Ecoportal::API::V1::Person#filter_tags=` should ignore `nil` values
95
-
96
- ### Changed
97
- - removed all the namespace under `Ecoportal::API::V2` as that is managed by `ecoportal-api-oozes` gem
98
- - url: https://rubygems.org/gems/ecoportal-api-oozes
99
- - `Ecoportal::API::V1::People.get` should return a `Person` object
100
- - observe that it was returning the `WrappedResponse` (an `Enumerable` helper that works better when getting multiple people).
101
-
102
- ## [0.7.5] - 2021-02-12
103
-
104
- ### Added
105
-
106
- ### Fixed
107
- - `pretty_print` method was colliding with `pp` module:
108
- - renamed to `Ecoportal::API::Common::BaseModel#print_pretty`
109
- - renamed to `Ecoportal::API::Common::BatchReponse#print_pretty`
110
- - renamed to `Ecoportal::API::Common::Reponse#print_pretty`
111
- - renamed to `Ecoportal::API::Common::WrappedResponse#print_pretty`
112
-
113
- ### Changed
114
- - forgot to change `Ecoportal::API::VERSION` during last release
115
-
116
- ## [0.7.4] - 2021-01-2
117
-
118
- ### Added
119
-
120
- ### Fixed
121
- - changed `compact` to `compact!`:
122
- - `Ecoportal::API::V1::Person#filter_tags=`
123
- - `Ecoportal::API::Internal::Account#policy_group_ids=`
124
- - `Ecoportal::API::Internal::Account#login_provider_ids=`
125
- - `Ecoportal::API::Internal::Account#starred_ids=`
126
-
127
- ### Changed
128
-
129
- ## [0.7.3] - 2020-11-30
130
-
131
- ### Added
132
-
133
- ### Fixed
134
- - `Ecoportal::API::V1::Person#email=`: was not showing the incorrect value in the error message
135
- - added `compact` to remove `null` values on:
136
- - `Ecoportal::API::V1::Person#filter_tags=`
137
- - `Ecoportal::API::Internal::Account#policy_group_ids=`
138
- - `Ecoportal::API::Internal::Account#login_provider_ids=`
139
- - `Ecoportal::API::Internal::Account#starred_ids=`
140
-
141
- ### Changed
142
-
143
-
144
- ## [0.7.2] - 2020-10-19
145
-
146
- ### Added
147
- - `Ecoportal::API::V1::Person#email=`:
148
- - do a minimum validation (no blanks in the email)
149
- - set in lower case (as this is how it's in the server)
150
- ### Fixed
151
- - `Ecoportal::API::V1::People#each`: when `silent` it shouldn't print a blank line
152
- - fixed so they return empty array `[]` when `nil`:
153
- - `Ecoportal::API::V1::Person#filter_tags`
154
- - `Ecoportal::API::Internal::Account#policy_group_ids`
155
- - `Ecoportal::API::Internal::Account#login_provider_ids`
156
- - `Ecoportal::API::Internal::Account#starred_ids`
157
- ### Changed
158
- - made it so some methods the `Array` with `uniq` values:
159
- - `Ecoportal::API::V1::Person#filter_tags=`
160
- - `Ecoportal::API::Internal::Account#policy_group_ids=`
161
- - made it so it only updates the keys defined in the `Hash` passed to the setter:
162
- - `Ecoportal::API::Internal::Account#permissions_custom=`
163
- - `Ecoportal::API::Internal::Account#preferences=`
164
-
165
-
166
- ## [0.7.1] - 2020-09-30
167
-
168
- ### Added
169
- - `Ecoportal::API::Internal::Permissions`: **update for new ability `tasks` of ecoPortal release `1.5.3`**
170
- - `Ecoportal::API::V1::People#each`: added keyword argument `silent:` to display download progress
171
- ### Fixed
172
- - `Ecoportal::API::V1::People#each`: when no block provided, it was creating an `Enumarator` without preserving the parameters (i.e. `:q` or `per_page` were lost)
173
-
174
- ## [0.7.0] - 2020-09-11
175
-
176
- ### Added
177
- - added hook, **private** method `body_data` for child classes to define behaviour on `response.body` to
178
- - `Ecoportal::API::V1::People`
179
- - `Ecoportal::API::Common::BatchOperation`
180
-
181
- ### Changed
182
- - `Ecoportal::API::Internal::Permissions`: **update for new abilities of ecoPortal release `1.5.2`**
183
- - decoupled abilities: `person_core` into `person_core_create`, `person_core_edit`
184
- ### Fixed
185
-
186
-
187
- ## [0.6.0] - 2020-07-14
188
-
189
- ### Added
190
- - `Ecoportal::API::Common::BaseModel#initial_doc`: `#consolidate!` modifies `original_doc`
191
- - this helper allows to know what was the initial document the object was created with
192
- - `Ecoportal::API::Common::BaseModel#as_update`: added parameter (default: `:last` => compare with `original_doc`)
193
- - calling it with `:total` will compare the current `doc` with the `initial_doc`
194
- ### Changed
195
- - `Ecoportal::API::Internal::Permissions`: **update for new abilities of ecoPortal release `1.5.0`**
196
- - added abilities: `person_core`, `person_account`, `person_details`
197
- - removed ability: `people`
198
- - renamed `print` to `pretty_print` to avoid overriding `$stdout.print`, on:
199
- - `Ecoportal::API::Common::BaseModel`
200
- - `Ecoportal::API::Common::BatchReponse`
201
- - `Ecoportal::API::Common::Response`
202
- - `Ecoportal::API::Common::WrappedResponse`
203
- ### Fixed
204
- - `Ecoportal::API::Internal::Preferences`: **kiosk** settings should default to `false` (`nil`)
205
-
206
- ## [0.5.8] - 2020-06-23
207
-
208
- ### Added
209
- ### Changed
210
- ### Fixed
211
- - `Ecoportal::API::V1::Person#filter_tags=`: `original_doc["filter_tags"]` is `nil` when creating a person
212
- - `Ecoportal::API::Internal::Account#policy_group_ids=`: `original_doc["account"]` is `nil` when creating a person
213
-
214
-
215
- ## [0.5.7] - 2020-06-22
216
-
217
- ### Added
218
- - `Ecoportal::API::V1::PersonSchema`: added `enable_tags` & `tags` properties
219
- - `Ecoportal::API::Internal::Preferences`: added missing fields for **kiosk**
220
- ### Changed
221
- - `Ecoportal::API::V1::People::JOB_TIMEOUT`: from 1 minute to 3 minutes
222
- - `Ecoportal::API::V1::Person#filter_tags=`: will preserve the original order of the matching tags
223
- * this change is to prevent `as_update` to generate false update positives
224
- - `Ecoportal::API::Internal::Account#policy_group_ids=`: will preserve the original order of the matching ids
225
- * this change is to prevent `as_update` to generate false update positives
226
- ### Fixed
227
- - `Ecoportal::API::Internal::Preferences`: access `doc` using string keys (not with `symbol` keys)
228
-
229
-
230
- ## [0.5.6] - 2020-06-08
231
-
232
- ### Added
233
- - this `CHANGELOG.md` file
234
- - person model: `freemium` core property
235
- ### Changed
236
- ### Fixed
1
+ # Change Log
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ ## [0.9.1] - 2023-03-09
5
+
6
+ ### Added
7
+ - `Ecoportal::API::V1::Person#contractor_organization_id` support for contractor management
8
+ - `Ecoportal::API::Common::BaseModel` **added** `doc` helper methods:
9
+ - `replace_doc!` and `#replace_original_doc!`
10
+ - `Ecoportal::API::Internal::Person` **added** methods
11
+ - **breaking change**, they default to compare with `original_doc`, while they did it with `initial_doc`)
12
+ - `#new?` => to know if this person is being created now (it doesn't exist on **server side**).
13
+ - `#account_added?` => to know if this person is getting the account added.
14
+ - `#account_removed?` => to know if this person is getting their account removed.
15
+ - `Ecoportal::API::Common::Client#host` expose
16
+ - `Ecoportal::API::Internal::Permissions` added abilities
17
+ - `contractor_management`
18
+
19
+ ### Fixed
20
+ - `Ecoportal::API::V1::PersonDetails.key?` should index first.
21
+
22
+ ### Changed
23
+ - `Ecoportal::API::V1::Person::VALID_TAG_REGEX` allow dot `.` in tags.
24
+
25
+ ## [0.8.5] - 2022-02-28
26
+
27
+ ### Added
28
+ - `Ecoportal::API::V1::PersonDetails#[]` to raise a specific error type to allow handling
29
+ - `Ecoportal::API::V1::PersonDetails.key?` to allow to check if a field exists
30
+ - `Ecoportal::API::Internal::Account#force_send_invites` support for back-end new method
31
+
32
+ ### Fixed
33
+ - `Ecoportal::API::V1::People#get` fixed typo
34
+ - `Ecoportal::API::Common::BaseModel` `#original_doc` and `#initial_doc` maybe empty for the parent object
35
+
36
+ ### Changed
37
+ - `Ecoportal::API::V1::People#each` limited the `GET` retries to `5`
38
+ - `Ecoportal::API::Internal::Account#default_tag=`
39
+ - Controls input type to be `String` or `nil`
40
+ - Inherent `upcase`
41
+
42
+ ## [0.8.4] - 2021-11-05
43
+
44
+ ### Added
45
+ - `Ecoportal::API::Internal::Permissions` added abilities
46
+ - `visitor_management`, `cross_register_reporting` and `broadcast_notifications`
47
+ - Some yardocs too
48
+ - Some callbacks are done in a non-obvious way and the returned object type was not documented
49
+ - For this reason, some yardocs have been added to some of the parts that have been worked on.
50
+
51
+ ### Fixed
52
+ - `Ecoportal::API::V1::People#create_job`
53
+ - **Removed** call to `BatchOperation#process_response`
54
+ - The method was is already called by `job_result`
55
+ - As a consequence there was a double up of `callbacks`
56
+ - **Fixed** line in wrong position
57
+ - `Ecoportal::API::V1::People#batch`
58
+ - `Ecoportal::API::Common::ElasticApmIntegration#unexpected_server_error?`
59
+ - No code or code lesser than 100 is a server error as well
60
+
61
+ ### Changed
62
+ - `Ecoportal::API::Common::Client`: changed
63
+ - Logging the **response** of batches or batch jobs can be handy when debugging the back-end
64
+ - **removed** method `#without_response_logging`
65
+ - This change entailed to remove dependencies in `Ecoportal::API::V1::People`
66
+ - Specifically in methods `#batch`, `#job_result` and `#create_job`
67
+ - `@response_logging_enabled` to be set in initialization stage (added parameter for `.new`)
68
+
69
+ ## [0.8.3] - 2021-05-24
70
+
71
+ ### Added
72
+ - `Ecoportal::API::Errors` namespace
73
+ - `Ecoportal::API::Errors::Base` base error class.
74
+ - `Ecoportal::API::Errors::TimeOut` error when an api request fails with time out.
75
+ - This serves the purpose to allow a client script to re-start the process where it stopped by capturing this specific Error
76
+ - `Ecoportal::API::Common::BaseModel::UnlinkedModel` added more description to track down the source of the error.
77
+ - `Ecoportal::API::Common::BaseModel#reset!` added parameter `key`, which should try to recover `doc[key]` from `original_doc[key]`
78
+ - Thanks to this, you are supposed to be able to do things like:
79
+ - `person.account = nil && person.reset!("account")`
80
+ - `person.name = nil && person.reset!("name")`
81
+ - `Ecoportal::API::V1::People#job` methods to provide more information on failure.
82
+ - Specific changes due to eP **release `1.5.9.70`** (_Policy Group Abilities_)
83
+ - `Ecoportal::API::Internal::Account#permissions_merged`
84
+ - `Ecoportal::API::Internal::Permissions#person_abilities` (new ability)
85
+ - `Ecoportal::API::Internal::Account#user_id`
86
+
87
+ ### Fixed
88
+ - `Ecoportal::API::Internal::Account`: consistency in setting arrays (`uniq!` & `compact`)
89
+ - `#policy_group_ids=`, `#login_provider_ids=`, `#starred_ids=`
90
+ - `Ecoportal::API::Common::HashDiff.diff` was including empty `{}` objects
91
+ - This change sacrifices the case `account: {}` (which will be also removed from `as_update`), but it should be fine.
92
+
93
+ ### Changed
94
+ - `Ecoportal::API::V1::People#job` to raise specific error on time out `API::Errors::TimeOut`
95
+ - Specific changes due to eP **release `1.5.9.70`** (_Policy Group Abilities_)
96
+ - `Ecoportal::API::Internal::Account` **removed** methods: `#permissions_preset`, `#preset` and `#preset=`
97
+ - `Ecoportal::API::Internal::Person#account=` added support for `user_id` which should remain unchanged when existing
98
+ - **remove** from `as_update` **read-only** data
99
+ - `Ecoportal::API::Common::HashDiff.diff` added parameter `:ignore` (`Array`)
100
+ - `Ecoportal::API::Common::BaseModel#as_update` added parameter `:ignore`
101
+ - `Ecoportal::API::V1::Person#as_update` added method, which ignores `subordinates`
102
+ - `Ecoportal::API::Internal::Person#as_update` added method, which ignores `user_id`, `permissions_merged` and `prefilter`
103
+ - `Ecoportal::API::Internal::Account#as_update` added method, which ignores `user_id`, `permissions_merged` and `prefilter`
104
+ - `Ecoportal::API::Common::Client` native support for `elastic-apm`
105
+ - Via new module `Ecoportal::API::Common::ElasticApmIntegration` with method `log_unexpected_server_error`, which will only log an `UnexpectedServerError` to _ElasticAPM_ if
106
+ 1. There's a correct configuration: environmental variables `ELASTIC_APM_KEY` and `ELASTIC_APM_ACCOUNT_ID` are defined
107
+ 2. The `Response` from the server gave `code` in the range `5xx` (which are those under server responsibility)
108
+ - `Ecoportal::API::Common::Client` added retry logics when `response.status == 5xx`
109
+
110
+ ## [0.8.2] - 2021-02-24
111
+
112
+ ### Added
113
+
114
+ ### Fixed
115
+ - `Ecoportal::API::V1::Person#filter_tags=` should ignore `nil` values
116
+
117
+ ### Changed
118
+ - removed all the namespace under `Ecoportal::API::V2` as that is managed by `ecoportal-api-oozes` gem
119
+ - url: https://rubygems.org/gems/ecoportal-api-oozes
120
+ - `Ecoportal::API::V1::People.get` should return a `Person` object
121
+ - observe that it was returning the `WrappedResponse` (an `Enumerable` helper that works better when getting multiple people).
122
+
123
+ ## [0.7.5] - 2021-02-12
124
+
125
+ ### Added
126
+
127
+ ### Fixed
128
+ - `pretty_print` method was colliding with `pp` module:
129
+ - renamed to `Ecoportal::API::Common::BaseModel#print_pretty`
130
+ - renamed to `Ecoportal::API::Common::BatchReponse#print_pretty`
131
+ - renamed to `Ecoportal::API::Common::Reponse#print_pretty`
132
+ - renamed to `Ecoportal::API::Common::WrappedResponse#print_pretty`
133
+
134
+ ### Changed
135
+ - forgot to change `Ecoportal::API::VERSION` during last release
136
+
137
+ ## [0.7.4] - 2021-01-2
138
+
139
+ ### Added
140
+
141
+ ### Fixed
142
+ - changed `compact` to `compact!`:
143
+ - `Ecoportal::API::V1::Person#filter_tags=`
144
+ - `Ecoportal::API::Internal::Account#policy_group_ids=`
145
+ - `Ecoportal::API::Internal::Account#login_provider_ids=`
146
+ - `Ecoportal::API::Internal::Account#starred_ids=`
147
+
148
+ ### Changed
149
+
150
+ ## [0.7.3] - 2020-11-30
151
+
152
+ ### Added
153
+
154
+ ### Fixed
155
+ - `Ecoportal::API::V1::Person#email=`: was not showing the incorrect value in the error message
156
+ - added `compact` to remove `null` values on:
157
+ - `Ecoportal::API::V1::Person#filter_tags=`
158
+ - `Ecoportal::API::Internal::Account#policy_group_ids=`
159
+ - `Ecoportal::API::Internal::Account#login_provider_ids=`
160
+ - `Ecoportal::API::Internal::Account#starred_ids=`
161
+
162
+ ### Changed
163
+
164
+
165
+ ## [0.7.2] - 2020-10-19
166
+
167
+ ### Added
168
+ - `Ecoportal::API::V1::Person#email=`:
169
+ - do a minimum validation (no blanks in the email)
170
+ - set in lower case (as this is how it's in the server)
171
+ ### Fixed
172
+ - `Ecoportal::API::V1::People#each`: when `silent` it shouldn't print a blank line
173
+ - fixed so they return empty array `[]` when `nil`:
174
+ - `Ecoportal::API::V1::Person#filter_tags`
175
+ - `Ecoportal::API::Internal::Account#policy_group_ids`
176
+ - `Ecoportal::API::Internal::Account#login_provider_ids`
177
+ - `Ecoportal::API::Internal::Account#starred_ids`
178
+ ### Changed
179
+ - made it so some methods the `Array` with `uniq` values:
180
+ - `Ecoportal::API::V1::Person#filter_tags=`
181
+ - `Ecoportal::API::Internal::Account#policy_group_ids=`
182
+ - made it so it only updates the keys defined in the `Hash` passed to the setter:
183
+ - `Ecoportal::API::Internal::Account#permissions_custom=`
184
+ - `Ecoportal::API::Internal::Account#preferences=`
185
+
186
+
187
+ ## [0.7.1] - 2020-09-30
188
+
189
+ ### Added
190
+ - `Ecoportal::API::Internal::Permissions`: **update for new ability `tasks` of ecoPortal release `1.5.3`**
191
+ - `Ecoportal::API::V1::People#each`: added keyword argument `silent:` to display download progress
192
+ ### Fixed
193
+ - `Ecoportal::API::V1::People#each`: when no block provided, it was creating an `Enumarator` without preserving the parameters (i.e. `:q` or `per_page` were lost)
194
+
195
+ ## [0.7.0] - 2020-09-11
196
+
197
+ ### Added
198
+ - added hook, **private** method `body_data` for child classes to define behaviour on `response.body` to
199
+ - `Ecoportal::API::V1::People`
200
+ - `Ecoportal::API::Common::BatchOperation`
201
+
202
+ ### Changed
203
+ - `Ecoportal::API::Internal::Permissions`: **update for new abilities of ecoPortal release `1.5.2`**
204
+ - decoupled abilities: `person_core` into `person_core_create`, `person_core_edit`
205
+ ### Fixed
206
+
207
+
208
+ ## [0.6.0] - 2020-07-14
209
+
210
+ ### Added
211
+ - `Ecoportal::API::Common::BaseModel#initial_doc`: `#consolidate!` modifies `original_doc`
212
+ - this helper allows to know what was the initial document the object was created with
213
+ - `Ecoportal::API::Common::BaseModel#as_update`: added parameter (default: `:last` => compare with `original_doc`)
214
+ - calling it with `:total` will compare the current `doc` with the `initial_doc`
215
+ ### Changed
216
+ - `Ecoportal::API::Internal::Permissions`: **update for new abilities of ecoPortal release `1.5.0`**
217
+ - added abilities: `person_core`, `person_account`, `person_details`
218
+ - removed ability: `people`
219
+ - renamed `print` to `pretty_print` to avoid overriding `$stdout.print`, on:
220
+ - `Ecoportal::API::Common::BaseModel`
221
+ - `Ecoportal::API::Common::BatchReponse`
222
+ - `Ecoportal::API::Common::Response`
223
+ - `Ecoportal::API::Common::WrappedResponse`
224
+ ### Fixed
225
+ - `Ecoportal::API::Internal::Preferences`: **kiosk** settings should default to `false` (`nil`)
226
+
227
+ ## [0.5.8] - 2020-06-23
228
+
229
+ ### Added
230
+ ### Changed
231
+ ### Fixed
232
+ - `Ecoportal::API::V1::Person#filter_tags=`: `original_doc["filter_tags"]` is `nil` when creating a person
233
+ - `Ecoportal::API::Internal::Account#policy_group_ids=`: `original_doc["account"]` is `nil` when creating a person
234
+
235
+
236
+ ## [0.5.7] - 2020-06-22
237
+
238
+ ### Added
239
+ - `Ecoportal::API::V1::PersonSchema`: added `enable_tags` & `tags` properties
240
+ - `Ecoportal::API::Internal::Preferences`: added missing fields for **kiosk**
241
+ ### Changed
242
+ - `Ecoportal::API::V1::People::JOB_TIMEOUT`: from 1 minute to 3 minutes
243
+ - `Ecoportal::API::V1::Person#filter_tags=`: will preserve the original order of the matching tags
244
+ * this change is to prevent `as_update` to generate false update positives
245
+ - `Ecoportal::API::Internal::Account#policy_group_ids=`: will preserve the original order of the matching ids
246
+ * this change is to prevent `as_update` to generate false update positives
247
+ ### Fixed
248
+ - `Ecoportal::API::Internal::Preferences`: access `doc` using string keys (not with `symbol` keys)
249
+
250
+
251
+ ## [0.5.6] - 2020-06-08
252
+
253
+ ### Added
254
+ - this `CHANGELOG.md` file
255
+ - person model: `freemium` core property
256
+ ### Changed
257
+ ### Fixed
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
- source "https://rubygems.org"
2
-
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
-
5
- # Specify your gem's dependencies in ecoportal-api.gemspec
6
- gemspec
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in ecoportal-api.gemspec
6
+ gemspec
data/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2018 ecoPortal
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2018 ecoPortal
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -1,34 +1,34 @@
1
- # Ecoportal::API
2
-
3
- This is a basic collection of helpers that can be used to interact with the
4
- [ecoPortal](https://www.ecoportal.com) API.
5
-
6
- ## Installation
7
-
8
- Add this line to your application's Gemfile:
9
-
10
- ```ruby
11
- gem 'ecoportal-api', require: %w[ecoportal/api]
12
- ```
13
-
14
- And then execute:
15
-
16
- $ bundle
17
-
18
- Or install it yourself as:
19
-
20
- $ gem install ecoportal-api
21
-
22
- ## Usage
23
-
24
- TODO
25
-
26
- ## Development
27
-
28
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
29
-
30
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
31
-
32
- ## Contributing
33
-
34
- Bug reports and pull requests are welcome on GitLab at https://gitlab.com/ecoPortal/ecoportal-api.
1
+ # Ecoportal::API
2
+
3
+ This is a basic collection of helpers that can be used to interact with the
4
+ [ecoPortal](https://www.ecoportal.com) API.
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ ```ruby
11
+ gem 'ecoportal-api', require: %w[ecoportal/api]
12
+ ```
13
+
14
+ And then execute:
15
+
16
+ $ bundle
17
+
18
+ Or install it yourself as:
19
+
20
+ $ gem install ecoportal-api
21
+
22
+ ## Usage
23
+
24
+ TODO
25
+
26
+ ## Development
27
+
28
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
29
+
30
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
31
+
32
+ ## Contributing
33
+
34
+ Bug reports and pull requests are welcome on GitLab at https://gitlab.com/ecoPortal/ecoportal-api.