@zernio/node 0.2.484 → 0.2.486

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
@@ -1654,7 +1654,9 @@ type budgetLevel = 'campaign' | 'adset';
1654
1654
  * called with `timeIncrement=1`. Rate metrics (ctr/cpc/cpm/costPerConversion/
1655
1655
  * roas/videoAvgTimeWatchedActions) are recomputed per day from that day's
1656
1656
  * sums, so summing the additive fields across a node's `daily[]` reproduces
1657
- * its aggregated `metrics` total. Do NOT sum or plain-average
1657
+ * its aggregated `metrics` total. `reach` is the exception: on Meta the
1658
+ * aggregated total is de-duplicated across the range, so daily reach does
1659
+ * not sum to it. Do NOT sum or plain-average
1658
1660
  * `videoAvgTimeWatchedActions` across days: the range value is the
1659
1661
  * play-weighted average of the daily values.
1660
1662
  *
@@ -1668,6 +1670,9 @@ type AdDailyMetrics = AdMetrics & {
1668
1670
  type AdMetrics = {
1669
1671
  spend?: number;
1670
1672
  impressions?: number;
1673
+ /**
1674
+ * Unique people reached in the requested date range. Meta (facebook/instagram): Meta's own de-duplicated reach for the exact range, fetched live and cached up to ~1 hour (may lag recent delivery; on a transient Meta error the value temporarily falls back to a sum of per-day reach, which overcounts people reached on multiple days or by multiple child ads). Because it is de-duplicated, Meta reach is NOT additive: neither daily values nor child nodes sum to the range total. TikTok: sum of per-day reach, so multi-day ranges overcount vs TikTok Ads Manager. Google, LinkedIn, X, Pinterest and OpenAI report 0 (reach not synced). Only derive frequency (impressions / reach) for Meta.
1675
+ */
1671
1676
  reach?: number;
1672
1677
  clicks?: number;
1673
1678
  /**
@@ -1816,7 +1821,7 @@ type AdTreeAdSet = {
1816
1821
  page_id?: string;
1817
1822
  } | null;
1818
1823
  /**
1819
- * Individual ads within this ad set (capped at 100). Returns a subset of Ad fields from the aggregation (core fields like _id, name, platform, status, budget, metrics, creative, goal are included; targeting and schedule may be absent). When `timeIncrement=1&dailyLevel=ad`, each entry also carries a `daily[]` array of `AdDailyMetrics`.
1824
+ * Individual ads within this ad set (capped at 100). Returns a subset of Ad fields from the aggregation: `_id`, `name`, `platform`, `status`, `configuredStatus`, `reviewStatus`, `budget`, `metrics`, `creative`, `goal` and the `platform*` ids are always included; `targeting` and `schedule` may be absent. `configuredStatus` (the ad's own on/off toggle) and `reviewStatus` (the platform's review verdict) are part of this contract, not incidental: a rejected ad is only distinguishable from a healthy one through `reviewStatus`. When `timeIncrement=1&dailyLevel=ad`, each entry also carries a `daily[]` array of `AdDailyMetrics`.
1820
1825
  */
1821
1826
  ads?: Array<Ad>;
1822
1827
  /**
@@ -1928,7 +1933,7 @@ type AdTreeCampaign = {
1928
1933
  } | null;
1929
1934
  adSets?: Array<AdTreeAdSet>;
1930
1935
  /**
1931
- * Per-day metric series for this campaign. Present only when `GET /v1/ads/tree` is called with `timeIncrement=1` (any `dailyLevel`). This is the per-campaign daily trend — summing its additive fields reproduces the campaign `metrics` total.
1936
+ * Per-day metric series for this campaign. Present only when `GET /v1/ads/tree` is called with `timeIncrement=1` (any `dailyLevel`). This is the per-campaign daily trend — summing its additive fields reproduces the campaign `metrics` total, except `reach`: on Meta the range total is de-duplicated, so daily reach does not sum to it.
1932
1937
  */
1933
1938
  daily?: Array<AdDailyMetrics>;
1934
1939
  };
@@ -25332,7 +25337,7 @@ type GetAdTreeData = {
25332
25337
  */
25333
25338
  status?: AdStatus;
25334
25339
  /**
25335
- * Set to `1` to also return a daily breakdown. Mirrors Meta Insights' `time_increment=1`: each node gains a `daily[]` array of per-day metrics (same fields as the aggregated `metrics`) alongside the range total, so you get per-entity daily trends in ONE call instead of calling the tree once per day. Only `1` (daily) is supported. The daily series covers the same date range and uses the same source data as `metrics`. See `dailyLevel` to control which levels carry it.
25340
+ * Set to `1` to also return a daily breakdown. Mirrors Meta Insights' `time_increment=1`: each node gains a `daily[]` array of per-day metrics (same fields as the aggregated `metrics`) alongside the range total, so you get per-entity daily trends in ONE call instead of calling the tree once per day. Only `1` (daily) is supported. The daily series covers the same date range and uses the same source data as `metrics`, except Meta `reach`: the range total is Meta's de-duplicated value, so daily reach does not sum to it. See `dailyLevel` to control which levels carry it.
25336
25341
  */
25337
25342
  timeIncrement?: 1;
25338
25343
  /**
@@ -25384,6 +25389,9 @@ type GetAdsTimelineResponse = ({
25384
25389
  */
25385
25390
  spend?: number;
25386
25391
  impressions?: number;
25392
+ /**
25393
+ * Reach summed across the account's ads for this single day. A person seen by two ads the same day counts twice, and reach is de-duplicated per day only: do NOT sum it across days (people reached on multiple days would be double-counted).
25394
+ */
25387
25395
  reach?: number;
25388
25396
  clicks?: number;
25389
25397
  engagement?: number;
@@ -27942,6 +27950,12 @@ type CreateStandaloneAdData = {
27942
27950
  /**
27943
27951
  * Pixel ID. **Meta:** Facebook Pixel ID, required for `goal: conversions`.
27944
27952
  * **TikTok:** TikTok Pixel ID, required for `goal: conversions`.
27953
+ * To discover the pixels an ad account can use, call
27954
+ * `GET /v1/accounts/{accountId}/tracking-tags?adAccountId=act_...` (each entry
27955
+ * carries `kind` and `ownerAdAccountId`), or
27956
+ * `GET /v1/accounts/{accountId}/conversion-destinations`. Note this is a
27957
+ * different resource from `GET /v1/ads/{adId}/tracking-tags`, which reads an
27958
+ * ad's click-URL params (`url_tags`), not pixels.
27945
27959
  *
27946
27960
  */
27947
27961
  pixelId?: string;
package/dist/index.d.ts CHANGED
@@ -1654,7 +1654,9 @@ type budgetLevel = 'campaign' | 'adset';
1654
1654
  * called with `timeIncrement=1`. Rate metrics (ctr/cpc/cpm/costPerConversion/
1655
1655
  * roas/videoAvgTimeWatchedActions) are recomputed per day from that day's
1656
1656
  * sums, so summing the additive fields across a node's `daily[]` reproduces
1657
- * its aggregated `metrics` total. Do NOT sum or plain-average
1657
+ * its aggregated `metrics` total. `reach` is the exception: on Meta the
1658
+ * aggregated total is de-duplicated across the range, so daily reach does
1659
+ * not sum to it. Do NOT sum or plain-average
1658
1660
  * `videoAvgTimeWatchedActions` across days: the range value is the
1659
1661
  * play-weighted average of the daily values.
1660
1662
  *
@@ -1668,6 +1670,9 @@ type AdDailyMetrics = AdMetrics & {
1668
1670
  type AdMetrics = {
1669
1671
  spend?: number;
1670
1672
  impressions?: number;
1673
+ /**
1674
+ * Unique people reached in the requested date range. Meta (facebook/instagram): Meta's own de-duplicated reach for the exact range, fetched live and cached up to ~1 hour (may lag recent delivery; on a transient Meta error the value temporarily falls back to a sum of per-day reach, which overcounts people reached on multiple days or by multiple child ads). Because it is de-duplicated, Meta reach is NOT additive: neither daily values nor child nodes sum to the range total. TikTok: sum of per-day reach, so multi-day ranges overcount vs TikTok Ads Manager. Google, LinkedIn, X, Pinterest and OpenAI report 0 (reach not synced). Only derive frequency (impressions / reach) for Meta.
1675
+ */
1671
1676
  reach?: number;
1672
1677
  clicks?: number;
1673
1678
  /**
@@ -1816,7 +1821,7 @@ type AdTreeAdSet = {
1816
1821
  page_id?: string;
1817
1822
  } | null;
1818
1823
  /**
1819
- * Individual ads within this ad set (capped at 100). Returns a subset of Ad fields from the aggregation (core fields like _id, name, platform, status, budget, metrics, creative, goal are included; targeting and schedule may be absent). When `timeIncrement=1&dailyLevel=ad`, each entry also carries a `daily[]` array of `AdDailyMetrics`.
1824
+ * Individual ads within this ad set (capped at 100). Returns a subset of Ad fields from the aggregation: `_id`, `name`, `platform`, `status`, `configuredStatus`, `reviewStatus`, `budget`, `metrics`, `creative`, `goal` and the `platform*` ids are always included; `targeting` and `schedule` may be absent. `configuredStatus` (the ad's own on/off toggle) and `reviewStatus` (the platform's review verdict) are part of this contract, not incidental: a rejected ad is only distinguishable from a healthy one through `reviewStatus`. When `timeIncrement=1&dailyLevel=ad`, each entry also carries a `daily[]` array of `AdDailyMetrics`.
1820
1825
  */
1821
1826
  ads?: Array<Ad>;
1822
1827
  /**
@@ -1928,7 +1933,7 @@ type AdTreeCampaign = {
1928
1933
  } | null;
1929
1934
  adSets?: Array<AdTreeAdSet>;
1930
1935
  /**
1931
- * Per-day metric series for this campaign. Present only when `GET /v1/ads/tree` is called with `timeIncrement=1` (any `dailyLevel`). This is the per-campaign daily trend — summing its additive fields reproduces the campaign `metrics` total.
1936
+ * Per-day metric series for this campaign. Present only when `GET /v1/ads/tree` is called with `timeIncrement=1` (any `dailyLevel`). This is the per-campaign daily trend — summing its additive fields reproduces the campaign `metrics` total, except `reach`: on Meta the range total is de-duplicated, so daily reach does not sum to it.
1932
1937
  */
1933
1938
  daily?: Array<AdDailyMetrics>;
1934
1939
  };
@@ -25332,7 +25337,7 @@ type GetAdTreeData = {
25332
25337
  */
25333
25338
  status?: AdStatus;
25334
25339
  /**
25335
- * Set to `1` to also return a daily breakdown. Mirrors Meta Insights' `time_increment=1`: each node gains a `daily[]` array of per-day metrics (same fields as the aggregated `metrics`) alongside the range total, so you get per-entity daily trends in ONE call instead of calling the tree once per day. Only `1` (daily) is supported. The daily series covers the same date range and uses the same source data as `metrics`. See `dailyLevel` to control which levels carry it.
25340
+ * Set to `1` to also return a daily breakdown. Mirrors Meta Insights' `time_increment=1`: each node gains a `daily[]` array of per-day metrics (same fields as the aggregated `metrics`) alongside the range total, so you get per-entity daily trends in ONE call instead of calling the tree once per day. Only `1` (daily) is supported. The daily series covers the same date range and uses the same source data as `metrics`, except Meta `reach`: the range total is Meta's de-duplicated value, so daily reach does not sum to it. See `dailyLevel` to control which levels carry it.
25336
25341
  */
25337
25342
  timeIncrement?: 1;
25338
25343
  /**
@@ -25384,6 +25389,9 @@ type GetAdsTimelineResponse = ({
25384
25389
  */
25385
25390
  spend?: number;
25386
25391
  impressions?: number;
25392
+ /**
25393
+ * Reach summed across the account's ads for this single day. A person seen by two ads the same day counts twice, and reach is de-duplicated per day only: do NOT sum it across days (people reached on multiple days would be double-counted).
25394
+ */
25387
25395
  reach?: number;
25388
25396
  clicks?: number;
25389
25397
  engagement?: number;
@@ -27942,6 +27950,12 @@ type CreateStandaloneAdData = {
27942
27950
  /**
27943
27951
  * Pixel ID. **Meta:** Facebook Pixel ID, required for `goal: conversions`.
27944
27952
  * **TikTok:** TikTok Pixel ID, required for `goal: conversions`.
27953
+ * To discover the pixels an ad account can use, call
27954
+ * `GET /v1/accounts/{accountId}/tracking-tags?adAccountId=act_...` (each entry
27955
+ * carries `kind` and `ownerAdAccountId`), or
27956
+ * `GET /v1/accounts/{accountId}/conversion-destinations`. Note this is a
27957
+ * different resource from `GET /v1/ads/{adId}/tracking-tags`, which reads an
27958
+ * ad's click-URL params (`url_tags`), not pixels.
27945
27959
  *
27946
27960
  */
27947
27961
  pixelId?: string;
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: "@zernio/node",
39
- version: "0.2.484",
39
+ version: "0.2.486",
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: "@zernio/node",
8
- version: "0.2.484",
8
+ version: "0.2.486",
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": "@zernio/node",
3
- "version": "0.2.484",
3
+ "version": "0.2.486",
4
4
  "description": "The official Node.js library for the Zernio API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -6908,6 +6908,12 @@ export const updateAdSetStatus = <ThrowOnError extends boolean = false>(options:
6908
6908
  * (`campaign` default, or `adset` / `ad`) to choose which levels carry the series. This replaces
6909
6909
  * calling the tree once per day for per-campaign daily trends.
6910
6910
  *
6911
+ * **Deleted objects stay in the tree.** Deleting an ad or a campaign is a soft delete: the Ad
6912
+ * documents move to `status: cancelled` and are kept indefinitely, so their historical spend
6913
+ * still counts toward the metrics of any date range they fall in. There is no pruning job and
6914
+ * no retention window. Filter on `status` if your view should hide them, but do that after
6915
+ * reading the totals, not before.
6916
+ *
6911
6917
  */
6912
6918
  export const getAdTree = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<GetAdTreeData, ThrowOnError>) => {
6913
6919
  return (options?.client ?? client).get<GetAdTreeResponse, GetAdTreeError, ThrowOnError>({
@@ -7167,6 +7173,11 @@ export const getAdAnalytics = <ThrowOnError extends boolean = false>(options: Op
7167
7173
  * - LinkedIn (linkedinads): the campaign's Dynamic UTM `dynamicValueParameters` + `customValueParameters`.
7168
7174
  * Returns 405 for platforms without a click-URL tracking surface (TikTok, X, Pinterest).
7169
7175
  *
7176
+ * **Not pixels.** Despite the shared path segment, this endpoint has nothing to do with
7177
+ * measurement tags. For an ad account's pixels use
7178
+ * `GET /v1/accounts/{accountId}/tracking-tags?adAccountId=act_...` (Meta Pixels, with `kind`
7179
+ * and `ownerAdAccountId`) or `GET /v1/accounts/{accountId}/conversion-destinations`.
7180
+ *
7170
7181
  */
7171
7182
  export const getAdTrackingTags = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetAdTrackingTagsData, ThrowOnError>) => {
7172
7183
  return (options?.client ?? client).get<GetAdTrackingTagsResponse, GetAdTrackingTagsError, ThrowOnError>({
@@ -478,7 +478,9 @@ export type budgetLevel = 'campaign' | 'adset';
478
478
  * called with `timeIncrement=1`. Rate metrics (ctr/cpc/cpm/costPerConversion/
479
479
  * roas/videoAvgTimeWatchedActions) are recomputed per day from that day's
480
480
  * sums, so summing the additive fields across a node's `daily[]` reproduces
481
- * its aggregated `metrics` total. Do NOT sum or plain-average
481
+ * its aggregated `metrics` total. `reach` is the exception: on Meta the
482
+ * aggregated total is de-duplicated across the range, so daily reach does
483
+ * not sum to it. Do NOT sum or plain-average
482
484
  * `videoAvgTimeWatchedActions` across days: the range value is the
483
485
  * play-weighted average of the daily values.
484
486
  *
@@ -493,6 +495,9 @@ export type AdDailyMetrics = AdMetrics & {
493
495
  export type AdMetrics = {
494
496
  spend?: number;
495
497
  impressions?: number;
498
+ /**
499
+ * Unique people reached in the requested date range. Meta (facebook/instagram): Meta's own de-duplicated reach for the exact range, fetched live and cached up to ~1 hour (may lag recent delivery; on a transient Meta error the value temporarily falls back to a sum of per-day reach, which overcounts people reached on multiple days or by multiple child ads). Because it is de-duplicated, Meta reach is NOT additive: neither daily values nor child nodes sum to the range total. TikTok: sum of per-day reach, so multi-day ranges overcount vs TikTok Ads Manager. Google, LinkedIn, X, Pinterest and OpenAI report 0 (reach not synced). Only derive frequency (impressions / reach) for Meta.
500
+ */
496
501
  reach?: number;
497
502
  clicks?: number;
498
503
  /**
@@ -644,7 +649,7 @@ export type AdTreeAdSet = {
644
649
  page_id?: string;
645
650
  } | null;
646
651
  /**
647
- * Individual ads within this ad set (capped at 100). Returns a subset of Ad fields from the aggregation (core fields like _id, name, platform, status, budget, metrics, creative, goal are included; targeting and schedule may be absent). When `timeIncrement=1&dailyLevel=ad`, each entry also carries a `daily[]` array of `AdDailyMetrics`.
652
+ * Individual ads within this ad set (capped at 100). Returns a subset of Ad fields from the aggregation: `_id`, `name`, `platform`, `status`, `configuredStatus`, `reviewStatus`, `budget`, `metrics`, `creative`, `goal` and the `platform*` ids are always included; `targeting` and `schedule` may be absent. `configuredStatus` (the ad's own on/off toggle) and `reviewStatus` (the platform's review verdict) are part of this contract, not incidental: a rejected ad is only distinguishable from a healthy one through `reviewStatus`. When `timeIncrement=1&dailyLevel=ad`, each entry also carries a `daily[]` array of `AdDailyMetrics`.
648
653
  */
649
654
  ads?: Array<Ad>;
650
655
  /**
@@ -757,7 +762,7 @@ export type AdTreeCampaign = {
757
762
  } | null;
758
763
  adSets?: Array<AdTreeAdSet>;
759
764
  /**
760
- * Per-day metric series for this campaign. Present only when `GET /v1/ads/tree` is called with `timeIncrement=1` (any `dailyLevel`). This is the per-campaign daily trend — summing its additive fields reproduces the campaign `metrics` total.
765
+ * Per-day metric series for this campaign. Present only when `GET /v1/ads/tree` is called with `timeIncrement=1` (any `dailyLevel`). This is the per-campaign daily trend — summing its additive fields reproduces the campaign `metrics` total, except `reach`: on Meta the range total is de-duplicated, so daily reach does not sum to it.
761
766
  */
762
767
  daily?: Array<AdDailyMetrics>;
763
768
  };
@@ -25745,7 +25750,7 @@ export type GetAdTreeData = {
25745
25750
  */
25746
25751
  status?: AdStatus;
25747
25752
  /**
25748
- * Set to `1` to also return a daily breakdown. Mirrors Meta Insights' `time_increment=1`: each node gains a `daily[]` array of per-day metrics (same fields as the aggregated `metrics`) alongside the range total, so you get per-entity daily trends in ONE call instead of calling the tree once per day. Only `1` (daily) is supported. The daily series covers the same date range and uses the same source data as `metrics`. See `dailyLevel` to control which levels carry it.
25753
+ * Set to `1` to also return a daily breakdown. Mirrors Meta Insights' `time_increment=1`: each node gains a `daily[]` array of per-day metrics (same fields as the aggregated `metrics`) alongside the range total, so you get per-entity daily trends in ONE call instead of calling the tree once per day. Only `1` (daily) is supported. The daily series covers the same date range and uses the same source data as `metrics`, except Meta `reach`: the range total is Meta's de-duplicated value, so daily reach does not sum to it. See `dailyLevel` to control which levels carry it.
25749
25754
  */
25750
25755
  timeIncrement?: 1;
25751
25756
  /**
@@ -25801,6 +25806,9 @@ export type GetAdsTimelineResponse = ({
25801
25806
  */
25802
25807
  spend?: number;
25803
25808
  impressions?: number;
25809
+ /**
25810
+ * Reach summed across the account's ads for this single day. A person seen by two ads the same day counts twice, and reach is de-duplicated per day only: do NOT sum it across days (people reached on multiple days would be double-counted).
25811
+ */
25804
25812
  reach?: number;
25805
25813
  clicks?: number;
25806
25814
  engagement?: number;
@@ -28472,6 +28480,12 @@ export type CreateStandaloneAdData = {
28472
28480
  /**
28473
28481
  * Pixel ID. **Meta:** Facebook Pixel ID, required for `goal: conversions`.
28474
28482
  * **TikTok:** TikTok Pixel ID, required for `goal: conversions`.
28483
+ * To discover the pixels an ad account can use, call
28484
+ * `GET /v1/accounts/{accountId}/tracking-tags?adAccountId=act_...` (each entry
28485
+ * carries `kind` and `ownerAdAccountId`), or
28486
+ * `GET /v1/accounts/{accountId}/conversion-destinations`. Note this is a
28487
+ * different resource from `GET /v1/ads/{adId}/tracking-tags`, which reads an
28488
+ * ad's click-URL params (`url_tags`), not pixels.
28475
28489
  *
28476
28490
  */
28477
28491
  pixelId?: string;