@zernio/node 0.2.549 → 0.2.550

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.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.549",
39
+ version: "0.2.550",
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.549",
8
+ version: "0.2.550",
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.549",
3
+ "version": "0.2.550",
4
4
  "description": "The official Node.js library for the Zernio API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -375,6 +375,34 @@ export type goal = 'engagement' | 'traffic' | 'awareness' | 'video_views' | 'lea
375
375
 
376
376
  export type type = 'daily' | 'lifetime';
377
377
 
378
+ export type AdAnalyticsResponse = {
379
+ /**
380
+ * Present and true while historical data is being backfilled.
381
+ */
382
+ backfillPending?: boolean;
383
+ ad?: {
384
+ id?: string;
385
+ name?: string;
386
+ platform?: string;
387
+ status?: string;
388
+ /**
389
+ * ISO 4217 code of the ad account that owns this ad (e.g. USD, THB, INR). All money values in `summary` and `daily` are in this currency. Null only on legacy ads synced before currency was persisted.
390
+ */
391
+ currency?: (string) | null;
392
+ };
393
+ analytics?: {
394
+ summary?: AdMetrics;
395
+ daily?: Array<(AdMetrics & {
396
+ date?: string;
397
+ })>;
398
+ breakdowns?: {
399
+ [key: string]: Array<{
400
+ [key: string]: unknown;
401
+ }>;
402
+ };
403
+ };
404
+ };
405
+
378
406
  /**
379
407
  * Budget amount in the ad account's native currency (see the campaign's `currency` field for the code).
380
408
  */
