@nohead/sdk 0.11.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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,16 @@ Changes to `@nohead/sdk` 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 it: 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
+
8
18
  ## 0.11.0
9
19
 
10
20
  - `records.diff` takes `richText`, and the client's `richText` now applies to
package/README.md CHANGED
@@ -14,6 +14,8 @@ for await (const post of nohead.records.list("posts", {
14
14
  }
15
15
  ```
16
16
 
17
+ 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 `apiKey`, 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.
18
+
17
19
  > **Status:** 0.x until the Nohead API launches.
18
20
 
19
21
  ## Contents
@@ -1231,6 +1231,10 @@ export type WebhookProperties = {
1231
1231
  * The subscribed event types and wildcards (`record.*`, or `*` for all).
1232
1232
  */
1233
1233
  event_types: Array<WebhookSubscription>;
1234
+ /**
1235
+ * Send only events that change what a published-only API key can read: a record's change while it is published (or that publishes, unpublishes, deletes or restores it), schema changes, and changes to assets that published records use. Drafts, schedules, history redactions, uploads and purges are never sent. `webhook.test` always is.
1236
+ */
1237
+ published_only: boolean;
1234
1238
  enabled: boolean;
1235
1239
  /**
1236
1240
  * When the webhook was deleted; null unless it is.
@@ -1336,10 +1340,19 @@ export type AuditEvent = {
1336
1340
  * The client the change came through, when known.
1337
1341
  */
1338
1342
  via: null | Via;
1343
+ /**
1344
+ * The change note (`Nohead-Change-Note`) the change was made with,
1345
+ * read from the revision or schema change the event references, so
1346
+ * record and schema events have one when their change did; null
1347
+ * otherwise, and once a revision's history is pruned.
1348
+ *
1349
+ */
1350
+ note: string | null;
1339
1351
  /**
1340
1352
  * Small, action-specific references, e.g. `revision_id` and
1341
1353
  * `collection_id` for record events, `schema_change_id` for schema
1342
- * events, `changed` attribute names for updates. Never content.
1354
+ * events, `changed` attribute names for updates (field keys for a
1355
+ * draft's). Never content.
1343
1356
  *
1344
1357
  */
1345
1358
  metadata: {
@@ -1363,12 +1376,20 @@ export type WebhookCreate = {
1363
1376
  url: string;
1364
1377
  description?: string | null;
1365
1378
  event_types: Array<WebhookSubscription>;
1379
+ /**
1380
+ * Send only events that change what a published-only API key can read (`false` by default). It can't be combined with event types it never sends, such as `draft.*`.
1381
+ */
1382
+ published_only?: boolean;
1366
1383
  enabled?: boolean;
1367
1384
  };
1368
1385
  export type WebhookUpdate = {
1369
1386
  url?: string;
1370
1387
  description?: string | null;
1371
1388
  event_types?: Array<WebhookSubscription>;
1389
+ /**
1390
+ * Send only events that change what a published-only API key can read (`false` by default). It can't be combined with event types it never sends, such as `draft.*`.
1391
+ */
1392
+ published_only?: boolean;
1372
1393
  enabled?: boolean;
1373
1394
  };
1374
1395
  export type WebhookDeliveryProperties = {
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "0.11.0";
1
+ export declare const VERSION = "0.12.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "0.11.0";
1
+ export const VERSION = "0.12.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nohead/sdk",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "description": "Official TypeScript SDK for the Nohead API",
5
5
  "license": "MIT",
6
6
  "homepage": "https://nohead.io",