@getlatedev/node 0.2.1341 → 0.2.1343

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.d.mts CHANGED
@@ -8491,6 +8491,16 @@ type ErrorResponse = {
8491
8491
  * unrelated code (e.g. 1487194 on the creative), so branch on `code`, not on
8492
8492
  * `platformError`.
8493
8493
  *
8494
+ * When Meta refuses a write because the Facebook user behind the connection's token
8495
+ * lacks the Advertise permission on the ad account (Meta subcode 2490585, 2490591 or 4841020 on
8496
+ * the write, or a code 200 refusal such as 1487194 whose cleanup deletes Meta refused
8497
+ * with 2490591 or 4841020), any Meta ads write answers 403 `insufficient_permissions`.
8498
+ * Meta may still accept the campaign and ad set and refuse only the ad. The message
8499
+ * names the ad account, asks for the Advertise or Manage permission on it (or a token
8500
+ * granted `ads_management`, by reconnecting), lists the objects left behind and ends
8501
+ * with Meta's `error_user_title`, `error_user_msg` and subcode; the raw error stays in
8502
+ * `platformError`.
8503
+ *
8494
8504
  */
8495
8505
  details?: {
8496
8506
  /**
@@ -47954,7 +47964,7 @@ type ListTikTokSmartPlusReviewsResponse = ({
47954
47964
  */
47955
47965
  retryAfterSeconds?: (number) | null;
47956
47966
  /**
47957
- * Whether this request could refresh the due (stale or pending) Smart+ ads of the page. `refused`: TikTok refused a review call of this request over quota (40002 `OVER_QPS_LIMIT` or 40100) and Zernio paused. `paused`: no call was sent for the due ads because a pause from an earlier refusal, or the spacing of at least 60 seconds after a success, is still running. Both carry `retryAfterSeconds`. `error`: TikTok refused the batch for another reason (both halves the same way), the page is served from stored reviews and `reviewError` holds TikTok's error; `retryAfterSeconds` is null because retrying soon repeats the refusal. `ok`: nothing blocks a retry (every due ad was read, none was due, or the split cap left some for the next read, which can come right away).
47967
+ * Whether this request could refresh the due (stale or pending) Smart+ ads of the page. `refused`: TikTok refused a review call of this request over quota (40002 `OVER_QPS_LIMIT` or 40100) and Zernio paused. `paused`: no call was sent for the due ads because a pause from an earlier refusal is still running, or another request is refreshing the same advertiser (then `retryAfterSeconds` is 20). Both carry `retryAfterSeconds`. `error`: TikTok refused the batch for another reason (both halves the same way), the page is served from stored reviews and `reviewError` holds TikTok's error; `retryAfterSeconds` is null because retrying soon repeats the refusal. `ok`: nothing blocks a retry (every due ad was read, none was due, or the split cap or the 20-second request budget left some for the next read, which can come right away).
47958
47968
  */
47959
47969
  refreshState?: 'ok' | 'paused' | 'refused' | 'error';
47960
47970
  });
