@getlatedev/node 0.2.1361 → 0.2.1362

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: "@getlatedev/node",
39
- version: "0.2.1361",
39
+ version: "0.2.1362",
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.1361",
8
+ version: "0.2.1362",
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.1361",
3
+ "version": "0.2.1362",
4
4
  "description": "The official Node.js library for the Zernio API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -11875,6 +11875,15 @@ export const getAdsTimeline = <ThrowOnError extends boolean = false>(options: Op
11875
11875
  * `platformStatus`) and its ad set and campaign switches (`platformAdSetStatus`,
11876
11876
  * `platformCampaignStatus`) are read live.
11877
11877
  *
11878
+ * **Meta ads that are not synced yet.** Pass `accountId` with a Meta `platformAdId` to read an ad
11879
+ * Zernio has not synced (for example one created in Ads Manager on an ad account reached only
11880
+ * through a Facebook connection). The ad is read live from Meta and mapped exactly like a synced
11881
+ * row (name, `status`, `platformStatus`, `configuredStatus`, `platformAdSetId`,
11882
+ * `platformCampaignId`, campaign and ad set names, budgets, and `creative` with its `id`, body,
11883
+ * link, image and video), with `synced: false`, no `id` (it has no Zernio row) and `statusReadAt`
11884
+ * set to the time of the read. Synced ads answer `synced: true`. Only a numeric id takes this
11885
+ * path, so dark post ids (`{pageId}_{postId}`) keep the dark post lookup above.
11886
+ *
11878
11887
  */
