@getlatedev/node 0.2.1361 → 0.2.1363

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.1363",
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.1363",
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.1363",
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';
@@ -2008,6 +2012,10 @@ export type AdTreeAdSet = {
2008
2012
  * LinkedIn only. Why the LinkedIn campaign backing this ad set is (or is not) delivering. A LinkedIn Campaign maps to this ad-set node, so this is the level where LinkedIn's holds actually apply. Empty means no serving data, ["RUNNABLE"] means eligible to serve, anything else is a hold. See the `servingStatuses` field on `Ad` for the known values.
2009
2013
  */
2010
2014
  servingStatuses?: Array<(string)>;
2015
+ /**
2016
+ * Meta only. Where the ad set stands in Meta's learning phase, as of the last sync: LEARNING while delivery is still being optimized (about 50 optimization events in 7 days end it), SUCCESS once it has left learning, FAIL when it could not gather enough events (Ads Manager's "Learning limited"). Null on other platforms and for ad sets not yet synced.
2017
+ */
2018
+ learningStatus?: ('LEARNING' | 'SUCCESS' | 'FAIL') | null;
2011
2019
  /**
2012
2020
  * Meta promoted object for this ad set (conversion event details)
2013
2021
  */
@@ -2026,6 +2034,11 @@ export type AdTreeAdSet = {
2026
2034
  daily?: Array<AdDailyMetrics>;
2027
2035
  };
2028
2036
 
2037
+ /**
2038
+ * Meta only. Where the ad set stands in Meta's learning phase, as of the last sync: LEARNING while delivery is still being optimized (about 50 optimization events in 7 days end it), SUCCESS once it has left learning, FAIL when it could not gather enough events (Ads Manager's "Learning limited"). Null on other platforms and for ad sets not yet synced.
2039
+ */
2040
+ export type learningStatus = 'LEARNING' | 'SUCCESS' | 'FAIL';
2041
+
2029
2042
  /**
2030
2043
  * Campaign with nested ad sets and rolled-up metrics
2031
2044
  */
@@ -11329,6 +11342,11 @@ export type ParameterLiveStatusRead = boolean;
11329
11342
  */
11330
11343
  export type ParameterPageParam = number;
11331
11344
 
11345
+ /**
11346
+ * 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.
11347
+ */
11348
+ export type ParameterUnsyncedMetaAdAccountId = string;
11349
+
11332
11350
  export type PhoneNumberStockWatch = {
11333
11351
  id: string;
11334
11352
  /**
@@ -48182,6 +48200,10 @@ export type GetAdData = {
48182
48200
  adId: string;
48183
48201
  };
48184
48202
  query?: {
48203
+ /**
48204
+ * 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.
48205
+ */
48206
+ accountId?: string;
48185
48207
  /**
48186
48208
  * 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
48209
  */
@@ -48200,7 +48222,7 @@ export type GetAdResponse = ({
48200
48222
  */
48201
48223
  stale?: boolean;
48202
48224
  /**
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.
48225
+ * 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
48226
  */
48205
48227
  statusReadAt?: (string) | null;
48206
48228
  /**
@@ -48240,7 +48262,7 @@ export type GetAdResponse = ({
48240
48262
 
48241
48263
  export type GetAdError = (ErrorResponse | {
48242
48264
  error?: string;
48243
- });
48265
+ } | unknown);
48244
48266
 
48245
48267
  export type UpdateAdData = {
48246
48268
  body: {
@@ -48953,11 +48975,15 @@ export type GenerateAdPreviewsError = (unknown | ErrorResponse);
48953
48975
  export type GetAdPreviewsData = {
48954
48976
  path: {
48955
48977
  /**
48956
- * Zernio ad id (24-char hex).
48978
+ * Zernio ad id (24-char hex) or Meta platform ad id.
48957
48979
  */
48958
48980
  adId: string;
48959
48981
  };
48960
48982
  query?: {
48983
+ /**
48984
+ * 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.
48985
+ */
48986
+ accountId?: string;
48961
48987
  /**
48962
48988
  * Comma-separated Meta ad_format values (max 10), one preview per format. Defaults to DESKTOP_FEED_STANDARD.
48963
48989
  */
@@ -48967,6 +48993,10 @@ export type GetAdPreviewsData = {
48967
48993
 
48968
48994
  export type GetAdPreviewsResponse = ({
48969
48995
  adId?: string;
48996
+ /**
48997
+ * False when the ad was read live from Meta because it is not in Zernio's store (request made with `accountId`).
48998
+ */
48999
+ synced?: boolean;
48970
49000
  previews?: Array<{
48971
49001
  format?: string;
48972
49002
  /**
@@ -48985,12 +49015,25 @@ export type GetAdReviewData = {
48985
49015
  */
48986
49016
  adId: string;
48987
49017
  };
49018
+ query?: {
49019
+ /**
49020
+ * 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.
49021
+ */
49022
+ accountId?: string;
49023
+ };
48988
49024
  };
48989
49025
 
48990
49026
  export type GetAdReviewResponse = ({
48991
- adId?: string;
49027
+ /**
49028
+ * Zernio ad id; null for an unsynced Meta ad read with `accountId`.
49029
+ */
49030
+ adId?: (string) | null;
48992
49031
  platform?: string;
48993
49032
  platformAdId?: string;
49033
+ /**
49034
+ * False when the ad was read live from Meta because it is not in Zernio's store.
49035
+ */
49036
+ synced?: boolean;
48994
49037
  review?: {
48995
49038
  /**
48996
49039
  * TikTok `is_approved`. Google and Meta: derived from the platform status (see the description).
@@ -49127,6 +49170,12 @@ export type GetAdMediaData = {
49127
49170
  */
49128
49171
  adId: string;
49129
49172
  };
49173
+ query?: {
49174
+ /**
49175
+ * 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.
49176
+ */
49177
+ accountId?: string;
49178
+ };
49130
49179
  };
49131
49180
 
49132
49181
  export type GetAdMediaResponse = ({
@@ -49135,6 +49184,10 @@ export type GetAdMediaResponse = ({
49135
49184
  * 'facebook' or 'instagram'. Only Meta is supported for now.
49136
49185
  */
49137
49186
  platform?: string;
49187
+ /**
49188
+ * False when the ad was read live from Meta because it is not in Zernio's store (request made with `accountId`).
49189
+ */
49190
+ synced?: boolean;
49138
49191
  media?: Array<{
49139
49192
  type?: 'image' | 'video';
49140
49193
  /**