package/dist/index.d.ts CHANGED
@@ -8491,6 +8491,16 @@ type ErrorResponse = {
8491
8491
  * unrelated code (e.g. 1487194 on the creative), so branch on `code`, not on
8492
8492
  * `platformError`.
8493
8493
  *
8494
+ * When Meta refuses a write because the Facebook user behind the connection's token
8495
+ * lacks the Advertise permission on the ad account (Meta subcode 2490585, 2490591 or 4841020 on
8496
+ * the write, or a code 200 refusal such as 1487194 whose cleanup deletes Meta refused
8497
+ * with 2490591 or 4841020), any Meta ads write answers 403 `insufficient_permissions`.
8498
+ * Meta may still accept the campaign and ad set and refuse only the ad. The message
8499
+ * names the ad account, asks for the Advertise or Manage permission on it (or a token
8500
+ * granted `ads_management`, by reconnecting), lists the objects left behind and ends
8501
+ * with Meta's `error_user_title`, `error_user_msg` and subcode; the raw error stays in
8502
+ * `platformError`.
8503
+ *
8494
8504
  */
8495
8505
  details?: {
8496
8506
  /**
@@ -47954,7 +47964,7 @@ type ListTikTokSmartPlusReviewsResponse = ({
47954
47964
  */
47955
47965
  retryAfterSeconds?: (number) | null;
47956
47966
  /**
47957
- * Whether this request could refresh the due (stale or pending) Smart+ ads of the page. `refused`: TikTok refused a review call of this request over quota (40002 `OVER_QPS_LIMIT` or 40100) and Zernio paused. `paused`: no call was sent for the due ads because a pause from an earlier refusal, or the spacing of at least 60 seconds after a success, is still running. Both carry `retryAfterSeconds`. `error`: TikTok refused the batch for another reason (both halves the same way), the page is served from stored reviews and `reviewError` holds TikTok's error; `retryAfterSeconds` is null because retrying soon repeats the refusal. `ok`: nothing blocks a retry (every due ad was read, none was due, or the split cap left some for the next read, which can come right away).
47967
+ * Whether this request could refresh the due (stale or pending) Smart+ ads of the page. `refused`: TikTok refused a review call of this request over quota (40002 `OVER_QPS_LIMIT` or 40100) and Zernio paused. `paused`: no call was sent for the due ads because a pause from an earlier refusal is still running, or another request is refreshing the same advertiser (then `retryAfterSeconds` is 20). Both carry `retryAfterSeconds`. `error`: TikTok refused the batch for another reason (both halves the same way), the page is served from stored reviews and `reviewError` holds TikTok's error; `retryAfterSeconds` is null because retrying soon repeats the refusal. `ok`: nothing blocks a retry (every due ad was read, none was due, or the split cap or the 20-second request budget left some for the next read, which can come right away).
47958
47968
  */
47959
47969
  refreshState?: 'ok' | 'paused' | 'refused' | 'error';
47960
47970
  });
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: "@getlatedev/node",
39
- version: "0.2.1341",
39
+ version: "0.2.1343",
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: "@getlatedev/node",
8
- version: "0.2.1341",
8
+ version: "0.2.1343",
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": "@getlatedev/node",
3
- "version": "0.2.1341",
3
+ "version": "0.2.1343",
4
4
  "description": "The official Node.js library for the Zernio API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -11886,9 +11886,7 @@ export const getAdReview = <ThrowOnError extends boolean = false>(options: Optio
11886
11886
  * can be up to 10 minutes old; an older one is read again. Read reviews when you need
11887
11887
  * them instead of sweeping every ad on a loop. When TikTok answers over quota, Zernio returns 429
11888
11888
  * and answers 429 for that advertiser and connection without calling TikTok for about 60 seconds, then
11889
- * 120, 240, 480 and up to 960 while TikTok keeps refusing. Each successful call holds the next one for the
11890
- * advertiser for at least 60 seconds (TikTok often refuses review calls sent in quick succession), and after an overage for one
11891
- * step less than the last pause (480, 240, 120, then 60 seconds). Each pause and hold has up to 10% of random
11889
+ * 120 and up to 240 while TikTok keeps refusing, and about 60 again after a successful call. Each pause has up to 10% of random
11892
11890
  * jitter, with the time left as `Retry-After`; reviews read in the last 10 minutes are still served.
11893
11891
  */