11879
11888
  export const getAd = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetAdData, ThrowOnError>) => {
11880
11889
  return (options?.client ?? client).get<GetAdResponse, GetAdError, ThrowOnError>({
@@ -12219,6 +12228,9 @@ export const generateAdPreviews = <ThrowOnError extends boolean = false>(options
12219
12228
  * Renders an EXISTING ad per placement via Meta's `/{ad_id}/previews`. Each preview is an HTML
12220
12229
  * `<iframe>` snippet embeddable directly. Unknown `formats` values return Meta's 400 verbatim.
12221
12230
  *
12231
+ * **Meta ads that are not synced yet.** Pass `accountId` with a Meta platform ad id that is not in
12232
+ * Zernio's store to render it live through that connection; the response carries `synced: false`.
12233
+ *
12222
12234
  */
12223
12235
  export const getAdPreviews = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetAdPreviewsData, ThrowOnError>) => {
12224
12236
  return (options?.client ?? client).get<GetAdPreviewsResponse, GetAdPreviewsError, ThrowOnError>({
@@ -12263,6 +12275,10 @@ export const getAdPreviews = <ThrowOnError extends boolean = false>(options: Opt
12263
12275
  * `platformStatus`: TikTok reports `AD_STATUS_AUDIT` while the ad is in review and
12264
12276
  * `AD_STATUS_AD_PRE_ONLINE` once it passed and is about to deliver (both map to
12265
12277
  * `status: pending_review`); `AD_STATUS_AUDIT_DENY` maps to `rejected`.
12278
+ *
12279
+ * **Meta ads that are not synced yet.** Pass `accountId` with a Meta platform ad id that is not in
12280
+ * Zernio's store to read its review live through that connection. The response then has
12281
+ * `adId: null`, `synced: false`, and nothing is stored. Synced ads answer `synced: true`.
12266
12282
  */
12267
12283
  export const getAdReview = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetAdReviewData, ThrowOnError>) => {
12268
12284
  return (options?.client ?? client).get<GetAdReviewResponse, GetAdReviewError, ThrowOnError>({
@@ -12323,6 +12339,9 @@ export const getTikTokSmartPlusAdReview = <ThrowOnError extends boolean = false>
12323
12339
  * URLs carry an `oe=<hex>` expiration (image_url ~24 h, video source ~12 d). Treat
12324
12340
  * URLs as short-lived: re-fetch this endpoint before serving or downloading assets
12325
12341
  * instead of caching URLs beyond that window.
12342
+ *
12343
+ * **Meta ads that are not synced yet.** Pass `accountId` with a Meta platform ad id that is not in
12344
+ * Zernio's store to read its media live through that connection; the response carries `synced: false`.
12326
12345
  */
12327
12346
  export const getAdMedia = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetAdMediaData, ThrowOnError>) => {
12328
12347
  return (options?.client ?? client).get<GetAdMediaResponse, GetAdMediaError, ThrowOnError>({
@@ -143,6 +143,10 @@ export type Ad = {
143
143
  * True for ads synced from platform ad managers
144
144
  */
145
145
  isExternal?: boolean;
146
+ /**
147
+ * Only on GET /v1/ads/{adId}. True when the ad comes from Zernio's synced store; false when it was read live from Meta because it is not synced yet (request made with `accountId`). An unsynced ad has no `id`.
148
+ */
149
+ synced?: boolean;
146
150
  budget?: {
147
151
  amount?: number;
148
152
  type?: 'daily' | 'lifetime';
@@ -11329,6 +11333,11 @@ export type ParameterLiveStatusRead = boolean;
11329
11333
  */
11330
11334
  export type ParameterPageParam = number;
11331
11335
 
11336
+ /**
11337
+ * Meta only. A Zernio connection id (Meta Ads or Facebook connection) used when `{adId}` is a Meta ad id that is not in Zernio's synced store, for example an ad created in Ads Manager on an ad account reached only through a Facebook connection. The ad is then read live from Meta through that connection and the response carries `synced: false`. The same rules as GET /v1/ads/campaigns/{campaignId} apply: a connection on a profile the API key cannot access answers 404, and an ad on an ad account outside the connection's selected ad accounts answers 403 `ad_account_not_selected`. An id Meta cannot read through the connection, or that is not an ad (a campaign or ad set id, for example), answers 404 `ad_not_found`, and a connection that is not Meta answers 501. Ads Meta reports as DELETED are returned too, with their status. Ignored when the ad is in the store (the stored ad's own connection is used). Without it an unsynced ad answers 404 `ad_not_found`. Writes (PUT, DELETE, status) still need the ad in the store.
11338
+ */
11339
+ export type ParameterUnsyncedMetaAdAccountId = string;
11340
+
11332
11341
  export type PhoneNumberStockWatch = {
11333
11342
  id: string;
11334
11343
  /**
@@ -48182,6 +48191,10 @@ export type GetAdData = {
48182
48191
  adId: string;
48183
48192
  };
48184
48193
  query?: {
48194
+ /**
48195
+ * Meta only. A Zernio connection id (Meta Ads or Facebook connection) used when `{adId}` is a Meta ad id that is not in Zernio's synced store, for example an ad created in Ads Manager on an ad account reached only through a Facebook connection. The ad is then read live from Meta through that connection and the response carries `synced: false`. The same rules as GET /v1/ads/campaigns/{campaignId} apply: a connection on a profile the API key cannot access answers 404, and an ad on an ad account outside the connection's selected ad accounts answers 403 `ad_account_not_selected`. An id Meta cannot read through the connection, or that is not an ad (a campaign or ad set id, for example), answers 404 `ad_not_found`, and a connection that is not Meta answers 501. Ads Meta reports as DELETED are returned too, with their status. Ignored when the ad is in the store (the stored ad's own connection is used). Without it an unsynced ad answers 404 `ad_not_found`. Writes (PUT, DELETE, status) still need the ad in the store.
48196
+ */
48197
+ accountId?: string;
48185
48198
  /**
48186
48199
  * Read the on/off switches live from the platform instead of returning the synced values. The fresh values are stored (so later reads return them too) and the response carries `statusReadAt`, the time of the read. At most 20 platform objects are read per request. Where a read fails (credentials, platform error, no reader on that platform), the stored values come back with `statusReadAt: null`. See "Status freshness" in the operation description. On X the budget is read live in the same read: on GET /v1/ads/{adId} `budget`, `adSetBudget`, `campaignBudget` and `budgetLevel` are the line item and campaign budgets X holds now (stored like the switches); on the ad set and campaign listings `budget` is the one that line item or campaign holds now (returned, not stored); a row whose budget the other level holds keeps its synced `budget`.
48187
48200
  */
@@ -48200,7 +48213,7 @@ export type GetAdResponse = ({
48200
48213
  */
48201
48214
  stale?: boolean;
48202
48215
  /**
48203
- * Only with `live=true`. When the switches were read from the platform; null when the live read failed and the stored values were returned.
48216
+ * With `live=true`, when the switches were read from the platform; null when the live read failed and the stored values were returned. Always set on an unsynced Meta ad read with `accountId`, the time of that read.
48204
48217
  */
48205
48218
  statusReadAt?: (string) | null;
48206
48219
  /**
@@ -48240,7 +48253,7 @@ export type GetAdResponse = ({
48240
48253
 
48241
48254
  export type GetAdError = (ErrorResponse | {
48242
48255
  error?: string;
48243
- });
48256
+ } | unknown);
48244
48257
 
48245
48258
  export type UpdateAdData = {
48246
48259
  body: {
@@ -48953,11 +48966,15 @@ export type GenerateAdPreviewsError = (unknown | ErrorResponse);
48953
48966
  export type GetAdPreviewsData = {
48954
48967
  path: {
48955
48968
  /**
48956
- * Zernio ad id (24-char hex).
48969
+ * Zernio ad id (24-char hex) or Meta platform ad id.
48957
48970
  */
48958
48971
  adId: string;
48959
48972
  };
48960
48973
  query?: {
48974
+ /**
48975
+ * Meta only. A Zernio connection id (Meta Ads or Facebook connection) used when `{adId}` is a Meta ad id that is not in Zernio's synced store, for example an ad created in Ads Manager on an ad account reached only through a Facebook connection. The ad is then read live from Meta through that connection and the response carries `synced: false`. The same rules as GET /v1/ads/campaigns/{campaignId} apply: a connection on a profile the API key cannot access answers 404, and an ad on an ad account outside the connection's selected ad accounts answers 403 `ad_account_not_selected`. An id Meta cannot read through the connection, or that is not an ad (a campaign or ad set id, for example), answers 404 `ad_not_found`, and a connection that is not Meta answers 501. Ads Meta reports as DELETED are returned too, with their status. Ignored when the ad is in the store (the stored ad's own connection is used). Without it an unsynced ad answers 404 `ad_not_found`. Writes (PUT, DELETE, status) still need the ad in the store.
48976
+ */
48977
+ accountId?: string;
48961
48978
  /**
48962
48979
  * Comma-separated Meta ad_format values (max 10), one preview per format. Defaults to DESKTOP_FEED_STANDARD.
48963
48980
  */
@@ -48967,6 +48984,10 @@ export type GetAdPreviewsData = {
48967
48984
 
48968
48985
  export type GetAdPreviewsResponse = ({
48969
48986
  adId?: string;
48987
+ /**
48988
+ * False when the ad was read live from Meta because it is not in Zernio's store (request made with `accountId`).
48989
+ */
48990
+ synced?: boolean;
48970
48991
  previews?: Array<{
48971
48992
  format?: string;
48972
48993
  /**
@@ -48985,12 +49006,25 @@ export type GetAdReviewData = {
48985
49006
  */
48986
49007
  adId: string;
48987
49008
  };
49009
+ query?: {
49010
+ /**
49011
+ * Meta only. A Zernio connection id (Meta Ads or Facebook connection) used when `{adId}` is a Meta ad id that is not in Zernio's synced store, for example an ad created in Ads Manager on an ad account reached only through a Facebook connection. The ad is then read live from Meta through that connection and the response carries `synced: false`. The same rules as GET /v1/ads/campaigns/{campaignId} apply: a connection on a profile the API key cannot access answers 404, and an ad on an ad account outside the connection's selected ad accounts answers 403 `ad_account_not_selected`. An id Meta cannot read through the connection, or that is not an ad (a campaign or ad set id, for example), answers 404 `ad_not_found`, and a connection that is not Meta answers 501. Ads Meta reports as DELETED are returned too, with their status. Ignored when the ad is in the store (the stored ad's own connection is used). Without it an unsynced ad answers 404 `ad_not_found`. Writes (PUT, DELETE, status) still need the ad in the store.
49012
+ */
49013
+ accountId?: string;
49014
+ };
48988
49015
  };
48989
49016
 
48990
49017
  export type GetAdReviewResponse = ({
48991
- adId?: string;
49018
+ /**
49019
+ * Zernio ad id; null for an unsynced Meta ad read with `accountId`.
49020
+ */
49021
+ adId?: (string) | null;
48992
49022
  platform?: string;
48993
49023
  platformAdId?: string;
49024
+ /**
49025
+ * False when the ad was read live from Meta because it is not in Zernio's store.
49026
+ */
49027
+ synced?: boolean;
48994
49028
  review?: {
48995
49029
  /**
48996
49030
  * TikTok `is_approved`. Google and Meta: derived from the platform status (see the description).
@@ -49127,6 +49161,12 @@ export type GetAdMediaData = {
49127
49161
  */
49128
49162
  adId: string;
49129
49163
  };
49164
+ query?: {
49165
+ /**
49166
+ * Meta only. A Zernio connection id (Meta Ads or Facebook connection) used when `{adId}` is a Meta ad id that is not in Zernio's synced store, for example an ad created in Ads Manager on an ad account reached only through a Facebook connection. The ad is then read live from Meta through that connection and the response carries `synced: false`. The same rules as GET /v1/ads/campaigns/{campaignId} apply: a connection on a profile the API key cannot access answers 404, and an ad on an ad account outside the connection's selected ad accounts answers 403 `ad_account_not_selected`. An id Meta cannot read through the connection, or that is not an ad (a campaign or ad set id, for example), answers 404 `ad_not_found`, and a connection that is not Meta answers 501. Ads Meta reports as DELETED are returned too, with their status. Ignored when the ad is in the store (the stored ad's own connection is used). Without it an unsynced ad answers 404 `ad_not_found`. Writes (PUT, DELETE, status) still need the ad in the store.
49167
+ */
49168
+ accountId?: string;
49169
+ };
49130
49170
  };
49131
49171
 
49132
49172
  export type GetAdMediaResponse = ({
@@ -49135,6 +49175,10 @@ export type GetAdMediaResponse = ({
49135
49175
  * 'facebook' or 'instagram'. Only Meta is supported for now.
49136
49176
  */
49137
49177
  platform?: string;
49178
+ /**
49179
+ * False when the ad was read live from Meta because it is not in Zernio's store (request made with `accountId`).
49180
+ */
49181
+ synced?: boolean;
49138
49182
  media?: Array<{
49139
49183
  type?: 'image' | 'video';
49140
49184
  /**