nohead 0.3.0 → 0.4.0
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 +14 -0
- data/README.md +2 -2
- data/lib/nohead/client.rb +4 -0
- data/lib/nohead/operations.rb +1 -1
- data/lib/nohead/resources/schema.rb +2 -3
- data/lib/nohead/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 747275a28bad0e0410f52109f1bac03d8d703fedccafe3110f21ae904421d511
|
|
4
|
+
data.tar.gz: 696d827a38b169e1a047b38a40d9263417cff3f111cec74d825a77236072a62c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e82adbab22c4ea949feccc1c347926b5c2a6795f087b02a8915255f4c7a49f56b53e088ae4b8579374c3db27a59c8bf12c428970d28f83124f047f120c08c7bb
|
|
7
|
+
data.tar.gz: 6c0c8b4dfc63a7eb8d89cc76030e7cf9797ba28541bd677b1da117b7975039d5b3742677230057ff29c4826ac7abf47acd1e3cfba3b38bb84809c4fa4cf233da
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,20 @@ Changes to the `nohead` gem that you can notice. Versions follow
|
|
|
5
5
|
releases; a change that could break your code is a major one. Each release's
|
|
6
6
|
section is its GitHub release's notes.
|
|
7
7
|
|
|
8
|
+
## 0.4.0
|
|
9
|
+
|
|
10
|
+
- **Breaking:** a field's `api_key` is its `key` (in fields, their aliases,
|
|
11
|
+
`fields.create(..., key:)` and `fields.update(..., key:)`), as the
|
|
12
|
+
editor's "Field key" says. API keys keep their name.
|
|
13
|
+
- **Breaking:** `collections.schema_changes.get(schema_change)` takes the
|
|
14
|
+
schema change's ID alone (`GET /v1/schema-changes/{id}`).
|
|
15
|
+
- **Breaking:** `fields.update` no longer takes `type` or `multiple`; they
|
|
16
|
+
rewrite record values, so they are `fields.migrate`. The API refuses a
|
|
17
|
+
body key an operation doesn't take with `400` (`unknown_parameter`,
|
|
18
|
+
naming it), so a misspelt keyword no longer passes unnoticed.
|
|
19
|
+
- The contract types each field's `configuration` by field type; the API
|
|
20
|
+
reference lists each type's options.
|
|
21
|
+
|
|
8
22
|
## 0.3.0
|
|
9
23
|
|
|
10
24
|
- **Upgrade required:** 0.1 and 0.2 no longer work with the current API,
|
data/README.md
CHANGED
|
@@ -229,8 +229,8 @@ Search needs `search_enabled` collections and the `search:read` scope. It pages
|
|
|
229
229
|
|
|
230
230
|
```ruby
|
|
231
231
|
nohead.collections.create(name: "Posts", slug: "posts",
|
|
232
|
-
fields: [{ name: "Title",
|
|
233
|
-
nohead.fields.create("posts", name: "Summary",
|
|
232
|
+
fields: [{ name: "Title", key: "title", type: "text", required: true }])
|
|
233
|
+
nohead.fields.create("posts", name: "Summary", key: "summary", type: "long_text")
|
|
234
234
|
|
|
235
235
|
# Changes that rewrite records go through a migration; preview first
|
|
236
236
|
preview = nohead.fields.migrate("fld_...", type: "long_text", dry_run: true)
|
data/lib/nohead/client.rb
CHANGED
|
@@ -148,6 +148,10 @@ module Nohead
|
|
|
148
148
|
|
|
149
149
|
def build_url(template, values)
|
|
150
150
|
values = values.transform_keys(&:to_s)
|
|
151
|
+
# A value the template doesn't take is a method out of step with its operation.
|
|
152
|
+
unknown = values.keys - template.scan(/\{(\w+)\}/).flatten
|
|
153
|
+
raise ArgumentError, "#{unknown.join(', ')} is not a path parameter of #{template}" if unknown.any?
|
|
154
|
+
|
|
151
155
|
values["project_id"] ||= project_id if template.include?("{project_id}")
|
|
152
156
|
path = template.gsub(/\{(\w+)\}/) do
|
|
153
157
|
value = values[Regexp.last_match(1)]
|
data/lib/nohead/operations.rb
CHANGED
|
@@ -68,7 +68,7 @@ module Nohead
|
|
|
68
68
|
"records_unschedule" => ["DELETE", "/v1/records/{record_id}/schedule"],
|
|
69
69
|
"records_update" => ["PATCH", "/v1/records/{record_id}"],
|
|
70
70
|
"scheduled_changes_list" => ["GET", "/v1/collections/{collection_id}/scheduled-changes"],
|
|
71
|
-
"schema_changes_get" => ["GET", "/v1/
|
|
71
|
+
"schema_changes_get" => ["GET", "/v1/schema-changes/{schema_change_id}"],
|
|
72
72
|
"schema_changes_list" => ["GET", "/v1/collections/{collection_id}/schema-changes"],
|
|
73
73
|
"search_index_get" => ["GET", "/v1/collections/{collection_id}/search-index"],
|
|
74
74
|
"search_index_rebuild" => ["POST", "/v1/collections/{collection_id}/search-index/rebuild"],
|
|
@@ -60,9 +60,8 @@ module Nohead
|
|
|
60
60
|
query: { limit: limit, cursor: cursor })
|
|
61
61
|
end
|
|
62
62
|
|
|
63
|
-
def get(
|
|
64
|
-
@client.request("schema_changes_get",
|
|
65
|
-
path: { collection_id: collection, schema_change_id: schema_change })
|
|
63
|
+
def get(schema_change)
|
|
64
|
+
@client.request("schema_changes_get", path: { schema_change_id: schema_change })
|
|
66
65
|
end
|
|
67
66
|
end
|
|
68
67
|
|
data/lib/nohead/version.rb
CHANGED