@getlatedev/node 0.2.1334 → 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.
@@ -7460,6 +7460,91 @@ export type GoogleAdsUserInvitationApproval = {
7460
7460
  createdAt?: (string) | null;
7461
7461
  };
7462
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
+
7463
7548
  /**
7464
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).
7465
7550
  */
@@ -12222,7 +12307,7 @@ export type contentType3 = 'story' | 'saved_story' | 'spotlight';
12222
12307
 
12223
12308
  export type SocialAccount = {
12224
12309
  _id: string;
12225
- 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';
12226
12311
  profileId: (string | Profile);
12227
12312
  username?: string;
12228
12313
  displayName?: string;
@@ -12332,7 +12417,7 @@ export type SocialAccount = {
12332
12417
  };
12333
12418
  };
12334
12419
 
12335
- 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';
12336
12421
 
12337
12422
  /**
12338
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.
@@ -20305,6 +20390,89 @@ export type GetPostTimelineError = ({
20305
20390
  code?: string;
20306
20391
  });
20307
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
+
20308
20476
  export type GetGoogleBusinessPerformanceData = {
20309
20477
  query: {
20310
20478
  /**
@@ -21954,9 +22122,9 @@ export type DeleteProfileError = (unknown | ErrorResponse | {
21954
22122
  export type ListAccountsData = {
21955
22123
  query?: {
21956
22124
  /**
21957
- * 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.
21958
22126
  */
21959
- category?: 'social' | 'ads' | 'communication' | 'blogs' | 'crm';
22127
+ category?: 'social' | 'ads' | 'communication' | 'blogs' | 'crm' | 'analytics';
21960
22128
  /**
21961
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.
21962
22130
  */
@@ -22174,7 +22342,7 @@ export type GetAllAccountsHealthData = {
22174
22342
  /**
22175
22343
  * Filter by platform
22176
22344
  */
22177
- 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';
22178
22346
  /**
22179
22347
  * Filter by profile ID
22180
22348
  */
@@ -23788,6 +23956,91 @@ export type ConnectShopifyWithTokenError = (unknown | ErrorResponse | {
23788
23956
  };
23789
23957
  });
23790
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
+
23791
24044
  export type GetHubSpotConnectUrlData = {
23792
24045
  query: {
23793
24046
  /**