@@ -757,8 +785,75 @@ export type AdMetrics = {
757
785
  */
758
786
  export type AdReviewStatus = 'in_review' | 'approved' | 'rejected' | 'with_issues';
759
787
 
788
+ export type AdsListResponse = {
789
+ ads?: Array<Ad>;
790
+ pagination?: Pagination;
791
+ /**
792
+ * Present and true while historical data is being backfilled.
793
+ */
794
+ backfillPending?: boolean;
795
+ };
796
+
760
797
  export type AdStatus = 'active' | 'paused' | 'pending_review' | 'rejected' | 'completed' | 'cancelled' | 'error';
761
798
 
799
+ export type AdsTimelineResponse = {
800
+ /**
801
+ * Present and true while historical data is being backfilled.
802
+ */
803
+ backfillPending?: boolean;
804
+ rows?: Array<{
805
+ date?: string;
806
+ /**
807
+ * Native currency units (matches /ads/tree convention).
808
+ */
809
+ spend?: number;
810
+ impressions?: number;
811
+ /**
812
+ * 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).
813
+ */
814
+ reach?: number;
815
+ clicks?: number;
816
+ engagement?: number;
817
+ /**
818
+ * Click-through rate as a percentage (0–100).
819
+ */
820
+ ctr?: number;
821
+ /**
822
+ * Cost per click in native currency.
823
+ */
824
+ cpc?: number;
825
+ /**
826
+ * Cost per 1000 impressions in native currency.
827
+ */
828
+ cpm?: number;
829
+ /**
830
+ * Sum of conversion events over the range. Fractional values are normal (attribution splitting + Google modeled conversions). Meta: events matching the campaign optimization goal. Google: tracked conversions. X / LinkedIn: reported website/lead conversions (added 2026-07).
831
+ */
832
+ conversions?: number;
833
+ costPerConversion?: number;
834
+ /**
835
+ * Per-action-type counts merged across all ads on this day. Keys are platform-native action types.
836
+ */
837
+ actions?: {
838
+ [key: string]: (number);
839
+ };
840
+ /**
841
+ * Monetary mirror of `actions` in native currency.
842
+ */
843
+ actionValues?: {
844
+ [key: string]: (number);
845
+ };
846
+ /**
847
+ * Sum of purchase-type action values on this day, native currency.
848
+ */
849
+ purchaseValue?: number;
850
+ /**
851
+ * Derived purchaseValue / spend.
852
+ */
853
+ roas?: number;
854
+ }>;
855
+ };
856
+
762
857
  /**
763
858
  * Ad set (or ad group/line item depending on platform) with rolled-up metrics and child ads
764
859
  */
@@ -936,6 +1031,15 @@ export type AdTreeCampaign = {
936
1031
  daily?: Array<AdDailyMetrics>;
937
1032
  };
938
1033
 
1034
+ export type AdTreeResponse = {
1035
+ campaigns?: Array<AdTreeCampaign>;
1036
+ pagination?: Pagination;
1037
+ /**
1038
+ * Present and true while historical data is being backfilled.
1039
+ */
1040
+ backfillPending?: boolean;
1041
+ };
1042
+
939
1043
  export type AnalyticsListResponse = {
940
1044
  overview?: AnalyticsOverview;
941
1045
  posts?: Array<{
@@ -1421,6 +1525,37 @@ export type transcriptionLanguage = 'auto' | 'en' | 'es';
1421
1525
 
1422
1526
  export type endReason = 'hangup' | 'no_answer' | 'rejected' | 'error';
1423
1527
 
1528
+ export type CampaignAnalyticsResponse = {
1529
+ /**
1530
+ * Present and true while historical data is being backfilled.
1531
+ */
1532
+ backfillPending?: boolean;
1533
+ campaign?: {
1534
+ id?: string;
1535
+ name?: (string) | null;
1536
+ platform?: string;
1537
+ /**
1538
+ * Effective campaign status (ACTIVE when any child ad is active).
1539
+ */
1540
+ status?: (string) | null;
1541
+ /**
1542
+ * ISO 4217 code of the ad account (e.g. USD, THB). All money values in `summary` and `daily` are in this currency.
1543
+ */
1544
+ currency?: (string) | null;
1545
+ };
1546
+ analytics?: {
1547
+ summary?: AdMetrics;
1548
+ daily?: Array<(AdMetrics & {
1549
+ date?: string;
1550
+ })>;
1551
+ breakdowns?: {
1552
+ [key: string]: Array<{
1553
+ [key: string]: unknown;
1554
+ }>;
1555
+ };
1556
+ };
1557
+ };
1558
+
1424
1559
  /**
1425
1560
  * Who a comment automation answers. Instagram only - Meta exposes the follow
1426
1561
  * relationship on no other platform, and only for people who have MESSAGED the
@@ -26698,14 +26833,9 @@ export type ListAdsData = {
26698
26833
  };
26699
26834
  };
26700
26835
 
26701
- export type ListAdsResponse = ({
26702
- ads?: Array<Ad>;
26703
- /**
26704
- * Present and true only on `202` responses: part of the requested date range is still being backfilled from the platform in the background. Retry the same request shortly; it returns 200 once the range is fully ingested.
26705
- */
26706
- backfillPending?: boolean;
26707
- pagination?: Pagination;
26708
- } | unknown);
26836
+ export type ListAdsResponse = (AdsListResponse | (AdsListResponse & {
26837
+ backfillPending: true;
26838
+ }));
26709
26839
 
26710
26840
  export type ListAdsError = (ErrorResponse | {
26711
26841
  error?: string;
@@ -27539,14 +27669,9 @@ export type GetAdTreeData = {
27539
27669
  };
27540
27670
  };
27541
27671
 
27542
- export type GetAdTreeResponse = ({
27543
- campaigns?: Array<AdTreeCampaign>;
27544
- /**
27545
- * Present and true only on `202` responses: part of the requested date range is still being backfilled from the platform in the background. Retry the same request shortly; it returns 200 once the range is fully ingested.
27546
- */
27547
- backfillPending?: boolean;
27548
- pagination?: Pagination;
27549
- } | unknown);
27672
+ export type GetAdTreeResponse = (AdTreeResponse | (AdTreeResponse & {
27673
+ backfillPending: true;
27674
+ }));
27550
27675
 
27551
27676
  export type GetAdTreeError = ({
27552
27677
  error?: string;
@@ -27577,63 +27702,9 @@ export type GetAdsTimelineData = {
27577
27702
  };
27578
27703
  };
27579
27704
 
27580
- export type GetAdsTimelineResponse = ({
27581
- rows?: Array<{
27582
- date?: string;
27583
- /**
27584
- * Native currency units (matches /ads/tree convention).
27585
- */
27586
- spend?: number;
27587
- impressions?: number;
27588
- /**
27589
- * 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).
27590
- */
27591
- reach?: number;
27592
- clicks?: number;
27593
- engagement?: number;
27594
- /**
27595
- * Click-through rate as a percentage (0–100).
27596
- */
27597
- ctr?: number;
27598
- /**
27599
- * Cost per click in native currency.
27600
- */
27601
- cpc?: number;
27602
- /**
27603
- * Cost per 1000 impressions in native currency.
27604
- */
27605
- cpm?: number;
27606
- /**
27607
- * Sum of conversion events over the range. Fractional values are normal (attribution splitting + Google modeled conversions). Meta: events matching the campaign optimization goal. Google: tracked conversions. X / LinkedIn: reported website/lead conversions (added 2026-07).
27608
- */
27609
- conversions?: number;
27610
- costPerConversion?: number;
27611
- /**
27612
- * Per-action-type counts merged across all ads on this day. Keys are platform-native action types.
27613
- */
27614
- actions?: {
27615
- [key: string]: (number);
27616
- };
27617
- /**
27618
- * Monetary mirror of `actions` in native currency.
27619
- */
27620
- actionValues?: {
27621
- [key: string]: (number);
27622
- };
27623
- /**
27624
- * Sum of purchase-type action values on this day, native currency.
27625
- */
27626
- purchaseValue?: number;
27627
- /**
27628
- * Derived purchaseValue / spend.
27629
- */
27630
- roas?: number;
27631
- }>;
27632
- /**
27633
- * Present and true only on `202` responses: part of the requested date range is still being backfilled from the platform in the background. Retry the same request shortly; it returns 200 once the range is fully ingested.
27634
- */
27635
- backfillPending?: boolean;
27636
- } | unknown);
27705
+ export type GetAdsTimelineResponse = (AdsTimelineResponse | (AdsTimelineResponse & {
27706
+ backfillPending: true;
27707
+ }));
27637
27708
 
27638
27709
  export type GetAdsTimelineError = (ErrorResponse | {
27639
27710
  error?: string;
@@ -27827,36 +27898,9 @@ export type GetCampaignAnalyticsData = {
27827
27898
  };
27828
27899
  };
27829
27900
 
27830
- export type GetCampaignAnalyticsResponse = ({
27831
- campaign?: {
27832
- id?: string;
27833
- name?: (string) | null;
27834
- platform?: string;
27835
- /**
27836
- * Effective campaign status (ACTIVE when any child ad is active).
27837
- */
27838
- status?: (string) | null;
27839
- /**
27840
- * ISO 4217 code of the ad account (e.g. USD, THB). All money values in `summary` and `daily` are in this currency.
27841
- */
27842
- currency?: (string) | null;
27843
- };
27844
- /**
27845
- * Present and true only on `202` responses: part of the requested date range is still being backfilled from the platform in the background. Retry the same request shortly; it returns 200 once the range is fully ingested.
27846
- */
27847
- backfillPending?: boolean;
27848
- analytics?: {
27849
- summary?: AdMetrics;
27850
- daily?: Array<(AdMetrics & {
27851
- date?: string;
27852
- })>;
27853
- breakdowns?: {
27854
- [key: string]: Array<{
27855
- [key: string]: unknown;
27856
- }>;
27857
- };
27858
- };
27859
- } | unknown);
27901
+ export type GetCampaignAnalyticsResponse = (CampaignAnalyticsResponse | (CampaignAnalyticsResponse & {
27902
+ backfillPending: true;
27903
+ }));
27860
27904
 
27861
27905
  export type GetCampaignAnalyticsError = (ErrorResponse | {
27862
27906
  error?: string;
@@ -28280,34 +28324,9 @@ export type GetAdAnalyticsData = {
28280
28324
  };
28281
28325
  };
28282
28326
 
28283
- export type GetAdAnalyticsResponse = ({
28284
- ad?: {
28285
- id?: string;
28286
- name?: string;
28287
- platform?: string;
28288
- trigger?: 'comment' | 'story_reply';
28289
- status?: string;
28290
- /**
28291
- * ISO 4217 code of the ad account that owns this ad (e.g. USD, THB, INR). All money values in `summary` and `daily` are in this currency. Null only on legacy ads synced before currency was persisted.
28292
- */
28293
- currency?: (string) | null;
28294
- };
28295
- /**
28296
- * Present and true only on `202` responses: part of the requested date range is still being backfilled from the platform in the background. Retry the same request shortly; it returns 200 once the range is fully ingested.
28297
- */
28298
- backfillPending?: boolean;
28299
- analytics?: {
28300
- summary?: AdMetrics;
28301
- daily?: Array<(AdMetrics & {
28302
- date?: string;
28303
- })>;
28304
- breakdowns?: {
28305
- [key: string]: Array<{
28306
- [key: string]: unknown;
28307
- }>;
28308
- };
28309
- };
28310
- } | unknown);
28327
+ export type GetAdAnalyticsResponse = (AdAnalyticsResponse | (AdAnalyticsResponse & {
28328
+ backfillPending: true;
28329
+ }));
28311
28330
 
28312
28331
  export type GetAdAnalyticsError = (ErrorResponse | {
28313
28332
  error?: string;