@getlatedev/node 0.2.1112 → 0.2.1114

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.d.mts CHANGED
@@ -10652,9 +10652,13 @@ type PlatformAnalytics = {
10652
10652
  */
10653
10653
  errorMessage?: (string) | null;
10654
10654
  /**
10655
- * Stable machine-readable reason for errorMessage. post_not_found: the post was deleted or is no longer visible to the account. permission_missing: the last analytics sync of the Facebook account failed because the Page no longer grants pages_read_engagement (pending entries only). null: no stable code, read errorMessage. New values may be added.
10655
+ * Stable machine-readable reason for errorMessage. post_not_found: the post was deleted or is no longer visible to the account. not_post_owner: the post is owned by another Page or user (collab or visitor post); its analytics cannot be read with this Page's token. permission_missing: the last analytics sync of the Facebook account failed because the Page no longer grants pages_read_engagement (pending entries only). null: no stable code, read errorMessage. New values may be added.
10656
10656
  */
10657
- errorCode?: ('post_not_found' | 'permission_missing') | null;
10657
+ errorCode?: ('post_not_found' | 'not_post_owner' | 'permission_missing') | null;
10658
+ /**
10659
+ * Facebook only: true when the connected Page authored the post, false when Facebook reports another author (a collab post), null when unknown or for other platforms.
10660
+ */
10661
+ isOwner?: (boolean) | null;
10658
10662
  };
10659
10663
  type status24 = 'published' | 'failed';
10660
10664
  /**
@@ -10662,9 +10666,9 @@ type status24 = 'published' | 'failed';
10662
10666
  */
10663
10667
  type syncStatus2 = 'synced' | 'pending' | 'unavailable';
10664
10668
  /**
10665
- * Stable machine-readable reason for errorMessage. post_not_found: the post was deleted or is no longer visible to the account. permission_missing: the last analytics sync of the Facebook account failed because the Page no longer grants pages_read_engagement (pending entries only). null: no stable code, read errorMessage. New values may be added.
10669
+ * Stable machine-readable reason for errorMessage. post_not_found: the post was deleted or is no longer visible to the account. not_post_owner: the post is owned by another Page or user (collab or visitor post); its analytics cannot be read with this Page's token. permission_missing: the last analytics sync of the Facebook account failed because the Page no longer grants pages_read_engagement (pending entries only). null: no stable code, read errorMessage. New values may be added.
10666
10670
  */
10667
- type errorCode = 'post_not_found' | 'permission_missing';
10671
+ type errorCode = 'post_not_found' | 'not_post_owner' | 'permission_missing';
10668
10672
  type PlatformTarget = {
10669
10673
  /**
10670
10674
  * Supported values: twitter, threads, instagram, youtube, facebook, linkedin, pinterest, reddit, tiktok, bluesky, googlebusiness, telegram
@@ -44806,15 +44810,15 @@ type GetAdAccountFinanceError = (unknown | ErrorResponse);
44806
44810
  type GetAdAccountLiveEntitiesData = {
44807
44811
  query: {
44808
44812
  /**
44809
- * Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
44813
+ * Zernio SocialAccount id (posting or ads variant) used to resolve the platform token.
44810
44814
  */
44811
44815
  accountId: string;
44812
44816
  /**
44813
- * Meta ad account id (act_<n>).
44817
+ * Meta ad account id (act_<n>) or TikTok advertiser id (digits).
44814
44818
  */
44815
44819
  adAccountId: string;
44816
44820
  /**
44817
- * Cursor from `paging.campaigns.after` or `paging.adSets.after` of a previous response. Requires `level`.
44821
+ * Cursor from `paging.campaigns.after` or `paging.adSets.after` of a previous response. Requires `level` (and on TikTok the same `limit`).
44818
44822
  */
44819
44823
  after?: string;
44820
44824
  /**
@@ -44829,6 +44833,7 @@ type GetAdAccountLiveEntitiesData = {
44829
44833
  * Comma-separated Meta `effective_status` values to keep: ACTIVE, PAUSED, IN_PROCESS,
44830
44834
  * WITH_ISSUES, DELETED, ARCHIVED, and CAMPAIGN_PAUSED (ad sets only; the campaigns level
44831
44835
  * ignores it). Defaults to every status except DELETED and ARCHIVED. An unknown value is a 400.
44836
+ * TikTok takes a single value: ACTIVE, PAUSED or DELETED (see the description).
44832
44837
  */
44833
44838
  status?: string;
44834
44839
  };
