@getlatedev/node 0.2.1333 → 0.2.1335

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.
@@ -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;
@@ -7459,6 +7460,91 @@ export type GoogleAdsUserInvitationApproval = {
7459
7460
  createdAt?: (string) | null;
7460
7461
  };
7461
7462
 
7463
+ /**
7464
+ * Google Analytics Data API report, passed through as Google returns it. Every value in `rows` is a string; read `metricHeaders[].type` to parse metrics.
7465
+ */
7466
+ export type GoogleAnalyticsReport = {
7467
+ /**
7468
+ * Zernio account ID of the Google Analytics connection.
7469
+ */
7470
+ accountId?: string;
7471
+ /**
7472
+ * Numeric GA4 property ID.
7473
+ */
7474
+ propertyId?: string;
7475
+ dimensionHeaders?: Array<{
7476
+ name?: string;
7477
+ }>;
7478
+ metricHeaders?: Array<{
7479
+ name?: string;
7480
+ /**
7481
+ * Google metric type, e.g. TYPE_INTEGER, TYPE_FLOAT, TYPE_SECONDS, TYPE_CURRENCY.
7482
+ */
7483
+ type?: string;
7484
+ }>;
7485
+ rows?: Array<{
7486
+ dimensionValues?: Array<{
7487
+ value?: string;
7488
+ }>;
7489
+ metricValues?: Array<{
7490
+ value?: string;
7491
+ }>;
7492
+ }>;
7493
+ /**
7494
+ * Total rows matching the request, across all pages.
7495
+ */
7496
+ rowCount?: number;
7497
+ /**
7498
+ * Google report metadata (currency, time zone, sampling and thresholding flags).
7499
+ */
7500
+ metadata?: {
7501
+ [key: string]: unknown;
7502
+ };
7503
+ /**
7504
+ * Google quota left on this property after the request (tokens per day and per hour, concurrent requests). Cached responses carry the quota from when they were fetched.
7505
+ */
7506
+ propertyQuota?: {
7507
+ [key: string]: unknown;
7508
+ };
7509
+ };
7510
+
7511
+ export type GoogleAnalyticsReportFields = {
7512
+ /**
7513
+ * Zernio account ID of the Google Analytics connection (platform `googleanalytics`).
7514
+ */
7515
+ accountId: string;
7516
+ /**
7517
+ * GA4 dimension API names, e.g. `date`, `sessionSource`, `pagePath`. List them with GET /v1/analytics/googleanalytics/metadata.
7518
+ */
7519
+ dimensions?: Array<(string)>;
7520
+ /**
7521
+ * GA4 metric API names, e.g. `sessions`, `activeUsers`, `keyEvents`, `totalRevenue`.
7522
+ */
7523
+ metrics: Array<(string)>;
7524
+ /**
7525
+ * A Google FilterExpression on dimensions, in Google's own shape.
7526
+ */
7527
+ dimensionFilter?: {
7528
+ [key: string]: unknown;
7529
+ };
7530
+ /**
7531
+ * A Google FilterExpression on metrics, in Google's own shape.
7532
+ */
7533
+ metricFilter?: {
7534
+ [key: string]: unknown;
7535
+ };
7536
+ /**
7537
+ * Google OrderBy objects, e.g. `{ "metric": { "metricName": "sessions" }, "desc": true }`.
7538
+ */
7539
+ orderBys?: Array<{
7540
+ [key: string]: unknown;
7541
+ }>;
7542
+ /**
7543
+ * Rows to return. Defaults to Google's default (10000).
7544
+ */
7545
+ limit?: number;
7546
+ };
7547
+
7462
7548
  /**
7463
7549
  * Link one asset to the asset group. Send exactly one of asset (an existing asset), text, imageUrl or youtubeVideoId (new content, created in the same request).
7464
7550
  */
@@ -9308,6 +9394,32 @@ export type InstagramTaggedMedia = {
9308
9394
  commentsCount: (number) | null;
9309
9395
  };
9310
9396
 
9397
+ /**
9398
+ * 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.
9399
+ */
9400
+ export type InstagramVideoFallback = {
9401
+ kind: 'instagram_video_reuploaded' | 'instagram_video_rehosted_copy';
9402
+ /**
9403
+ * True when the ad still references the original Instagram post and keeps its engagement.
9404
+ */
9405
+ linkedToOriginalPost: boolean;
9406
+ /**
9407
+ * 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).
9408
+ */
9409
+ videoId: string;
9410
+ /**
9411
+ * Meta's original refusal.
9412
+ */
9413
+ platformError: {
9414
+ code?: number;
9415
+ subcode?: number;
9416
+ message: string;
9417
+ fbtraceId?: string;
9418
+ };
9419
+ };
9420
+
9421
+ export type kind2 = 'instagram_video_reuploaded' | 'instagram_video_rehosted_copy';
9422
+
9311
9423
  /**
9312
9424
  * A Google Search keyword: a bare string (BROAD match), or an object naming the match type.
9313
9425
  */
