@getlatedev/node 0.2.1444 → 0.2.1447

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.
@@ -2034,6 +2034,57 @@ export type AdsListResponse = {
2034
2034
  backfillPending?: boolean;
2035
2035
  };
2036
2036
 
2037
+ export type AdsPerformanceResponse = {
2038
+ ads: Array<{
2039
+ /**
2040
+ * Zernio ad ID.
2041
+ */
2042
+ adId?: string;
2043
+ platformAdId?: (string) | null;
2044
+ platform?: string;
2045
+ name?: string;
2046
+ status?: (string) | null;
2047
+ campaignName?: (string) | null;
2048
+ adSetName?: (string) | null;
2049
+ /**
2050
+ * ISO 4217 code of the ad's money metrics.
2051
+ */
2052
+ currency?: (string) | null;
2053
+ creative?: {
2054
+ type?: ('image' | 'video' | 'carousel' | 'document') | null;
2055
+ thumbnailUrl?: (string) | null;
2056
+ headline?: (string) | null;
2057
+ body?: (string) | null;
2058
+ linkUrl?: (string) | null;
2059
+ };
2060
+ metrics?: {
2061
+ /**
2062
+ * In the ad's currency.
2063
+ */
2064
+ spend?: number;
2065
+ impressions?: number;
2066
+ clicks?: number;
2067
+ /**
2068
+ * Percent.
2069
+ */
2070
+ ctr?: number;
2071
+ /**
2072
+ * Results over the range (see AdMetrics.conversions).
2073
+ */
2074
+ conversions?: number;
2075
+ costPerConversion?: number;
2076
+ purchaseValue?: number;
2077
+ roas?: number;
2078
+ /**
2079
+ * `conversions` split by what was counted (Meta action_type or Google conversion action name).
2080
+ */
2081
+ conversionsByType?: {
2082
+ [key: string]: (number);
2083
+ };
2084
+ };
2085
+ }>;
2086
+ };
2087
+
2037
2088
  export type AdStatus = 'active' | 'paused' | 'pending_review' | 'rejected' | 'completed' | 'cancelled' | 'error';
2038
2089
 