11894
11892
  export const getTikTokSmartPlusAdReview = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetTikTokSmartPlusAdReviewData, ThrowOnError>) => {
@@ -12413,15 +12411,15 @@ export const getTikTokSmartPlusMaterialReport = <ThrowOnError extends boolean =
12413
12411
  * Review status of every TikTok Smart+ ad of an advertiser
12414
12412
  * Returns the review verdict of every Upgraded Smart+ ad of one TikTok advertiser, with each creative's verdict, in one paginated read. Use it to refresh reviews periodically: one call (plus its pages) per advertiser per refresh, instead of `GET /v1/ads/{adId}/tiktok-smart-plus-review` per ad.
12415
12413
  *
12416
- * Zernio lists the advertiser's Smart+ ads with `/smart_plus/ad/get/` (deleted ones only with `includeDeleted=true`) and reads `/smart_plus/ad/review_info/` for Smart+ ads holding up to 50 creatives in total per call (TikTok refuses more; a Smart+ ad with more than 50 creatives is read alone), across ad groups, one call after another. A full refresh of N Smart+ ads with C creatives in total costs about `ceil(N / 100)` listing calls and `ceil(C / 50)` review calls on TikTok. When TikTok still refuses a call for its creative count, Zernio lowers the creative cap for that advertiser and reads the same ads again in smaller calls, never resending the refused size.
12414
+ * Zernio lists the advertiser's Smart+ ads with `/smart_plus/ad/get/` (deleted ones only with `includeDeleted=true`) and reads `/smart_plus/ad/review_info/` for Smart+ ads holding up to 50 creatives in total per call (TikTok refuses more; a Smart+ ad with more than 50 creatives is read alone), across ad groups, one call after another while TikTok accepts them, for up to 20 seconds per request (the ads not reached are read by the next request, which can come right away). One request per advertiser and connection refreshes at a time: a parallel request sends no review call and answers what is stored with `refreshState: paused` and `retryAfterSeconds: 20`. A full refresh of N Smart+ ads with C creatives in total costs about `ceil(N / 100)` listing calls and `ceil(C / 50)` review calls on TikTok. When TikTok still refuses a call for its creative count, Zernio lowers the creative cap for that advertiser and reads the same ads again in smaller calls, never resending the refused size.
12417
12415
  *
12418
- * Stale while refreshing: every review is stored for 24 hours per connection, advertiser and Smart+ ad (shared with the single-ad read), and `readAt` is always the time TikTok answered, never rewritten when served from the store. `maxAgeSeconds` (default 3600) is the freshness window: a review read within it is fresh and costs no TikTok call; an older one is still returned in `items` but is read again, and so is a Smart+ ad never read. Each request first reads every Smart+ ad of the page never read (live, then deleted with `includeDeleted=true`) and only then refreshes stale ones, oldest `readAt` first, so a quota pause cannot leave never-read ads behind stale ones, progress carries over between requests and an ad already read never goes back to pending. A stored review is replaced only by a successful read. `counts` splits the Smart+ ads on this page into `fresh`, `stale`, `pending` and `failed`, and `oldestReadAt` is the oldest `readAt` of `items`. `incomplete` is true only while some Smart+ ad of the page has never been read (`pending > 0`). Staleness is reported apart: `allFresh` is true when every item and refusal of the page is within `maxAgeSeconds` and nothing is pending. A page with stale items and nothing pending is complete (`incomplete: false`): move on, and a later read refreshes it oldest first. When Zernio could not refresh some due ads of the page because review reads are held or TikTok refused them over quota, `refreshState` is `paused` or `refused` and `retryAfterSeconds` (also in the `Retry-After` header) says when that later read can reach TikTok, even with nothing pending. On 2026-10-25 TikTok's quota allowed about 130 to 230 Smart+ ads per advertiser per hour (about 11.5 ads and 4 creatives per successful call), so a larger advertiser cannot be fully refreshed within one hour and its pages stay complete but not `allFresh`.
12416
+ * Stale while refreshing: every review is stored for 24 hours per connection, advertiser and Smart+ ad (shared with the single-ad read), and `readAt` is always the time TikTok answered, never rewritten when served from the store. `maxAgeSeconds` (default 3600) is the freshness window: a review read within it is fresh and costs no TikTok call; an older one is still returned in `items` but is read again, and so is a Smart+ ad never read. Each request alternates one batch of Smart+ ads never read (live, then deleted with `includeDeleted=true`) with one batch of stale ones, oldest `readAt` first, so a quota pause starves neither, progress carries over between requests and an ad already read never goes back to pending. A stored review is replaced only by a successful read. `counts` splits the Smart+ ads on this page into `fresh`, `stale`, `pending` and `failed`, and `oldestReadAt` is the oldest `readAt` of `items`. `incomplete` is true only while some Smart+ ad of the page has never been read (`pending > 0`). Staleness is reported apart: `allFresh` is true when every item and refusal of the page is within `maxAgeSeconds` and nothing is pending. A page with stale items and nothing pending is complete (`incomplete: false`): move on, and a later read refreshes it oldest first. When Zernio could not refresh some due ads of the page because review reads are held or TikTok refused them over quota, `refreshState` is `paused` or `refused` and `retryAfterSeconds` (also in the `Retry-After` header) says when that later read can reach TikTok, even with nothing pending. On 2026-10-25 TikTok's quota allowed about 130 to 230 Smart+ ads per advertiser per hour (about 11.5 ads and 4 creatives per successful call), so a larger advertiser cannot be fully refreshed within one hour and its pages stay complete but not `allFresh`.
12419
12417
  *
12420
12418
  * The listing is stored with the time it was read (`listing.readAt`) and listed again when it is older than `maxAgeSeconds`, so it can be up to `maxAgeSeconds` old: a Smart+ ad created on TikTok appears after at most that long (one hour by default). If that relisting fails, Zernio serves the stored listing with `listing.source: fallback` and the relist error in `listing.error`, instead of failing the request; `listing.source: fresh` means the listing was read within `maxAgeSeconds`. Only when no listing was ever stored does the listing error fail the request.
12421
12419
  *
12422
- * TikTok's review endpoint has a strict quota of its own (TikTok documents neither the quota nor its scope). TikTok often refuses review calls sent in quick succession, so Zernio holds the next call for this advertiser and connection for at least 60 seconds after every success, and one page reads one batch (up to 50 creatives) per minute at most. When TikTok is over quota (or Zernio is holding review reads: 60 seconds after a success, after an overage about 60 seconds, then 120, 240, 480 and up to 960 while TikTok keeps refusing, and after each successful call one step less, 480 down to 60 seconds, each with up to 10% of random jitter), Zernio stops calling TikTok and answers 200 with the reviews it has: stale reviews in `items`, the Smart+ ads never read in `pendingSmartPlusAdIds`, `incomplete: true` when any are pending, and `refreshState` (`paused` or `refused`) with `retryAfterSeconds` (also in the `Retry-After` header) whenever due ads were left unread. Every Smart+ ad of the page is in `items`, `failedSmartPlusAds` or `pendingSmartPlusAdIds`. Wait `retryAfterSeconds` and read the same page again: only the stale and pending ads reach TikTok.
12420
+ * TikTok's review endpoint has a strict quota of its own (TikTok documents neither the quota nor its scope). One request keeps reading batches (up to 50 creatives each) while TikTok accepts them. When TikTok is over quota (or Zernio is holding review reads after an overage: about 60 seconds, then 120 and up to 240 while TikTok keeps refusing, and about 60 again after a successful call, each with up to 10% of random jitter), Zernio stops calling TikTok and answers 200 with the reviews it has: stale reviews in `items`, the Smart+ ads never read in `pendingSmartPlusAdIds`, `incomplete: true` when any are pending, and `refreshState` (`paused` or `refused`) with `retryAfterSeconds` (also in the `Retry-After` header) whenever due ads were left unread. Every Smart+ ad of the page is in `items`, `failedSmartPlusAds` or `pendingSmartPlusAdIds`. Wait `retryAfterSeconds` and read the same page again: only the stale and pending ads reach TikTok.
12423
12421
  *
12424
- * A Smart+ ad whose review TikTok refuses on its own (for example one deleted on TikTok since the listing was read) is returned in `failedSmartPlusAds` with TikTok's error and `refusedAt`, and the rest of the page is still read. Zernio finds it by splitting the refused batch in halves, at most 16 extra TikTok calls per page; ads still unresolved after that keep their stored review, or stay in `pendingSmartPlusAdIds` when they have none, and are read first by the next request. A refusal of a single ad is stored for 24 hours and read again once it is older than `maxAgeSeconds`; when an ad has both a stored review and a stored refusal, the more recent one is returned. When both halves of a refused batch are refused with the same TikTok error (for example a permission error), Zernio stops calling TikTok for that page: when every Smart+ ad of the page has a stored review or refusal, it serves them and returns the refusal in `reviewError`; when some ad was never read, the whole request fails with that error.
12422
+ * A Smart+ ad whose review TikTok refuses on its own (for example one deleted on TikTok since the listing was read) is returned in `failedSmartPlusAds` with TikTok's error and `refusedAt`, and the rest of the page is still read. Zernio finds it by splitting the refused batch in halves, at most 16 extra TikTok calls per page; ads still unresolved after that keep their stored review, or stay in `pendingSmartPlusAdIds` when they have none, and are read again by the next request, in turn with the other due ads. A refusal of a single ad is stored for 24 hours and read again once it is older than `maxAgeSeconds`; when an ad has both a stored review and a stored refusal, the more recent one is returned. When both halves of a refused batch are refused with the same TikTok error (for example a permission error), Zernio stops calling TikTok for that page: when every Smart+ ad of the page has a stored review or refusal, it serves them and returns the refusal in `reviewError`; when some ad was never read, the whole request fails with that error.
12425
12423
  *
12426
12424
  * Items are sorted by `adGroupId`, then `smartPlusAdId`, so pages are stable. Keep one page in flight per advertiser and read its pages one after another: parallel pages of one advertiser spend its review quota at the same time and come back incomplete. Production logs suggest the quota is counted per advertiser (not confirmed by TikTok), so different advertisers have been read in parallel without throttling each other.
12427
12425
  */
@@ -6643,6 +6643,16 @@ export type ErrorResponse = {
6643
6643
  * unrelated code (e.g. 1487194 on the creative), so branch on `code`, not on
6644
6644
  * `platformError`.
6645
6645
  *
6646
+ * When Meta refuses a write because the Facebook user behind the connection's token
6647
+ * lacks the Advertise permission on the ad account (Meta subcode 2490585, 2490591 or 4841020 on
6648
+ * the write, or a code 200 refusal such as 1487194 whose cleanup deletes Meta refused
6649
+ * with 2490591 or 4841020), any Meta ads write answers 403 `insufficient_permissions`.
6650
+ * Meta may still accept the campaign and ad set and refuse only the ad. The message
6651
+ * names the ad account, asks for the Advertise or Manage permission on it (or a token
6652
+ * granted `ads_management`, by reconnecting), lists the objects left behind and ends
6653
+ * with Meta's `error_user_title`, `error_user_msg` and subcode; the raw error stays in
6654
+ * `platformError`.
6655
+ *
6646
6656
  */
6647
6657
  details?: {
6648
6658
  /**
@@ -48695,7 +48705,7 @@ export type ListTikTokSmartPlusReviewsResponse = ({
48695
48705
  */
48696
48706
  retryAfterSeconds?: (number) | null;
48697
48707
  /**
48698
- * Whether this request could refresh the due (stale or pending) Smart+ ads of the page. `refused`: TikTok refused a review call of this request over quota (40002 `OVER_QPS_LIMIT` or 40100) and Zernio paused. `paused`: no call was sent for the due ads because a pause from an earlier refusal, or the spacing of at least 60 seconds after a success, is still running. Both carry `retryAfterSeconds`. `error`: TikTok refused the batch for another reason (both halves the same way), the page is served from stored reviews and `reviewError` holds TikTok's error; `retryAfterSeconds` is null because retrying soon repeats the refusal. `ok`: nothing blocks a retry (every due ad was read, none was due, or the split cap left some for the next read, which can come right away).
48708
+ * Whether this request could refresh the due (stale or pending) Smart+ ads of the page. `refused`: TikTok refused a review call of this request over quota (40002 `OVER_QPS_LIMIT` or 40100) and Zernio paused. `paused`: no call was sent for the due ads because a pause from an earlier refusal is still running, or another request is refreshing the same advertiser (then `retryAfterSeconds` is 20). Both carry `retryAfterSeconds`. `error`: TikTok refused the batch for another reason (both halves the same way), the page is served from stored reviews and `reviewError` holds TikTok's error; `retryAfterSeconds` is null because retrying soon repeats the refusal. `ok`: nothing blocks a retry (every due ad was read, none was due, or the split cap or the 20-second request budget left some for the next read, which can come right away).
48699
48709
  */
48700
48710
  refreshState?: 'ok' | 'paused' | 'refused' | 'error';
48701
48711
  });