@zernio/node 0.2.727 → 0.2.728

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/dist/index.js CHANGED
@@ -36,7 +36,7 @@ module.exports = __toCommonJS(index_exports);
36
36
  // package.json
37
37
  var package_default = {
38
38
  name: "@zernio/node",
39
- version: "0.2.727",
39
+ version: "0.2.728",
40
40
  description: "The official Node.js library for the Zernio API",
41
41
  main: "dist/index.js",
42
42
  module: "dist/index.mjs",
package/dist/index.mjs CHANGED
@@ -5,7 +5,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
5
5
  // package.json
6
6
  var package_default = {
7
7
  name: "@zernio/node",
8
- version: "0.2.727",
8
+ version: "0.2.728",
9
9
  description: "The official Node.js library for the Zernio API",
10
10
  main: "dist/index.js",
11
11
  module: "dist/index.mjs",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zernio/node",
3
- "version": "0.2.727",
3
+ "version": "0.2.728",
4
4
  "description": "The official Node.js library for the Zernio API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -97,13 +97,17 @@ export const getAnalytics = <ThrowOnError extends boolean = false>(options?: Opt
97
97
  * 1,600 connected accounts: about 1,599 per-account analytics calls an hour became
98
98
  * about 205 delta calls an hour, a 7.8x reduction.
99
99
  *
100
- * **Bootstrap once, then stay in sync.** Load your baseline from
101
- * `GET /v1/analytics`, which is the historical endpoint. This one is a rolling
102
- * 7-day change log and cannot replay history. Then call this endpoint with NO
103
- * `cursor`: it answers with an empty `data` array plus the feed's current position
104
- * in `nextCursor`. Send that `nextCursor` back on the next call and you receive
105
- * everything written since. `nextCursor` is present on every response, empty pages
106
- * included, so you always have something to advance with.
100
+ * **Bootstrap once, then stay in sync.** Take the cursor FIRST: call this endpoint
101
+ * with NO `cursor` and it answers with an empty `data` array plus the feed's current
102
+ * position in `nextCursor`. Then load your baseline from `GET /v1/analytics`, the
103
+ * historical endpoint, because this one is a rolling 7-day change log and cannot
104
+ * replay history. Then resume from the cursor you took before the baseline. Taking
105
+ * the cursor afterwards instead drops every change that lands while the baseline is
106
+ * loading: it is in neither the row you already read nor the feed you resume behind
107
+ * it. The overlap this order creates is safe, because metrics are absolute values
108
+ * rather than increments, so draining it leaves every post on its newest value.
109
+ * `nextCursor` is present on every response, empty pages included, so you always
110
+ * have something to advance with.
107
111
  *
108
112
  * **Ordering.** Entries come back oldest first, in the order the feed received
109
113
  * them. That order is NOT `syncedAt`: `syncedAt` is stamped when an account's sync
@@ -133,9 +137,9 @@ export const getAnalytics = <ThrowOnError extends boolean = false>(options?: Opt
133
137
  *
134
138
  * **Retention is 7 days.** Changes older than that leave the feed. A cursor older
135
139
  * than 6 days is rejected with a `400` (a day of margin, because expiry is lazy).
136
- * Recover by re-bootstrapping from `GET /v1/analytics` and taking a fresh cursor
137
- * from a call to this endpoint with no `cursor`. A consumer that polls at least
138
- * daily never reaches this.
140
+ * Recover the same way you bootstrapped: take a fresh cursor from a call to this
141
+ * endpoint with no `cursor`, then re-load from `GET /v1/analytics`, then resume
142
+ * from that cursor. A consumer that polls at least daily never reaches this.
139
143
  *
140
144
  * Pairs with the `analytics.synced` webhook, so changes can be read on notification
141
145
  * instead of on a timer. That event carries no cursor of its own: keep using the