2039
2090
  export type AdsTimelineResponse = {
@@ -2174,9 +2225,16 @@ export type AdTreeAdSet = {
2174
2225
  platformAdSetId?: string;
2175
2226
  adSetName?: string;
2176
2227
  /**
2177
- * Derived from child ad statuses
2228
+ * Derived from child ad statuses. Reads `paused` when the synced ad set or its campaign is switched off on the platform, even while the ads still report their own switch as on.
2178
2229
  */
2179
2230
  status?: (AdStatus);
2231
+ /**
2232
+ * The ad set's start and end as last synced from the platform, as UTC instants. Null when the ad set was never synced or has no schedule (on Pinterest under a CBO campaign, the end date sits on the campaign).
2233
+ */
2234
+ schedule?: {
2235
+ startDate?: string;
2236
+ endDate?: string;
2237
+ } | null;
2180
2238
  /**
2181
2239
  * Earliest `platformCreatedAt` (platform ad creation time; falls back to `createdAt`, Zernio's sync time, for ads synced before that field existed) across this ad set's ads. Not the ad set's own creation time on the platform, but a proxy usable for sorting.
2182
2240
  */
@@ -2346,9 +2404,16 @@ export type AdTreeCampaign = {
2346
2404
  */
2347
2405
  createdTime?: (string) | null;
2348
2406
  /**
2349
- * Delivery status derived from child ad statuses. Distinct from `reviewStatus`, which reflects the platform-side review state.
2407
+ * Delivery status derived from child ad statuses. Reads `paused` when the campaign is switched off on the platform (`platformCampaignStatus`), even while its ads still report their own switch as on. Distinct from `reviewStatus`, which reflects the platform-side review state.
2350
2408
  */
2351
2409
  status?: (AdStatus);
2410
+ /**
2411
+ * The campaign's start and end as last synced from the platform, as UTC instants. Null when the campaign was never synced or has no schedule. Where the platform schedules the ad set instead (Meta, TikTok), read `AdTreeAdSet.schedule`.
2412
+ */
2413
+ schedule?: {
2414
+ startDate?: string;
2415
+ endDate?: string;
2416
+ } | null;
2352
2417
  /**
2353
2418
  * Platform-side review state of the campaign. Independent of the
2354
2419
  * children-derived delivery `status`: a campaign can have ads
@@ -12058,7 +12123,7 @@ export type visibility2 = 'published' | 'staging';
12058
12123
  export type gender2 = 'female' | 'male' | 'unisex';
12059
12124
 
12060
12125
  /**
12061
- * Meta Advantage+ creative enhancements. Map snake_case feature names to OPT_IN or OPT_OUT; Meta validates supported keys and unspecified features default to OPT_OUT. auto_promotion_tag is an Advantage+ enhancement, not the Ads Manager Promotion setting. The deprecated standard_enhancements bundle is rejected by Meta.
12126
+ * Meta Advantage+ creative enhancements. Map snake_case feature names to OPT_IN or OPT_OUT; Meta validates supported keys and unspecified features default to OPT_OUT. auto_promotion_tag is an Advantage+ enhancement, not the Ads Manager Promotion setting. The deprecated standard_enhancements bundle (subcode 3858504) is a 400 before any Meta call.
12062
12127
  */
12063
12128
  export type MetaCreativeFeatures = {
12064
12129
  [key: string]: ('OPT_IN' | 'OPT_OUT');
@@ -53191,6 +53256,48 @@ export type GetAdTreeResponse = (AdTreeResponse | (AdTreeResponse & {
53191
53256
 
53192
53257
  export type GetAdTreeError = (ErrorResponse | unknown);
53193
53258
 
53259
+ export type ListAdsByPerformanceData = {
53260
+ query: {
53261
+ /**
53262
+ * Account ID. Sibling-expanded to its linked posting and ads pair. An id the API key cannot reach answers 404.
53263
+ */
53264
+ accountId: string;
53265
+ /**
53266
+ * Optional platform-native ad account ID (e.g. Meta `act_…`) to rank one ad account only.
53267
+ */
53268
+ adAccountId?: string;
53269
+ /**
53270
+ * Inclusive start of the range (YYYY-MM-DD).
53271
+ */
53272
+ fromDate: string;
53273
+ /**
53274
+ * How many ads to return.
53275
+ */
53276
+ limit?: number;
53277
+ /**
53278
+ * Restrict to one platform.
53279
+ */
53280
+ platform?: 'facebook' | 'instagram' | 'tiktok' | 'linkedin' | 'pinterest' | 'google' | 'twitter' | 'openai' | 'reddit' | 'microsoft';
53281
+ /**
53282
+ * Metric the ads are ranked by, highest first.
53283
+ */
53284
+ sortBy?: 'spend' | 'impressions' | 'clicks' | 'conversions' | 'roas';
53285
+ /**
53286
+ * Inclusive end of the range (YYYY-MM-DD). Max 730-day range.
53287
+ */
53288
+ toDate: string;
53289
+ };
53290
+ };
53291
+
53292
+ export type ListAdsByPerformanceResponse = (AdsPerformanceResponse | (AdsPerformanceResponse & {
53293
+ /**
53294
+ * Always true on this response. Retry until the request returns 200.
53295
+ */
53296
+ backfillPending: boolean;
53297
+ }));
53298
+
53299
+ export type ListAdsByPerformanceError = (ErrorResponse | unknown);
53300
+
53194
53301
  export type GetAdsTimelineData = {
53195
53302
  query: {
53196
53303
  /**
@@ -53471,7 +53578,11 @@ export type UpdateAdData = {
53471
53578
  * **Meta**: patch-style.
53472
53579
  *
53473
53580
  * - Pass any subset: omitted fields are preserved from the live creative, including media (`image_hash`/`video_id` reused, no re-upload) and `url_tags`. Sending the full set (`headline`, `body`, `callToAction`, `linkUrl`, `imageUrl`) rebuilds the creative from scratch.
53474
- * - Partial patching reads the live `object_story_spec`, which Meta strips on SHARE / page-post / dark / asset_feed creatives; those return 422 asking for the full set. A `videoUrl`/`videoId` on an image creative is a type change and also needs the full set.
53581
+ * - Partial patching reads the live `object_story_spec`, which Meta strips on SHARE / page-post / dark post creatives; those return 422 asking for the full set. A `videoUrl`/`videoId` on an image creative is a type change and also needs the full set.
53582
+ * - Creatives with an `asset_feed_spec` (several text options, placement or language rules) take text, link, tracking and enhancement edits in place. The new creative is built from the live asset feed with the edited text, and every video, image, label and rule is kept.
53583
+ * - On those, `body`, `headline` and `description` replace the one option of that kind. When the feed has several, send `bodies`, `headlines` or `descriptions` with one text per option, in order. `linkUrl` replaces the feed's only destination link.
53584
+ * - Image, video and call-to-action changes on asset_feed creatives apply to the story spec (Multiple Text Options creatives). They return 422 when the feed itself holds the images, videos or call-to-action options.
53585
+ * - The live creative's deprecated `standard_enhancements` setting (Meta subcode 3858504) is never sent back; every other enhancement setting is kept.
53475
53586
  * - `existingCreativeId` repoints the ad at a creative from GET /v1/ads/creatives and ignores every other field.
53476
53587
  * - Meta creatives are immutable: any change creates a new creative and repoints the ad. The old creative stays on the ad account for historical reporting.
53477
53588
  * - `creativeFeatures` is Meta-only. Omitted settings are preserved from the live creative, including on full rebuilds; a supplied creativeFeatures map overrides individual existing keys.
@@ -53523,11 +53634,26 @@ export type UpdateAdData = {
53523
53634
  * Google Display only. Uploaded as a new square (1:1) marketing image asset that replaces the current one.
53524
53635
  */
53525
53636
  squareImageUrl?: string;
53637
+ /**
53638
+ * Primary text. On a Meta asset_feed creative it replaces the feed's only body option (422 when it has several: send `bodies`).
53639
+ */
53526
53640
  body?: string;
53641
+ /**
53642
+ * Meta only. The primary text options of an asset_feed creative, one text per option in the order GET /v1/ads/{adId} returns them. Each replaces the option in its position and keeps its rule. A different count returns 422, as does a single-text creative (send `body`). Not with `body`.
53643
+ */
53644
+ bodies?: Array<(string)>;
53645
+ /**
53646
+ * Meta only. Same as `bodies`, for the headline options (Meta `asset_feed_spec.titles`). Cannot be sent with `headline`. Not the top-level Google `headlines`.
53647
+ */
53648
+ headlines?: Array<(string)>;
53527
53649
  /**
53528
53650
  * Link description slot (Meta `link_data.description` / `video_data.link_description`, LinkedIn creative description).
53529
53651
  */
53530
53652
  description?: string;
53653
+ /**
53654
+ * Meta only. Same as `bodies`, for the description options. Cannot be sent with `description`. Not the top-level Google `descriptions`.
53655
+ */
53656
+ descriptions?: Array<(string)>;
53531
53657
  callToAction?: string;
53532
53658
  linkUrl?: string;
53533
53659
  imageUrl?: string;
@@ -58443,10 +58569,12 @@ export type BoostPostData = {
58443
58569
  /**
58444
58570
  * Ad-set end time (ISO 8601). Required for lifetime budgets. Same field as on POST /v1/ads/create.
58445
58571
  *
58446
- * Maps to the ad set's `end_time` (on X, the line item's `end_time`; X campaigns carry no flight dates).
58572
+ * Maps to the ad set's `end_time` (on X, the line item's `end_time`; X campaigns carry no flight dates). On Pinterest it also goes on the campaign when the ad account needs Campaign Budget Optimization, daily budget included.
58447
58573
  *
58448
58574
  * On Meta, TikTok, X, Pinterest and Reddit, a value without an offset (`YYYY-MM-DD`, `YYYY-MM-DD HH:MM:SS` or `YYYY-MM-DDTHH:MM:SS`) is read in the ad account timezone, and a date-only end runs to 23:59:59 local.
58449
58575
  *
58576
+ * Anything that is not an ISO 8601 date or date-time is a 400 on `endDate`.
58577
+ *
58450
58578
  */
58451
58579
  endDate?: string;
58452
58580
  /**
@@ -59987,6 +60115,10 @@ export type CreateStandaloneAdData = {
59987
60115
  * When the ad ends. If omitted: on a lifetime budget, the ad ends 7 days after it starts (reported in `appliedDefaults.endDate`); a daily budget runs until paused.
59988
60116
  *
59989
60117
  * Read like `startDate`: account timezone on Meta, TikTok, X, Pinterest, OpenAI and Reddit; whole account-local days on Google; UTC on LinkedIn. A date-only end runs to 23:59:59 local.
60118
+ *
60119
+ * On a Pinterest ad account that needs Campaign Budget Optimization, the end also goes on the campaign, daily budget included.
60120
+ *
60121
+ * 400 when it is not an ISO 8601 date or date-time, or when the ad joins a parent that keeps its own dates: `adSetId` on Meta, TikTok, Google, LinkedIn and Reddit, and `existingCampaignId` on Google.
59990
60122
  */
59991
60123
  endDate?: string;
59992
60124
  /**
@@ -62440,6 +62572,10 @@ export type ListAdAudiencesResponse = ({
62440
62572
  spec?: (TargetingSpec | null);
62441
62573
  platform?: string;
62442
62574
  size?: number;
62575
+ /**
62576
+ * Who the audience contains, in one line (e.g. '1% lookalike of Customers in US' or 'All website visitors, last 30 days'). Meta only.
62577
+ */
62578
+ summary?: string;
62443
62579
  status?: string;
62444
62580
  }>;
62445
62581
  });