nohead 0.10.0 → 0.12.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 614f02b14cf5307614caf01ae06d458d770bff423c34d567d0fe8f7924467298
4
- data.tar.gz: 052d1089ecc31f984b4d1e143638b4b26b8d393c1a8eac9764a5e6df8a76d364
3
+ metadata.gz: bdb1a4b807ee43aac99e6a35ca1e0c2ed5249db52a4e807a2e506ecad9b9ee3d
4
+ data.tar.gz: 2abdaef51723edf780182052827928a56854609d76b667780036b5fc99bb94ab
5
5
  SHA512:
6
- metadata.gz: 432a87faa068fb1719a38ba559520de892c0cf48abc0783b1ba1c0114d6fbe252b5cffd72c0d89d40de323c563e7c528334796ff7da0695ff2b48b2636fa46da
7
- data.tar.gz: 1383b012a30ec74972234dcda1c61f62f75e948929c9f8c6d14e52fcd7245595521c2e00426b0e0030a4b3887dc77231c2808ec5ef0390aa8818b8f655216c2e
6
+ metadata.gz: 147f6f04ec84877b2e4a452a5694eb3a31ef58084cf01e087163e9b079cda3a88c88ea4b7a02b5e5830ec4618ac1e65a038eac81dcb6e8bee2e7554a3e5ef3d4
7
+ data.tar.gz: ca28d24053d19c3277b4ba0af97c5ed9e87d0f5446110d6a74f3aa78b3b3e4f9d5848ab26945e33b6ad9e4255d0cafa4438d0df47588b860b60d1cb345517dc5
data/CHANGELOG.md CHANGED
@@ -5,6 +5,22 @@ 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.12.0
9
+
10
+ - `webhooks.create` and `webhooks.update` take `published_only:`, and every
11
+ webhook has `"published_only"`: a published-only webhook sends only the events that change
12
+ what a published-only API key reads (a record published, unpublished or
13
+ edited while live, schema changes, changes to assets that published records
14
+ use), and skips drafts, schedules and edits to unpublished records.
15
+ - Audit events have `note`: the change note (`Nohead-Change-Note`) a record
16
+ or schema change was made with, or `null`.
17
+
18
+ ## 0.11.0
19
+
20
+ - `records.diff` takes `rich_text:`, and the client's `rich_text:` now applies
21
+ to it: a rich text field's `before` and `after` read as HTML or Markdown
22
+ instead of documents. A revert preview's `changes` follow `rich_text:` too.
23
+
8
24
  ## 0.10.0
9
25
 
10
26
  - Rich text fields read as HTML or Markdown with `rich_text:` (`"document"`,
data/README.md CHANGED
@@ -12,6 +12,8 @@ nohead.records.list("posts", filter: { published_at: { exists: true } }).each do
12
12
  end
13
13
  ```
14
14
 
15
+ The key is a project API key: create one under **API keys** in the [web app](https://app.nohead.io), with the **Read records** scope for this example, and set it as `NOHEAD_API_KEY` in your app's environment (or pass it as `api_key:`, under [Configuration](#configuration)). The SDK doesn't read the key that `nohead login` saves for the CLI: give your app a key of its own.
16
+
15
17
  > **Status:** 0.x until the Nohead API launches.
16
18
 
17
19
  ## Contents
@@ -128,7 +130,7 @@ nohead.records.get(id, rich_text: "markdown").data["body"] # a Markdown string
128
130
  ```
129
131
 
130
132
  - With `"html"` or `"markdown"`, the field's value is a string instead of the document, in records embedded with `expand:` too. `"document"` is the default.
131
- - The methods that return records or drafts take `rich_text:`; a call's value wins over the client's, and other methods never send it.
133
+ - The methods that return records or drafts take `rich_text:`, and so does `records.diff`, for its changes' `before` and `after` (a revert preview's `changes` follow it too); a call's value wins over the client's, and other methods never send it.
132
134
  - HTML has every text and attribute escaped, ready to put in a page. Images come with their URLs, so they need no `expand:`.
133
135
  - Record history (`records.revisions.list` and `get`) and webhook events keep documents.
134
136
  - A string you write is read as Markdown, so write back Markdown or the document, never the HTML: with `rich_text: "html"` on the client, writes answer with HTML too.
@@ -104,8 +104,8 @@ module Nohead
104
104
  collections_search drafts_create drafts_discard drafts_get
105
105
  drafts_list drafts_merge drafts_schedule drafts_unschedule
106
106
  drafts_update projects_search record_drafts_list record_revisions_revert
107
- records_bulk records_create records_delete records_get
108
- records_list records_publish records_restore records_unpublish
109
- records_update
107
+ records_bulk records_create records_delete records_diff
108
+ records_get records_list records_publish records_restore
109
+ records_unpublish records_update
110
110
  ].to_set.freeze
111
111
  end
@@ -162,9 +162,11 @@ module Nohead
162
162
  rich_text: rich_text)
163
163
  end
164
164
 
165
- # The changes between two revisions: diff(record, from: 1, to: 2).
166
- def diff(record, from:, to:)
167
- @client.request("records_diff", path: { record_id: record }, query: { from: from, to: to })
165
+ # The changes between two revisions: diff(record, from: 1, to: 2). With
166
+ # rich_text:, rich text fields' before and after read as HTML or Markdown.
167
+ def diff(record, from:, to:, rich_text: nil)
168
+ @client.request("records_diff", path: { record_id: record }, query: { from: from, to: to },
169
+ rich_text: rich_text)
168
170
  end
169
171
 
170
172
  # Full-text search in one collection, matching its searchable fields, most
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nohead
4
- VERSION = "0.10.0"
4
+ VERSION = "0.12.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nohead
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nohead