@getlatedev/node 0.2.1332 → 0.2.1334
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 +41 -3
- package/dist/index.d.ts +41 -3
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/generated/sdk.gen.ts +6 -5
- package/src/generated/types.gen.ts +42 -2
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.
|
|
39
|
+
version: "0.2.1334",
|
|
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.
|
|
8
|
+
version: "0.2.1334",
|
|
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
package/src/generated/sdk.gen.ts
CHANGED
|
@@ -11778,9 +11778,10 @@ export const getAdReview = <ThrowOnError extends boolean = false>(options: Optio
|
|
|
11778
11778
|
* can be up to 10 minutes old; an older one is read again. Read reviews when you need
|
|
11779
11779
|
* them instead of sweeping every ad on a loop. When TikTok answers over quota, Zernio returns 429
|
|
11780
11780
|
* and answers 429 for that advertiser and connection without calling TikTok for about 60 seconds, then
|
|
11781
|
-
* 120, 240, 480 and up to 960 while TikTok keeps refusing
|
|
11782
|
-
*
|
|
11783
|
-
*
|
|
11781
|
+
* 120, 240, 480 and up to 960 while TikTok keeps refusing. Each successful call holds the next one for the
|
|
11782
|
+
* advertiser for at least 60 seconds (TikTok often refuses review calls sent in quick succession), and after an overage for one
|
|
11783
|
+
* step less than the last pause (480, 240, 120, then 60 seconds). Each pause and hold has up to 10% of random
|
|
11784
|
+
* jitter, with the time left as `Retry-After`; reviews read in the last 10 minutes are still served.
|
|
11784
11785
|
*/
|
|
11785
11786
|
export const getTikTokSmartPlusAdReview = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetTikTokSmartPlusAdReviewData, ThrowOnError>) => {
|
|
11786
11787
|
return (options?.client ?? client).get<GetTikTokSmartPlusAdReviewResponse, GetTikTokSmartPlusAdReviewError, ThrowOnError>({
|
|
@@ -12306,11 +12307,11 @@ export const getTikTokSmartPlusMaterialReport = <ThrowOnError extends boolean =
|
|
|
12306
12307
|
*
|
|
12307
12308
|
* 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.
|
|
12308
12309
|
*
|
|
12309
|
-
* 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
|
|
12310
|
+
* 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`.
|
|
12310
12311
|
*
|
|
12311
12312
|
* 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.
|
|
12312
12313
|
*
|
|
12313
|
-
* TikTok's review endpoint has a strict quota of its own (TikTok documents neither the quota nor its scope). When
|
|
12314
|
+
* 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.
|
|
12314
12315
|
*
|
|
12315
12316
|
* 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.
|
|
12316
12317
|
*
|
|
@@ -516,6 +516,7 @@ export type Ad = {
|
|
|
516
516
|
* Explicit E.164 WhatsApp number supplied when creating a Meta boost or messaging ad. Absent when omitted by the caller or on older records.
|
|
517
517
|
*/
|
|
518
518
|
whatsappPhoneNumber?: string;
|
|
519
|
+
instagramVideoFallback?: InstagramVideoFallback;
|
|
519
520
|
pinterestImageUrl?: string;
|
|
520
521
|
pinterestTitle?: string;
|
|
521
522
|
pinterestDescription?: string;
|
|
@@ -9308,6 +9309,32 @@ export type InstagramTaggedMedia = {
|
|
|
9308
9309
|
commentsCount: (number) | null;
|
|
9309
9310
|
};
|
|
9310
9311
|
|
|
9312
|
+
/**
|
|
9313
|
+
* Meta only. Present when Meta refused an existing Instagram video as the boosted ad (code 100, subcode 1815279: upload it to Facebook first) and Zernio created the ad another way. `instagram_video_reuploaded`: the video was copied into the ad account and the ad still references the original post. `instagram_video_rehosted_copy`: the video was uploaded as a new Facebook video in a new Page post, so the ad does not show the original post's likes and comments. Send `rehostOnInstagramVideoRejection: false` on the boost to get Meta's error instead.
|
|
9314
|
+
*/
|
|
9315
|
+
export type InstagramVideoFallback = {
|
|
9316
|
+
kind: 'instagram_video_reuploaded' | 'instagram_video_rehosted_copy';
|
|
9317
|
+
/**
|
|
9318
|
+
* True when the ad still references the original Instagram post and keeps its engagement.
|
|
9319
|
+
*/
|
|
9320
|
+
linkedToOriginalPost: boolean;
|
|
9321
|
+
/**
|
|
9322
|
+
* The Facebook-side ad video Zernio made. With instagram_video_reuploaded it is the copy in the ad account video library (possibly one made by an earlier boost of the same media, reused); the creative carries it as video_id unless Meta accepted the plain post reference once the copy existed, in which case the copy is kept for that reference. With instagram_video_rehosted_copy it is the new upload the creative uses (an unused copy made by this request is deleted).
|
|
9323
|
+
*/
|
|
9324
|
+
videoId: string;
|
|
9325
|
+
/**
|
|
9326
|
+
* Meta's original refusal.
|
|
9327
|
+
*/
|
|
9328
|
+
platformError: {
|
|
9329
|
+
code?: number;
|
|
9330
|
+
subcode?: number;
|
|
9331
|
+
message: string;
|
|
9332
|
+
fbtraceId?: string;
|
|
9333
|
+
};
|
|
9334
|
+
};
|
|
9335
|
+
|
|
9336
|
+
export type kind2 = 'instagram_video_reuploaded' | 'instagram_video_rehosted_copy';
|
|
9337
|
+
|
|
9311
9338
|
/**
|
|
9312
9339
|
* A Google Search keyword: a bare string (BROAD match), or an object naming the match type.
|
|
9313
9340
|
*/
|
|
@@ -13167,7 +13194,7 @@ export type platform14 = 'metaads' | 'openaiads' | 'tiktokads' | 'googleads' | '
|
|
|
13167
13194
|
/**
|
|
13168
13195
|
* Platform-native flavor of the tag (Meta: `pixel`).
|
|
13169
13196
|
*/
|
|
13170
|
-
export type
|
|
13197
|
+
export type kind3 = 'pixel' | 'tag' | 'insight_tag';
|
|
13171
13198
|
|
|
13172
13199
|
/**
|
|
13173
13200
|
* One health check the platform runs on a tracking tag.
|
|
@@ -48288,9 +48315,13 @@ export type ListTikTokSmartPlusReviewsResponse = ({
|
|
|
48288
48315
|
*/
|
|
48289
48316
|
pendingSmartPlusAdIds?: Array<(string)>;
|
|
48290
48317
|
/**
|
|
48291
|
-
* Seconds
|
|
48318
|
+
* Seconds until Zernio calls TikTok's review endpoint for this advertiser and connection again (the stored pause with its jitter), set exactly when `refreshState` is `paused` or `refused`, stale items with nothing pending included. Always the same value as the `Retry-After` header, which is sent exactly when this is not null. Client rule: present, wait that long before reading the page again; null with stale or pending ads, a retry is not blocked (read again now or on your `maxAgeSeconds` schedule; with `refreshState: error` check `reviewError` first).
|
|
48292
48319
|
*/
|
|
48293
48320
|
retryAfterSeconds?: (number) | null;
|
|
48321
|
+
/**
|
|
48322
|
+
* 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).
|
|
48323
|
+
*/
|
|
48324
|
+
refreshState?: 'ok' | 'paused' | 'refused' | 'error';
|
|
48294
48325
|
});
|
|
48295
48326
|
|
|
48296
48327
|
export type ListTikTokSmartPlusReviewsError = (ErrorResponse | unknown);
|
|
@@ -51497,6 +51528,10 @@ export type BoostPostData = {
|
|
|
51497
51528
|
* Meta only. Extra primary-text options Meta rotates on the boosted post (asset_feed_spec.bodies with DEGREES_OF_FREEDOM); the post keeps its own text as one of the options. Works for Facebook posts and Instagram media. Under a conversions or traffic goal Meta also wants a website URL on the options, taken from `linkUrl` (send it with a `callToAction`); engagement boosts need none.
|
|
51498
51529
|
*/
|
|
51499
51530
|
bodies?: Array<(string)>;
|
|
51531
|
+
/**
|
|
51532
|
+
* Meta only (a 400 elsewhere). When Meta refuses an existing Instagram video as the ad (subcode 1815279), Zernio first copies the video into the ad account and retries on the original post, then falls back to a new Facebook video in a new Page post that does not show the original post's likes and comments; the response reports which in `instagramVideoFallback`. Messaging boosts never use the unlinked copy. `false` skips every fallback and returns Meta's error.
|
|
51533
|
+
*/
|
|
51534
|
+
rehostOnInstagramVideoRejection?: boolean;
|
|
51500
51535
|
/**
|
|
51501
51536
|
* TikTok only (a 400 elsewhere). TikTok Smart Targeting on the ad group: `audience` is
|
|
51502
51537
|
* TikTok's `smart_audience_enabled`, `interestsBehaviors` its `smart_interest_behavior_enabled`.
|
|
@@ -51560,6 +51595,11 @@ export type BoostPostData = {
|
|
|
51560
51595
|
export type BoostPostResponse = ({
|
|
51561
51596
|
ad?: Ad;
|
|
51562
51597
|
message?: string;
|
|
51598
|
+
instagramVideoFallback?: InstagramVideoFallback;
|
|
51599
|
+
/**
|
|
51600
|
+
* Present with instagramVideoFallback: one human-readable line saying how the Instagram video was boosted.
|
|
51601
|
+
*/
|
|
51602
|
+
warnings?: Array<(string)>;
|
|
51563
51603
|
});
|
|
51564
51604
|
|
|
51565
51605
|
export type BoostPostError = (unknown | ErrorResponse);
|