@@ -44836,13 +44841,13 @@ type GetAdAccountLiveEntitiesData = {
44836
44841
  type GetAdAccountLiveEntitiesResponse = ({
44837
44842
  accountId?: string;
44838
44843
  adAccountId?: string;
44839
- platform?: 'facebook';
44844
+ platform?: 'facebook' | 'tiktok';
44840
44845
  /**
44841
44846
  * ISO 4217 code every budget and bid amount is expressed in.
44842
44847
  */
44843
44848
  currency?: string;
44844
44849
  /**
44845
- * When Meta was read.
44850
+ * When the platform was read.
44846
44851
  */
44847
44852
  readAt?: string;
44848
44853
  /**
@@ -44852,11 +44857,11 @@ type GetAdAccountLiveEntitiesResponse = ({
44852
44857
  platformCampaignId?: string;
44853
44858
  campaignName?: (string) | null;
44854
44859
  /**
44855
- * Meta `effective_status`, for example ACTIVE, PAUSED, WITH_ISSUES.
44860
+ * Meta `effective_status` (ACTIVE, PAUSED, WITH_ISSUES...) or TikTok `secondary_status` (CAMPAIGN_STATUS_ENABLE...).
44856
44861
  */
44857
44862
  platformCampaignStatus?: (string) | null;
44858
44863
  /**
44859
- * Meta `status`: the campaign's own switch (ACTIVE, PAUSED, DELETED, ARCHIVED).
44864
+ * The campaign's own switch: Meta `status` (ACTIVE, PAUSED, DELETED, ARCHIVED), or TikTok `operation_status` as ACTIVE (ENABLE) / PAUSED (DISABLE).
44860
44865
  */
44861
44866
  configuredStatus?: (string) | null;
44862
44867
  /**
@@ -44871,23 +44876,27 @@ type GetAdAccountLiveEntitiesResponse = ({
44871
44876
  type?: 'daily' | 'lifetime';
44872
44877
  } | null;
44873
44878
  /**
44874
- * Meta `daily_budget` in whole units of `currency`.
44879
+ * Daily budget in whole units of `currency` (Meta `daily_budget`; TikTok `budget` under a daily budget mode).
44875
44880
  */
44876
44881
  dailyBudget?: (number) | null;
44877
44882
  /**
44878
- * Meta `lifetime_budget` in whole units of `currency`.
44883
+ * Lifetime budget in whole units of `currency` (Meta `lifetime_budget`; TikTok `budget` under BUDGET_MODE_TOTAL).
44879
44884
  */
44880
44885
  lifetimeBudget?: (number) | null;
44881
44886
  /**
44882
- * Meta `budget_remaining` in whole units of `currency`. Null when the campaign has no budget of its own.
44887
+ * TikTok only: `budget_mode` as TikTok reports it (BUDGET_MODE_DAY, BUDGET_MODE_DYNAMIC_DAILY_BUDGET, BUDGET_MODE_TOTAL, BUDGET_MODE_INFINITE).
44888
+ */
44889
+ budgetMode?: (string) | null;
44890
+ /**
44891
+ * Meta `budget_remaining` in whole units of `currency`. Null when the campaign has no budget of its own, and always on TikTok.
44883
44892
  */
44884
44893
  budgetRemaining?: (number) | null;
44885
44894
  /**
44886
- * Campaign spending limit (Meta `spend_cap`) in whole units of `currency`. Null when none is set.
44895
+ * Campaign spending limit (Meta `spend_cap`) in whole units of `currency`. Null when none is set, and always on TikTok.
44887
44896
  */
44888
44897
  spendCap?: (number) | null;
44889
44898
  /**
44890
- * Meta `bid_strategy`, set on campaigns with a campaign budget.
44899
+ * Meta `bid_strategy`, set on campaigns with a campaign budget. Null on TikTok.
44891
44900
  */
44892
44901
  bidStrategy?: (string) | null;
44893
44902
  }>;
@@ -44899,11 +44908,11 @@ type GetAdAccountLiveEntitiesResponse = ({
44899
44908
  adSetName?: (string) | null;
44900
44909
  platformCampaignId?: (string) | null;
44901
44910
  /**
44902
- * Meta `effective_status`, for example ACTIVE, PAUSED, CAMPAIGN_PAUSED.
44911
+ * Meta `effective_status` (ACTIVE, PAUSED, CAMPAIGN_PAUSED...) or TikTok `secondary_status` (ADGROUP_STATUS_DELIVERY_OK, ADGROUP_STATUS_AUDIT...).
44903
44912
  */
44904
44913
  platformAdSetStatus?: (string) | null;
44905
44914
  /**
44906
- * Meta `status`: the ad set's own switch.
44915
+ * The ad set's own switch: Meta `status`, or TikTok `operation_status` as ACTIVE / PAUSED.
44907
44916
  */
44908
44917
  configuredStatus?: (string) | null;
44909
44918
  /**
@@ -44918,41 +44927,45 @@ type GetAdAccountLiveEntitiesResponse = ({
44918
44927
  type?: 'daily' | 'lifetime';
44919
44928
  } | null;
44920
44929
  /**
44921
- * Meta `daily_budget` in whole units of `currency`.
44930
+ * Daily budget in whole units of `currency`.
44922
44931
  */
44923
44932
  dailyBudget?: (number) | null;
44924
44933
  /**
44925
- * Meta `lifetime_budget` in whole units of `currency`.
44934
+ * Lifetime budget in whole units of `currency`.
44926
44935
  */
44927
44936
  lifetimeBudget?: (number) | null;
44928
44937
  /**
44929
- * Meta `budget_remaining` in whole units of `currency`. Null when the ad set has no budget of its own.
44938
+ * TikTok only: `budget_mode` as TikTok reports it.
44939
+ */
44940
+ budgetMode?: (string) | null;
44941
+ /**
44942
+ * Meta `budget_remaining` in whole units of `currency`. Null when the ad set has no budget of its own, and always on TikTok.
44930
44943
  */
44931
44944
  budgetRemaining?: (number) | null;
44932
44945
  /**
44933
- * Meta `bid_strategy`.
44946
+ * Meta `bid_strategy`. On TikTok the ad group's `bid_type` normalized to the same vocabulary (LOWEST_COST_WITHOUT_CAP, LOWEST_COST_WITH_BID_CAP, LOWEST_COST_WITH_MIN_ROAS).
44934
44947
  */
44935
44948
  bidStrategy?: (string) | null;
44936
44949
  /**
44937
- * Meta `bid_amount` (bid cap or cost target) in whole units of `currency`. Null when the strategy has none.
44950
+ * Bid cap or cost target in whole units of `currency` (Meta `bid_amount`; TikTok `bid_price`, else `conversion_bid_price`, else `deep_cpa_bid`). Null when the strategy has none.
44938
44951
  */
44939
44952
  bidAmount?: (number) | null;
44940
44953
  /**
44941
- * Meta `optimization_goal`.
44954
+ * Meta or TikTok `optimization_goal`.
44942
44955
  */
44943
44956
  optimizationGoal?: (string) | null;
44944
44957
  /**
44945
- * Meta `billing_event`.
44958
+ * Meta or TikTok `billing_event`.
44946
44959
  */
44947
44960
  billingEvent?: (string) | null;
44948
44961
  /**
44949
- * Meta `promoted_object` verbatim (snake_case).
44962
+ * Meta `promoted_object` verbatim (snake_case). On TikTok `{ pixelId, customEventType, applicationId, customConversionId }` from `pixel_id`, `optimization_event`, `app_id` and `custom_conversion_id`, only the keys TikTok has set; null when none is.
44950
44963
  */
44951
44964
  promotedObject?: {
44952
44965
  [key: string]: unknown;
44953
44966
  } | null;
44954
44967
  /**
44955
- * Meta `targeting` verbatim (snake_case), as Meta returns it now.
44968
+ * The platform's targeting verbatim (snake_case), as it reports it now: Meta `targeting`, or TikTok's ad group targeting fields (location_ids, age_groups, gender, languages, interest_category_ids, audience_ids, placements...).
44956
44969
  */
44957
44970
  targeting?: {
44958
44971
  [key: string]: unknown;
package/dist/index.d.ts CHANGED
@@ -10652,9 +10652,13 @@ type PlatformAnalytics = {
10652
10652
  */
10653
10653
  errorMessage?: (string) | null;
10654
10654
  /**
10655
- * Stable machine-readable reason for errorMessage. post_not_found: the post was deleted or is no longer visible to the account. permission_missing: the last analytics sync of the Facebook account failed because the Page no longer grants pages_read_engagement (pending entries only). null: no stable code, read errorMessage. New values may be added.
10655
+ * Stable machine-readable reason for errorMessage. post_not_found: the post was deleted or is no longer visible to the account. not_post_owner: the post is owned by another Page or user (collab or visitor post); its analytics cannot be read with this Page's token. permission_missing: the last analytics sync of the Facebook account failed because the Page no longer grants pages_read_engagement (pending entries only). null: no stable code, read errorMessage. New values may be added.
10656
10656
  */
10657
- errorCode?: ('post_not_found' | 'permission_missing') | null;
10657
+ errorCode?: ('post_not_found' | 'not_post_owner' | 'permission_missing') | null;
10658
+ /**
10659
+ * Facebook only: true when the connected Page authored the post, false when Facebook reports another author (a collab post), null when unknown or for other platforms.
10660
+ */
10661
+ isOwner?: (boolean) | null;
10658
10662
  };
10659
10663
  type status24 = 'published' | 'failed';
10660
10664
  /**
@@ -10662,9 +10666,9 @@ type status24 = 'published' | 'failed';
10662
10666
  */
10663
10667
  type syncStatus2 = 'synced' | 'pending' | 'unavailable';
10664
10668
  /**
10665
- * Stable machine-readable reason for errorMessage. post_not_found: the post was deleted or is no longer visible to the account. permission_missing: the last analytics sync of the Facebook account failed because the Page no longer grants pages_read_engagement (pending entries only). null: no stable code, read errorMessage. New values may be added.
10669
+ * Stable machine-readable reason for errorMessage. post_not_found: the post was deleted or is no longer visible to the account. not_post_owner: the post is owned by another Page or user (collab or visitor post); its analytics cannot be read with this Page's token. permission_missing: the last analytics sync of the Facebook account failed because the Page no longer grants pages_read_engagement (pending entries only). null: no stable code, read errorMessage. New values may be added.
10666
10670
  */
10667
- type errorCode = 'post_not_found' | 'permission_missing';
10671
+ type errorCode = 'post_not_found' | 'not_post_owner' | 'permission_missing';
10668
10672
  type PlatformTarget = {
10669
10673
  /**
10670
10674
  * Supported values: twitter, threads, instagram, youtube, facebook, linkedin, pinterest, reddit, tiktok, bluesky, googlebusiness, telegram
@@ -44806,15 +44810,15 @@ type GetAdAccountFinanceError = (unknown | ErrorResponse);
44806
44810
  type GetAdAccountLiveEntitiesData = {
44807
44811
  query: {
44808
44812
  /**
44809
- * Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
44813
+ * Zernio SocialAccount id (posting or ads variant) used to resolve the platform token.
44810
44814
  */
44811
44815
  accountId: string;
44812
44816
  /**
44813
- * Meta ad account id (act_<n>).
44817
+ * Meta ad account id (act_<n>) or TikTok advertiser id (digits).
44814
44818
  */
44815
44819
  adAccountId: string;
44816
44820
  /**
44817
- * Cursor from `paging.campaigns.after` or `paging.adSets.after` of a previous response. Requires `level`.
44821
+ * Cursor from `paging.campaigns.after` or `paging.adSets.after` of a previous response. Requires `level` (and on TikTok the same `limit`).
44818
44822
  */
44819
44823
  after?: string;
44820
44824
  /**
@@ -44829,6 +44833,7 @@ type GetAdAccountLiveEntitiesData = {
44829
44833
  * Comma-separated Meta `effective_status` values to keep: ACTIVE, PAUSED, IN_PROCESS,
44830
44834
  * WITH_ISSUES, DELETED, ARCHIVED, and CAMPAIGN_PAUSED (ad sets only; the campaigns level
44831
44835
  * ignores it). Defaults to every status except DELETED and ARCHIVED. An unknown value is a 400.
44836
+ * TikTok takes a single value: ACTIVE, PAUSED or DELETED (see the description).
44832
44837
  */
44833
44838
  status?: string;
44834
44839
  };
@@ -44836,13 +44841,13 @@ type GetAdAccountLiveEntitiesData = {
44836
44841
  type GetAdAccountLiveEntitiesResponse = ({
44837
44842
  accountId?: string;
44838
44843
  adAccountId?: string;
44839
- platform?: 'facebook';
44844
+ platform?: 'facebook' | 'tiktok';
44840
44845
  /**
44841
44846
  * ISO 4217 code every budget and bid amount is expressed in.
44842
44847
  */
44843
44848
  currency?: string;
44844
44849
  /**
44845
- * When Meta was read.
44850
+ * When the platform was read.
44846
44851
  */
44847
44852
  readAt?: string;
44848
44853
  /**
@@ -44852,11 +44857,11 @@ type GetAdAccountLiveEntitiesResponse = ({
44852
44857
  platformCampaignId?: string;
44853
44858
  campaignName?: (string) | null;
44854
44859
  /**
44855
- * Meta `effective_status`, for example ACTIVE, PAUSED, WITH_ISSUES.
44860
+ * Meta `effective_status` (ACTIVE, PAUSED, WITH_ISSUES...) or TikTok `secondary_status` (CAMPAIGN_STATUS_ENABLE...).
44856
44861
  */
44857
44862
  platformCampaignStatus?: (string) | null;
44858
44863
  /**
44859
- * Meta `status`: the campaign's own switch (ACTIVE, PAUSED, DELETED, ARCHIVED).
44864
+ * The campaign's own switch: Meta `status` (ACTIVE, PAUSED, DELETED, ARCHIVED), or TikTok `operation_status` as ACTIVE (ENABLE) / PAUSED (DISABLE).
44860
44865
  */
44861
44866
  configuredStatus?: (string) | null;
44862
44867
  /**
@@ -44871,23 +44876,27 @@ type GetAdAccountLiveEntitiesResponse = ({
44871
44876
  type?: 'daily' | 'lifetime';
44872
44877
  } | null;
44873
44878
  /**
44874
- * Meta `daily_budget` in whole units of `currency`.
44879
+ * Daily budget in whole units of `currency` (Meta `daily_budget`; TikTok `budget` under a daily budget mode).
44875
44880
  */
44876
44881
  dailyBudget?: (number) | null;
44877
44882
  /**
44878
- * Meta `lifetime_budget` in whole units of `currency`.
44883
+ * Lifetime budget in whole units of `currency` (Meta `lifetime_budget`; TikTok `budget` under BUDGET_MODE_TOTAL).
44879
44884
  */
44880
44885
  lifetimeBudget?: (number) | null;
44881
44886
  /**
44882
- * Meta `budget_remaining` in whole units of `currency`. Null when the campaign has no budget of its own.
44887
+ * TikTok only: `budget_mode` as TikTok reports it (BUDGET_MODE_DAY, BUDGET_MODE_DYNAMIC_DAILY_BUDGET, BUDGET_MODE_TOTAL, BUDGET_MODE_INFINITE).
44888
+ */
44889
+ budgetMode?: (string) | null;
44890
+ /**
44891
+ * Meta `budget_remaining` in whole units of `currency`. Null when the campaign has no budget of its own, and always on TikTok.
44883
44892
  */
44884
44893
  budgetRemaining?: (number) | null;
44885
44894
  /**
44886
- * Campaign spending limit (Meta `spend_cap`) in whole units of `currency`. Null when none is set.
44895
+ * Campaign spending limit (Meta `spend_cap`) in whole units of `currency`. Null when none is set, and always on TikTok.
44887
44896
  */
44888
44897
  spendCap?: (number) | null;
44889
44898
  /**
44890
- * Meta `bid_strategy`, set on campaigns with a campaign budget.
44899
+ * Meta `bid_strategy`, set on campaigns with a campaign budget. Null on TikTok.
44891
44900
  */
44892
44901
  bidStrategy?: (string) | null;
44893
44902
  }>;
@@ -44899,11 +44908,11 @@ type GetAdAccountLiveEntitiesResponse = ({
44899
44908
  adSetName?: (string) | null;
44900
44909
  platformCampaignId?: (string) | null;
44901
44910
  /**
44902
- * Meta `effective_status`, for example ACTIVE, PAUSED, CAMPAIGN_PAUSED.
44911
+ * Meta `effective_status` (ACTIVE, PAUSED, CAMPAIGN_PAUSED...) or TikTok `secondary_status` (ADGROUP_STATUS_DELIVERY_OK, ADGROUP_STATUS_AUDIT...).
44903
44912
  */
44904
44913
  platformAdSetStatus?: (string) | null;
44905
44914
  /**
44906
- * Meta `status`: the ad set's own switch.
44915
+ * The ad set's own switch: Meta `status`, or TikTok `operation_status` as ACTIVE / PAUSED.
44907
44916
  */
44908
44917
  configuredStatus?: (string) | null;
44909
44918
  /**
@@ -44918,41 +44927,45 @@ type GetAdAccountLiveEntitiesResponse = ({
44918
44927
  type?: 'daily' | 'lifetime';
44919
44928
  } | null;
44920
44929
  /**
44921
- * Meta `daily_budget` in whole units of `currency`.
44930
+ * Daily budget in whole units of `currency`.
44922
44931
  */
44923
44932
  dailyBudget?: (number) | null;
44924
44933
  /**
44925
- * Meta `lifetime_budget` in whole units of `currency`.
44934
+ * Lifetime budget in whole units of `currency`.
44926
44935
  */
44927
44936
  lifetimeBudget?: (number) | null;
44928
44937
  /**
44929
- * Meta `budget_remaining` in whole units of `currency`. Null when the ad set has no budget of its own.
44938
+ * TikTok only: `budget_mode` as TikTok reports it.
44939
+ */
44940
+ budgetMode?: (string) | null;
44941
+ /**
44942
+ * Meta `budget_remaining` in whole units of `currency`. Null when the ad set has no budget of its own, and always on TikTok.
44930
44943
  */
44931
44944
  budgetRemaining?: (number) | null;
44932
44945
  /**
44933
- * Meta `bid_strategy`.
44946
+ * Meta `bid_strategy`. On TikTok the ad group's `bid_type` normalized to the same vocabulary (LOWEST_COST_WITHOUT_CAP, LOWEST_COST_WITH_BID_CAP, LOWEST_COST_WITH_MIN_ROAS).
44934
44947
  */
44935
44948
  bidStrategy?: (string) | null;
44936
44949
  /**
44937
- * Meta `bid_amount` (bid cap or cost target) in whole units of `currency`. Null when the strategy has none.
44950
+ * Bid cap or cost target in whole units of `currency` (Meta `bid_amount`; TikTok `bid_price`, else `conversion_bid_price`, else `deep_cpa_bid`). Null when the strategy has none.
44938
44951
  */
44939
44952
  bidAmount?: (number) | null;
44940
44953
  /**
44941
- * Meta `optimization_goal`.
44954
+ * Meta or TikTok `optimization_goal`.
44942
44955
  */
44943
44956
  optimizationGoal?: (string) | null;
44944
44957
  /**
44945
- * Meta `billing_event`.
44958
+ * Meta or TikTok `billing_event`.
44946
44959
  */
44947
44960
  billingEvent?: (string) | null;
44948
44961
  /**
44949
- * Meta `promoted_object` verbatim (snake_case).
44962
+ * Meta `promoted_object` verbatim (snake_case). On TikTok `{ pixelId, customEventType, applicationId, customConversionId }` from `pixel_id`, `optimization_event`, `app_id` and `custom_conversion_id`, only the keys TikTok has set; null when none is.
44950
44963
  */
44951
44964
  promotedObject?: {
44952
44965
  [key: string]: unknown;
44953
44966
  } | null;
44954
44967
  /**
44955
- * Meta `targeting` verbatim (snake_case), as Meta returns it now.
44968
+ * The platform's targeting verbatim (snake_case), as it reports it now: Meta `targeting`, or TikTok's ad group targeting fields (location_ids, age_groups, gender, languages, interest_category_ids, audience_ids, placements...).
44956
44969
  */
44957
44970
  targeting?: {
44958
44971
  [key: string]: unknown;
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.1112",
39
+ version: "0.2.1114",
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.1112",
8
+ version: "0.2.1114",
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.1112",
3
+ "version": "0.2.1114",
4
4
  "description": "The official Node.js library for the Zernio API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -11811,25 +11811,40 @@ export const getAdAccountFinance = <ThrowOnError extends boolean = false>(option
11811
11811
 
11812
11812
  /**
11813
11813
  * Read an ad account's campaigns and ad sets live
11814
- * Reads the campaigns and ad sets of one Meta ad account **live from Meta**, in a single
11815
- * Graph call per request (the account's `/campaigns` and `/adsets` edges, filtered by
11816
- * `effective_status`), so it is cheap enough to run before every write: for example a
11817
- * per-ad-account spend ceiling that must see the current `daily_budget` / `lifetime_budget`
11818
- * rather than the synced copy.
11814
+ * Reads the campaigns and ad sets of one Meta ad account or TikTok advertiser **live from
11815
+ * the platform**, so it is cheap enough to run before every write: for example a
11816
+ * per-ad-account spend ceiling that must see the current daily / lifetime budget rather
11817
+ * than the synced copy. On Meta it is a single Graph call per request (the account's
11818
+ * `/campaigns` and `/adsets` edges, filtered by `effective_status`); on TikTok one
11819
+ * `campaign/get` and one `adgroup/get` page (TikTok ad groups are returned as `adSets`).
11819
11820
  *
11820
11821
  * **Live vs synced.** GET /v1/ads/campaigns and GET /v1/ads/ad-sets serve Zernio's synced
11821
11822
  * store, refreshed by background sync (typically 15 to 60 minutes behind Meta), and their
11822
11823
  * `live=true` re-reads only the on/off switches of at most 20 objects. This endpoint returns
11823
11824
  * what Meta reports at `readAt`, for every matching campaign and ad set, and stores nothing.
11824
11825
  *
11825
- * Budgets and bid amounts are converted from Meta's minor units to whole units of
11826
- * `currency`, the same units as the synced rows. A campaign with a campaign budget
11827
- * (Advantage+ campaign budget) carries `budget` and its ad sets have `budget: null`;
11828
- * otherwise each ad set carries its own.
11826
+ * Budgets and bid amounts are in whole units of `currency`, the same units as the synced
11827
+ * rows (Meta's minor units are converted; TikTok already reports whole units). A campaign
11828
+ * with a campaign budget (Meta Advantage+ campaign budget, TikTok campaign budget
11829
+ * optimization) carries `budget`; otherwise each ad set carries its own.
11829
11830
  *
11830
11831
  * Each level returns at most `limit` rows. When more match, `paging.<level>.after` is a
11831
11832
  * cursor: pass it back as `after` together with `level` to read the next page of that
11832
- * level only. Other platforms answer 501 rather than serving synced data.
11833
+ * level only. TikTok pages by number, so a TikTok cursor must be sent with the same
11834
+ * `limit` that produced it (another `limit` is a 400). Other platforms answer 501 rather
11835
+ * than serving synced data.
11836
+ *
11837
+ * **TikTok specifics.** `status` maps to TikTok's `primary_status` filter, which takes one
11838
+ * value: ACTIVE = delivering (`STATUS_DELIVERY_OK`), PAUSED = switched off
11839
+ * (`STATUS_DISABLE`), DELETED = `STATUS_DELETE`; omitted = every status except deleted
11840
+ * (`STATUS_NOT_DELETE`, which includes enabled entities that are not delivering, such as
11841
+ * an ad group in review). Several values, or IN_PROCESS, WITH_ISSUES, CAMPAIGN_PAUSED and
11842
+ * ARCHIVED, are a 400. `budgetRemaining` and `spendCap` are always null (TikTok reports
11843
+ * neither), campaign `bidStrategy` is null (TikTok bids per ad group), ad set `bidStrategy`
11844
+ * is normalized to the Meta vocabulary like GET /v1/ads, `promotedObject` is
11845
+ * `{ pixelId, customEventType, applicationId, customConversionId }` (the keys TikTok has
11846
+ * set, as POST /v1/ads/create takes them), and `targeting` holds TikTok's targeting
11847
+ * fields verbatim.
11833
11848
  */
11834
11849
  export const getAdAccountLiveEntities = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetAdAccountLiveEntitiesData, ThrowOnError>) => {
11835
11850
  return (options?.client ?? client).get<GetAdAccountLiveEntitiesResponse, GetAdAccountLiveEntitiesError, ThrowOnError>({
@@ -9041,9 +9041,13 @@ export type PlatformAnalytics = {
9041
9041
  */
9042
9042
  errorMessage?: (string) | null;
9043
9043
  /**
9044
- * Stable machine-readable reason for errorMessage. post_not_found: the post was deleted or is no longer visible to the account. permission_missing: the last analytics sync of the Facebook account failed because the Page no longer grants pages_read_engagement (pending entries only). null: no stable code, read errorMessage. New values may be added.
9044
+ * Stable machine-readable reason for errorMessage. post_not_found: the post was deleted or is no longer visible to the account. not_post_owner: the post is owned by another Page or user (collab or visitor post); its analytics cannot be read with this Page's token. permission_missing: the last analytics sync of the Facebook account failed because the Page no longer grants pages_read_engagement (pending entries only). null: no stable code, read errorMessage. New values may be added.
9045
9045
  */
9046
- errorCode?: ('post_not_found' | 'permission_missing') | null;
9046
+ errorCode?: ('post_not_found' | 'not_post_owner' | 'permission_missing') | null;
9047
+ /**
9048
+ * Facebook only: true when the connected Page authored the post, false when Facebook reports another author (a collab post), null when unknown or for other platforms.
9049
+ */
9050
+ isOwner?: (boolean) | null;
9047
9051
  };
9048
9052
 
9049
9053
  export type status24 = 'published' | 'failed';
@@ -9054,9 +9058,9 @@ export type status24 = 'published' | 'failed';
9054
9058
  export type syncStatus2 = 'synced' | 'pending' | 'unavailable';
9055
9059
 
9056
9060
  /**
9057
- * Stable machine-readable reason for errorMessage. post_not_found: the post was deleted or is no longer visible to the account. permission_missing: the last analytics sync of the Facebook account failed because the Page no longer grants pages_read_engagement (pending entries only). null: no stable code, read errorMessage. New values may be added.
9061
+ * Stable machine-readable reason for errorMessage. post_not_found: the post was deleted or is no longer visible to the account. not_post_owner: the post is owned by another Page or user (collab or visitor post); its analytics cannot be read with this Page's token. permission_missing: the last analytics sync of the Facebook account failed because the Page no longer grants pages_read_engagement (pending entries only). null: no stable code, read errorMessage. New values may be added.
9058
9062
  */
9059
- export type errorCode = 'post_not_found' | 'permission_missing';
9063
+ export type errorCode = 'post_not_found' | 'not_post_owner' | 'permission_missing';
9060
9064
 
9061
9065
  export type PlatformTarget = {
9062
9066
  /**
@@ -45563,15 +45567,15 @@ export type GetAdAccountFinanceError = (unknown | ErrorResponse);
45563
45567
  export type GetAdAccountLiveEntitiesData = {
45564
45568
  query: {
45565
45569
  /**
45566
- * Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
45570
+ * Zernio SocialAccount id (posting or ads variant) used to resolve the platform token.
45567
45571
  */
45568
45572
  accountId: string;
45569
45573
  /**
45570
- * Meta ad account id (act_<n>).
45574
+ * Meta ad account id (act_<n>) or TikTok advertiser id (digits).
45571
45575
  */
45572
45576
  adAccountId: string;
45573
45577
  /**
45574
- * Cursor from `paging.campaigns.after` or `paging.adSets.after` of a previous response. Requires `level`.
45578
+ * Cursor from `paging.campaigns.after` or `paging.adSets.after` of a previous response. Requires `level` (and on TikTok the same `limit`).
45575
45579
  */
45576
45580
  after?: string;
45577
45581
  /**
@@ -45586,6 +45590,7 @@ export type GetAdAccountLiveEntitiesData = {
45586
45590
  * Comma-separated Meta `effective_status` values to keep: ACTIVE, PAUSED, IN_PROCESS,
45587
45591
  * WITH_ISSUES, DELETED, ARCHIVED, and CAMPAIGN_PAUSED (ad sets only; the campaigns level
45588
45592
  * ignores it). Defaults to every status except DELETED and ARCHIVED. An unknown value is a 400.
45593
+ * TikTok takes a single value: ACTIVE, PAUSED or DELETED (see the description).
45589
45594
  */
45590
45595
  status?: string;
45591
45596
  };
@@ -45594,13 +45599,13 @@ export type GetAdAccountLiveEntitiesData = {
45594
45599
  export type GetAdAccountLiveEntitiesResponse = ({
45595
45600
  accountId?: string;
45596
45601
  adAccountId?: string;
45597
- platform?: 'facebook';
45602
+ platform?: 'facebook' | 'tiktok';
45598
45603
  /**
45599
45604
  * ISO 4217 code every budget and bid amount is expressed in.
45600
45605
  */
45601
45606
  currency?: string;
45602
45607
  /**
45603
- * When Meta was read.
45608
+ * When the platform was read.
45604
45609
  */
45605
45610
  readAt?: string;
45606
45611
  /**
@@ -45610,11 +45615,11 @@ export type GetAdAccountLiveEntitiesResponse = ({
45610
45615
  platformCampaignId?: string;
45611
45616
  campaignName?: (string) | null;
45612
45617
  /**
45613
- * Meta `effective_status`, for example ACTIVE, PAUSED, WITH_ISSUES.
45618
+ * Meta `effective_status` (ACTIVE, PAUSED, WITH_ISSUES...) or TikTok `secondary_status` (CAMPAIGN_STATUS_ENABLE...).
45614
45619
  */
45615
45620
  platformCampaignStatus?: (string) | null;
45616
45621
  /**
45617
- * Meta `status`: the campaign's own switch (ACTIVE, PAUSED, DELETED, ARCHIVED).
45622
+ * The campaign's own switch: Meta `status` (ACTIVE, PAUSED, DELETED, ARCHIVED), or TikTok `operation_status` as ACTIVE (ENABLE) / PAUSED (DISABLE).
45618
45623
  */
45619
45624
  configuredStatus?: (string) | null;
45620
45625
  /**
@@ -45629,23 +45634,27 @@ export type GetAdAccountLiveEntitiesResponse = ({
45629
45634
  type?: 'daily' | 'lifetime';
45630
45635
  } | null;
45631
45636
  /**
45632
- * Meta `daily_budget` in whole units of `currency`.
45637
+ * Daily budget in whole units of `currency` (Meta `daily_budget`; TikTok `budget` under a daily budget mode).
45633
45638
  */
45634
45639
  dailyBudget?: (number) | null;
45635
45640
  /**
45636
- * Meta `lifetime_budget` in whole units of `currency`.
45641
+ * Lifetime budget in whole units of `currency` (Meta `lifetime_budget`; TikTok `budget` under BUDGET_MODE_TOTAL).
45637
45642
  */
45638
45643
  lifetimeBudget?: (number) | null;
45639
45644
  /**
45640
- * Meta `budget_remaining` in whole units of `currency`. Null when the campaign has no budget of its own.
45645
+ * TikTok only: `budget_mode` as TikTok reports it (BUDGET_MODE_DAY, BUDGET_MODE_DYNAMIC_DAILY_BUDGET, BUDGET_MODE_TOTAL, BUDGET_MODE_INFINITE).
45646
+ */
45647
+ budgetMode?: (string) | null;
45648
+ /**
45649
+ * Meta `budget_remaining` in whole units of `currency`. Null when the campaign has no budget of its own, and always on TikTok.
45641
45650
  */
45642
45651
  budgetRemaining?: (number) | null;
45643
45652
  /**
45644
- * Campaign spending limit (Meta `spend_cap`) in whole units of `currency`. Null when none is set.
45653
+ * Campaign spending limit (Meta `spend_cap`) in whole units of `currency`. Null when none is set, and always on TikTok.
45645
45654
  */
45646
45655
  spendCap?: (number) | null;
45647
45656
  /**
45648
- * Meta `bid_strategy`, set on campaigns with a campaign budget.
45657
+ * Meta `bid_strategy`, set on campaigns with a campaign budget. Null on TikTok.
45649
45658
  */
45650
45659
  bidStrategy?: (string) | null;
45651
45660
  }>;
@@ -45657,11 +45666,11 @@ export type GetAdAccountLiveEntitiesResponse = ({
45657
45666
  adSetName?: (string) | null;
45658
45667
  platformCampaignId?: (string) | null;
45659
45668
  /**
45660
- * Meta `effective_status`, for example ACTIVE, PAUSED, CAMPAIGN_PAUSED.
45669
+ * Meta `effective_status` (ACTIVE, PAUSED, CAMPAIGN_PAUSED...) or TikTok `secondary_status` (ADGROUP_STATUS_DELIVERY_OK, ADGROUP_STATUS_AUDIT...).
45661
45670
  */
45662
45671
  platformAdSetStatus?: (string) | null;
45663
45672
  /**
45664
- * Meta `status`: the ad set's own switch.
45673
+ * The ad set's own switch: Meta `status`, or TikTok `operation_status` as ACTIVE / PAUSED.
45665
45674
  */
45666
45675
  configuredStatus?: (string) | null;
45667
45676
  /**
@@ -45676,41 +45685,45 @@ export type GetAdAccountLiveEntitiesResponse = ({
45676
45685
  type?: 'daily' | 'lifetime';
45677
45686
  } | null;
45678
45687
  /**
45679
- * Meta `daily_budget` in whole units of `currency`.
45688
+ * Daily budget in whole units of `currency`.
45680
45689
  */
45681
45690
  dailyBudget?: (number) | null;
45682
45691
  /**
45683
- * Meta `lifetime_budget` in whole units of `currency`.
45692
+ * Lifetime budget in whole units of `currency`.
45684
45693
  */
45685
45694
  lifetimeBudget?: (number) | null;
45686
45695
  /**
45687
- * Meta `budget_remaining` in whole units of `currency`. Null when the ad set has no budget of its own.
45696
+ * TikTok only: `budget_mode` as TikTok reports it.
45697
+ */
45698
+ budgetMode?: (string) | null;
45699
+ /**
45700
+ * Meta `budget_remaining` in whole units of `currency`. Null when the ad set has no budget of its own, and always on TikTok.
45688
45701
  */
45689
45702
  budgetRemaining?: (number) | null;
45690
45703
  /**
45691
- * Meta `bid_strategy`.
45704
+ * Meta `bid_strategy`. On TikTok the ad group's `bid_type` normalized to the same vocabulary (LOWEST_COST_WITHOUT_CAP, LOWEST_COST_WITH_BID_CAP, LOWEST_COST_WITH_MIN_ROAS).
45692
45705
  */
45693
45706
  bidStrategy?: (string) | null;
45694
45707
  /**
45695
- * Meta `bid_amount` (bid cap or cost target) in whole units of `currency`. Null when the strategy has none.
45708
+ * Bid cap or cost target in whole units of `currency` (Meta `bid_amount`; TikTok `bid_price`, else `conversion_bid_price`, else `deep_cpa_bid`). Null when the strategy has none.
45696
45709
  */
45697
45710
  bidAmount?: (number) | null;
45698
45711
  /**
45699
- * Meta `optimization_goal`.
45712
+ * Meta or TikTok `optimization_goal`.
45700
45713
  */
45701
45714
  optimizationGoal?: (string) | null;
45702
45715
  /**
45703
- * Meta `billing_event`.
45716
+ * Meta or TikTok `billing_event`.
45704
45717
  */
45705
45718
  billingEvent?: (string) | null;
45706
45719
  /**
45707
- * Meta `promoted_object` verbatim (snake_case).
45720
+ * Meta `promoted_object` verbatim (snake_case). On TikTok `{ pixelId, customEventType, applicationId, customConversionId }` from `pixel_id`, `optimization_event`, `app_id` and `custom_conversion_id`, only the keys TikTok has set; null when none is.
45708
45721
  */
45709
45722
  promotedObject?: {
45710
45723
  [key: string]: unknown;
45711
45724
  } | null;
45712
45725
  /**
45713
- * Meta `targeting` verbatim (snake_case), as Meta returns it now.
45726
+ * The platform's targeting verbatim (snake_case), as it reports it now: Meta `targeting`, or TikTok's ad group targeting fields (location_ids, age_groups, gender, languages, interest_category_ids, audience_ids, placements...).
45714
45727
  */
45715
45728
  targeting?: {
45716
45729
  [key: string]: unknown;