@@ -12195,7 +12307,7 @@ export type contentType3 = 'story' | 'saved_story' | 'spotlight';
12195
12307
 
12196
12308
  export type SocialAccount = {
12197
12309
  _id: string;
12198
- platform: 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat' | 'discord' | 'slack' | 'whatsapp' | 'shopify' | 'wordpress' | 'wix' | 'linkedinads' | 'metaads' | 'pinterestads' | 'tiktokads' | 'xads' | 'googleads' | 'openaiads' | 'redditads' | 'sms' | 'phone' | 'rcs' | 'whopads' | 'hubspot' | 'webflow';
12310
+ platform: 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat' | 'discord' | 'slack' | 'whatsapp' | 'shopify' | 'wordpress' | 'wix' | 'linkedinads' | 'metaads' | 'pinterestads' | 'tiktokads' | 'xads' | 'googleads' | 'openaiads' | 'redditads' | 'sms' | 'phone' | 'rcs' | 'whopads' | 'hubspot' | 'webflow' | 'googleanalytics';
12199
12311
  profileId: (string | Profile);
12200
12312
  username?: string;
12201
12313
  displayName?: string;
@@ -12305,7 +12417,7 @@ export type SocialAccount = {
12305
12417
  };
12306
12418
  };
12307
12419
 
12308
- export type platform13 = 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat' | 'discord' | 'slack' | 'whatsapp' | 'shopify' | 'wordpress' | 'wix' | 'linkedinads' | 'metaads' | 'pinterestads' | 'tiktokads' | 'xads' | 'googleads' | 'openaiads' | 'redditads' | 'sms' | 'phone' | 'rcs' | 'whopads' | 'hubspot' | 'webflow';
12420
+ export type platform13 = 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat' | 'discord' | 'slack' | 'whatsapp' | 'shopify' | 'wordpress' | 'wix' | 'linkedinads' | 'metaads' | 'pinterestads' | 'tiktokads' | 'xads' | 'googleads' | 'openaiads' | 'redditads' | 'sms' | 'phone' | 'rcs' | 'whopads' | 'hubspot' | 'webflow' | 'googleanalytics';
12309
12421
 
12310
12422
  /**
12311
12423
  * TikTok accounts only. The account type TikTok reported when the account was connected. `personal` accounts cannot use TikTok direct messages through the API (TikTok limits Business Messaging to Business Accounts): skip the inbox for them and tell the user to switch to a Business Account in the TikTok app, then reconnect. `business` is the prerequisite, not a guarantee; messaging also needs the messaging scopes granted and TikTok's regional availability. `unknown` on accounts connected before this was captured or whose grant left out the account-type scope.
@@ -13167,7 +13279,7 @@ export type platform14 = 'metaads' | 'openaiads' | 'tiktokads' | 'googleads' | '
13167
13279
  /**
13168
13280
  * Platform-native flavor of the tag (Meta: `pixel`).
13169
13281
  */
13170
- export type kind2 = 'pixel' | 'tag' | 'insight_tag';
13282
+ export type kind3 = 'pixel' | 'tag' | 'insight_tag';
13171
13283
 
