n8n-nodes-lenz 0.7.0 → 0.8.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/README.md +25 -1
- package/dist/nodes/Lenz/Lenz.node.js +729 -72
- package/dist/nodes/Lenz/Lenz.node.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -52,6 +52,21 @@ Operations are grouped under a **Resource** picker. (Nodes added before v0.1.10
|
|
|
52
52
|
| **List Related** | Public verifications semantically related to a given one — useful for "see also" surfaces. |
|
|
53
53
|
| **Delete** | Permanently deletes one of your stored verifications. |
|
|
54
54
|
|
|
55
|
+
### Review — check a whole draft, or its citations
|
|
56
|
+
|
|
57
|
+
| Operation | What it does |
|
|
58
|
+
|---|---|
|
|
59
|
+
| **Review Draft** | Checks a whole draft (up to 50,000 characters, or one public web page by URL) in one call: finds its claims, quick-checks them (1 credit each, up to **Max Quick Checks**, default 20), deep-checks the doubtful ones (10 credits each, 5 at Low **Depth**, up to **Max Deep Checks**, default 5) and, with **Max Citations** above 0, checks whether each cited source says what the draft attributes to it (1 credit per citation). **Suggest Edits** adds the smallest edits that make the draft say what each correction says, at no extra cost. A review usually takes two to four minutes. |
|
|
60
|
+
| **Get Review** | Fetches a review by `review_id`, for one that outlasted the wait. **Issues Only** leaves out the full claim and citation lists. |
|
|
61
|
+
| **Check Citations** | Checks only the citations: either a **Text** with its links, DOIs or `[n]` markers and a reference list (**Max Citations**, default 20), or up to 20 **Statement-Source Pairs** you list, each with a URL or a DOI. 1 credit per citation checked; a source that could not be read is refunded. |
|
|
62
|
+
| **Get Citation Check** | Fetches a citation check by `citecheck_id`. |
|
|
63
|
+
|
|
64
|
+
Both hand on Lenz's result as it comes, plus `passed`: `true` only when `outcome` is `clean`, `false` for `issues_found`, `incomplete` or `unchecked`, and `null` until there is an outcome. **Branch on `outcome`** for anything finer: `issues[]` (claims Lenz found wrong, each with `verdict`, `key_finding` and `suggested_rewrite`) and `citation_issues[]` (citations whose source does not say what the text says, worst first) are the arrays to loop over, and `credits.charged` is what it cost.
|
|
65
|
+
|
|
66
|
+
**Waiting.** With **Wait for Completion** on, the node polls until the job finishes, for up to **Options → Max Wait (Seconds)**, default **600**. If that runs out you get `status: "timeout"` with the `review_id` or `citecheck_id`; nothing is cancelled or lost, so fetch it later with **Get Review** / **Get Citation Check**. For long drafts, turn Wait for Completion off and use a **Webhook URL** (also under Options) or fetch it later.
|
|
67
|
+
|
|
68
|
+
**Three at a time.** Lenz runs at most **3 reviews, and separately 3 citation checks, at once per account**. A fourth waits: the node holds it for up to five minutes until a slot opens, then submits it. Nothing is charged for the wait. If one item in a run fails for good, the error names the jobs earlier items already started, so a paid review is never lost with the run.
|
|
69
|
+
|
|
55
70
|
### Ask — follow-up questions
|
|
56
71
|
|
|
57
72
|
| Operation | What it does |
|
|
@@ -203,7 +218,7 @@ So the Wait node has a number to read, the error output carries the refusal as f
|
|
|
203
218
|
| `status_code` | The HTTP status, e.g. `429`, `503` |
|
|
204
219
|
| `cost` | Credits the refused call needed, present only on an out-of-credits refusal |
|
|
205
220
|
| `credits_remaining` | Credits the account holds — `0` is a real value and is reported, not dropped |
|
|
206
|
-
| `error_message` / `error_description` | The same wording the node would have thrown, present only for a recognised billing, capacity
|
|
221
|
+
| `error_message` / `error_description` | The same wording the node would have thrown, present only for a recognised billing, capacity, rate-limit or idempotency-conflict refusal (`code: "idempotency_conflict"`: an earlier attempt of the same request is still holding it, for up to 15 minutes, and nothing new was charged; Review Draft and Check Citations retry it for ~30 seconds first) |
|
|
207
222
|
| `resets_in_seconds` | Seconds until a rate limit clears, when that is too long to sit in a Wait node — see [Rate limits](#rate-limits-http-429) |
|
|
208
223
|
| `limit` | The limit the API stated, on a Lenz rate-limit refusal |
|
|
209
224
|
| `upgrade_url` | Where that limit or plan is raised — on a Lenz rate-limit refusal, and on an out-of-credits refusal |
|
|
@@ -273,6 +288,15 @@ Note that the wait is read from the response body, not from the `Retry-After` he
|
|
|
273
288
|
|
|
274
289
|
* **0.7.0** — **Connect with your Lenz account instead of an API key.** A new **Lenz OAuth2 API** credential signs in with Lenz: **Connect my account**, sign in, **Allow**, and nothing to copy or paste. n8n registers itself with Lenz on that first connection, so there is no client ID, secret or redirect URL to set up, and any number of n8n instances and credentials can connect to the same Lenz account side by side — each its own connection, disconnected separately under **Connected apps**. It needs **n8n 2.12.0 or later**, and n8n's OAuth Redirect URL must be a public `https://` address or `http://localhost` — a self-hosted n8n behind an internal address sets `WEBHOOK_URL` to its real address first (see [Credentials](#credentials)); on an older n8n, use an API key. **Nothing changes for a workflow you already have.** The node gains version 1.2, and only a Lenz node added from now on starts on OAuth; a node already in a workflow keeps its API key, because n8n does not save a parameter left at its default and changing the default in place would have switched every existing node off its key. The choice between OAuth and API Key is in the credential window when you create a credential from a Lenz node; that is also how an existing node moves to OAuth. **Account → Get Webhook Secret** is new and is for OAuth connections: Lenz signs that connection's webhook deliveries with the secret it returns, creates it on that first call, and refuses a **Webhook URL** on an OAuth connection until then; a reconnected connection starts with no secret, so run **Get Webhook Secret** again before using a Webhook URL and check signatures with the secret it returns. Completed verifications now carry **`suggested_rewrite`**, a rewrite of the claim that the verification's findings support — not verified itself, so read it before using it — and an empty string when there is none. No parameter or output field was renamed or removed.
|
|
275
290
|
|
|
291
|
+
* **0.8.0** — **Review a whole draft, or just its citations.** A new **Review** resource:
|
|
292
|
+
* **Review Draft** finds a draft's claims, quick-checks them, deep-checks the doubtful ones, optionally checks its citations (in a pasted text; a draft given as a URL checks none) and suggests edits. That is one call instead of an Extract → Assess → Verify chain.
|
|
293
|
+
* **Check Citations** checks whether each cited source says what the text says it does, from a text with its links, DOIs or `[n]` markers, or from statement-source pairs.
|
|
294
|
+
* **Get Review** and **Get Citation Check** fetch either by ID.
|
|
295
|
+
|
|
296
|
+
A review takes two to four minutes, so **Max Wait** for both sits under **Options** and defaults to **600 seconds**. When it runs out the node returns the ID, and nothing is cancelled. Lenz runs at most three reviews, and three citation checks, at once per account. A fourth waits up to five minutes for a slot instead of failing at once; if none opens, that item fails with a message saying so, and nothing is charged for the wait. If an item fails for good, the error lists the jobs that earlier Verify (Deep), Review Draft and Check Citations items already started, so their IDs are not lost with the run.
|
|
297
|
+
|
|
298
|
+
**A workflow you already have keeps working.** No parameter or output field was renamed or removed. Verify behaves exactly as before, now polling through the same loop as the new operations. A version 1.1 or 1.2 node simply gains the Review resource. An OAuth2 credential that was never connected now says to click **Connect my account** instead of showing n8n's signing error; with Continue On Fail, its error output carries `code: "oauth_not_connected"` and the new text.
|
|
299
|
+
|
|
276
300
|
## Maintainer
|
|
277
301
|
|
|
278
302
|
[@David19782](https://github.com/David19782)
|