13172
13284
  /**
13173
13285
  * One health check the platform runs on a tracking tag.
@@ -20278,6 +20390,89 @@ export type GetPostTimelineError = ({
20278
20390
  code?: string;
20279
20391
  });
20280
20392
 
20393
+ export type RunGoogleAnalyticsReportData = {
20394
+ body: (GoogleAnalyticsReportFields & {
20395
+ /**
20396
+ * Defaults to the last 28 days (`28daysAgo` to `yesterday`).
20397
+ */
20398
+ dateRanges?: Array<{
20399
+ /**
20400
+ * YYYY-MM-DD, today, yesterday or NdaysAgo.
20401
+ */
20402
+ startDate: string;
20403
+ /**
20404
+ * YYYY-MM-DD, today, yesterday or NdaysAgo.
20405
+ */
20406
+ endDate: string;
20407
+ name?: string;
20408
+ }>;
20409
+ /**
20410
+ * Row offset for paging through a report larger than `limit`.
20411
+ */
20412
+ offset?: number;
20413
+ keepEmptyRows?: boolean;
20414
+ /**
20415
+ * ISO 4217 code for currency metrics. Defaults to the property currency.
20416
+ */
20417
+ currencyCode?: string;
20418
+ });
20419
+ };
20420
+
20421
+ export type RunGoogleAnalyticsReportResponse = (GoogleAnalyticsReport);
20422
+
20423
+ export type RunGoogleAnalyticsReportError = (ErrorResponse | unknown | {
20424
+ error?: string;
20425
+ });
20426
+
20427
+ export type RunGoogleAnalyticsRealtimeReportData = {
20428
+ body: (GoogleAnalyticsReportFields & {
20429
+ minuteRanges?: Array<{
20430
+ startMinutesAgo?: number;
20431
+ endMinutesAgo?: number;
20432
+ name?: string;
20433
+ }>;
20434
+ });
20435
+ };
20436
+
20437
+ export type RunGoogleAnalyticsRealtimeReportResponse = (GoogleAnalyticsReport);
20438
+
20439
+ export type RunGoogleAnalyticsRealtimeReportError = (ErrorResponse | unknown | {
20440
+ error?: string;
20441
+ });
20442
+
20443
+ export type GetGoogleAnalyticsMetadataData = {
20444
+ query: {
20445
+ /**
20446
+ * Zernio account ID of the Google Analytics connection.
20447
+ */
20448
+ accountId: string;
20449
+ };
20450
+ };
20451
+
20452
+ export type GetGoogleAnalyticsMetadataResponse = ({
20453
+ accountId?: string;
20454
+ propertyId?: string;
20455
+ dimensions?: Array<{
20456
+ apiName?: string;
20457
+ uiName?: string;
20458
+ description?: string;
20459
+ category?: string;
20460
+ customDefinition?: boolean;
20461
+ }>;
20462
+ metrics?: Array<{
20463
+ apiName?: string;
20464
+ uiName?: string;
20465
+ description?: string;
20466
+ type?: string;
20467
+ category?: string;
20468
+ customDefinition?: boolean;
20469
+ }>;
20470
+ });
20471
+
20472
+ export type GetGoogleAnalyticsMetadataError = (ErrorResponse | unknown | {
20473
+ error?: string;
20474
+ });
20475
+
20281
20476
  export type GetGoogleBusinessPerformanceData = {
20282
20477
  query: {
20283
20478
  /**
@@ -21927,9 +22122,9 @@ export type DeleteProfileError = (unknown | ErrorResponse | {
21927
22122
  export type ListAccountsData = {
21928
22123
  query?: {
21929
22124
  /**
21930
- * Only accounts of this kind. ads = ad accounts (Meta, Google, LinkedIn, Pinterest, TikTok, X, OpenAI, Reddit), communication = WhatsApp, Telegram, Discord, Slack and iMessage, blogs = Shopify and WordPress, crm = HubSpot, social = every other platform.
22125
+ * Only accounts of this kind. ads = ad accounts (Meta, Google, LinkedIn, Pinterest, TikTok, X, OpenAI, Reddit), communication = WhatsApp, Telegram, Discord, Slack and iMessage, blogs = Shopify and WordPress, crm = HubSpot, analytics = Google Analytics, social = every other platform.
21931
22126
  */
21932
- category?: 'social' | 'ads' | 'communication' | 'blogs' | 'crm';
22127
+ category?: 'social' | 'ads' | 'communication' | 'blogs' | 'crm' | 'analytics';
21933
22128
  /**
21934
22129
  * Opaque cursor from a previous response's `pagination.nextCursor`; returns the next page of `limit` accounts (500 when limit is omitted). A cursor we cannot parse returns 400. Cannot be combined with page.
21935
22130
  */
@@ -22147,7 +22342,7 @@ export type GetAllAccountsHealthData = {
22147
22342
  /**
22148
22343
  * Filter by platform
22149
22344
  */
22150
- platform?: 'facebook' | 'instagram' | 'linkedin' | 'twitter' | 'tiktok' | 'youtube' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat' | 'discord' | 'slack' | 'whatsapp' | 'shopify' | 'wordpress' | 'wix' | 'linkedinads' | 'metaads' | 'pinterestads' | 'tiktokads' | 'xads' | 'googleads' | 'openaiads' | 'redditads' | 'whopads' | 'hubspot' | 'webflow';
22345
+ platform?: 'facebook' | 'instagram' | 'linkedin' | 'twitter' | 'tiktok' | 'youtube' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat' | 'discord' | 'slack' | 'whatsapp' | 'shopify' | 'wordpress' | 'wix' | 'linkedinads' | 'metaads' | 'pinterestads' | 'tiktokads' | 'xads' | 'googleads' | 'openaiads' | 'redditads' | 'whopads' | 'hubspot' | 'webflow' | 'googleanalytics';
22151
22346
  /**
22152
22347
  * Filter by profile ID
22153
22348
  */
@@ -23761,6 +23956,91 @@ export type ConnectShopifyWithTokenError = (unknown | ErrorResponse | {
23761
23956
  };
23762
23957
  });
23763
23958
 
23959
+ export type GetGoogleAnalyticsConnectUrlData = {
23960
+ query: {
23961
+ /**
23962
+ * Your Zernio profile ID (get from /v1/profiles).
23963
+ */
23964
+ profileId: string;
23965
+ /**
23966
+ * Zernio account ID of the Google Analytics account being reconnected. Picking a different property then fails instead of adding a second account.
23967
+ */
23968
+ reconnectAccountId?: string;
23969
+ /**
23970
+ * Custom redirect after connection. Must be an absolute http(s) URL or custom app scheme such as `myapp://callback`; relative and unsafe URLs return 400.
23971
+ */
23972
+ redirect_url?: string;
23973
+ };
23974
+ };
23975
+
23976
+ export type GetGoogleAnalyticsConnectUrlResponse = ({
23977
+ /**
23978
+ * Google URL to open in the user agent.
23979
+ */
23980
+ authUrl: string;
23981
+ /**
23982
+ * Authenticated, expiring OAuth state handled by the callback.
23983
+ */
23984
+ state: string;
23985
+ });
23986
+
23987
+ export type GetGoogleAnalyticsConnectUrlError = (ErrorResponse | {
23988
+ /**
23989
+ * Human-readable error message suitable for end-user display.
23990
+ */
23991
+ error: string;
23992
+ /**
23993
+ * Machine-readable error code. Stable across versions.
23994
+ */
23995
+ code: 'PAYMENT_REQUIRED';
23996
+ /**
23997
+ * Discriminator for which gate fired.
23998
+ */
23999
+ reason: 'free_tier_exceeded' | 'twitter_passthrough' | 'enterprise_required' | 'card_verification_required';
24000
+ /**
24001
+ * Link to the relevant documentation page.
24002
+ */
24003
+ documentation_url?: string;
24004
+ /**
24005
+ * Deep-link to send the end-user to. For
24006
+ * `free_tier_exceeded` and `twitter_passthrough` this opens
24007
+ * the add-payment-method drawer on the Zernio billing page.
24008
+ * For `enterprise_required` this is the Zernio enterprise
24009
+ * contact page.
24010
+ *
24011
+ */
24012
+ dashboard_url?: string;
24013
+ /**
24014
+ * Structured context for SDK clients that want to render their own UX. Keys vary by `reason`.
24015
+ */
24016
+ details?: {
24017
+ /**
24018
+ * How many accounts the free tier allows. Only set when reason=free_tier_exceeded.
24019
+ */
24020
+ free_tier_account_limit?: number;
24021
+ /**
24022
+ * How many accounts the team currently has connected. Set when reason=free_tier_exceeded or reason=enterprise_required.
24023
+ */
24024
+ current_account_count?: number;
24025
+ /**
24026
+ * Whether the team currently has a card on file in Stripe. Set when reason=free_tier_exceeded or reason=twitter_passthrough.
24027
+ */
24028
+ has_payment_method?: boolean;
24029
+ /**
24030
+ * One-time card verification charge in USD cents, credited to usage. Only set when reason=card_verification_required.
24031
+ */
24032
+ verification_amount_cents?: number;
24033
+ /**
24034
+ * The negotiated connected-account cap from the
24035
+ * team's enterprise contract. Self-service teams
24036
+ * have no cap and never receive this reason. Only
24037
+ * set when reason=enterprise_required.
24038
+ *
24039
+ */
24040
+ effective_account_limit?: number;
24041
+ };
24042
+ } | unknown);
24043
+
23764
24044
  export type GetHubSpotConnectUrlData = {
23765
24045
  query: {
23766
24046
  /**
@@ -51501,6 +51781,10 @@ export type BoostPostData = {
51501
51781
  * 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.
51502
51782
  */
51503
51783
  bodies?: Array<(string)>;
51784
+ /**
51785
+ * 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.
51786
+ */
51787
+ rehostOnInstagramVideoRejection?: boolean;
51504
51788
  /**
51505
51789
  * TikTok only (a 400 elsewhere). TikTok Smart Targeting on the ad group: `audience` is
51506
51790
  * TikTok's `smart_audience_enabled`, `interestsBehaviors` its `smart_interest_behavior_enabled`.
@@ -51564,6 +51848,11 @@ export type BoostPostData = {
51564
51848
  export type BoostPostResponse = ({
51565
51849
  ad?: Ad;
51566
51850
  message?: string;
51851
+ instagramVideoFallback?: InstagramVideoFallback;
51852
+ /**
51853
+ * Present with instagramVideoFallback: one human-readable line saying how the Instagram video was boosted.
51854
+ */
51855
+ warnings?: Array<(string)>;
51567
51856
  });
51568
51857
 
51569
51858
  export type BoostPostError = (unknown | ErrorResponse);