@zernio/node 0.2.549 → 0.2.551

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.551",
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.551",
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.551",
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
@@ -3947,7 +4082,7 @@ export type LinkedInAggregateAnalyticsTotalResponse = {
3947
4082
  export type aggregation2 = 'TOTAL';
3948
4083
 
3949
4084
  /**
3950
- * Up to 20 images, no multi-video. Single PDF supported (max 100MB). Link previews auto-generated when no media attached. Use organizationUrn for multi-org posting. Geo-restriction only works for organization pages (not personal profiles) and requires the targeted audience to exceed 300 followers.
4085
+ * Up to 20 images, no multi-video. Single PDF supported (max 100MB). Link previews auto-generated when no media attached. Use organizationUrn for multi-org posting. Geo-restriction only works for organization pages (not personal profiles) and requires the targeted audience to exceed 300 followers. Polls are supported via the poll object: 2-4 options, cannot be combined with media or reshareUrl, cannot be edited after publishing, and API-created polls are non-sponsored only.
3951
4086
  *
3952
4087
  */
3953
4088
  export type LinkedInPlatformData = {
@@ -3972,8 +4107,30 @@ export type LinkedInPlatformData = {
3972
4107
  */
3973
4108
  reshareUrl?: string;
3974
4109
  geoRestriction?: GeoRestriction;
4110
+ /**
4111
+ * Create a LinkedIn poll with this post. Cannot be combined with media or reshareUrl. Polls cannot be edited after publishing on LinkedIn, and API-created polls are non-sponsored only (they cannot be promoted as ads).
4112
+ */
4113
+ poll?: {
4114
+ /**
4115
+ * Poll question (max 140 characters)
4116
+ */
4117
+ question: string;
4118
+ /**
4119
+ * Poll options (2-4 choices, max 30 characters each)
4120
+ */
4121
+ options: Array<(string)>;
4122
+ /**
4123
+ * How long the poll accepts votes. Defaults to SEVEN_DAYS.
4124
+ */
4125
+ duration?: 'ONE_DAY' | 'THREE_DAYS' | 'SEVEN_DAYS' | 'FOURTEEN_DAYS';
4126
+ };
3975
4127
  };
3976
4128
 
4129
+ /**
4130
+ * How long the poll accepts votes. Defaults to SEVEN_DAYS.
4131
+ */
4132
+ export type duration = 'ONE_DAY' | 'THREE_DAYS' | 'SEVEN_DAYS' | 'FOURTEEN_DAYS';
4133
+
3977
4134
  /**
3978
4135
  * Media referenced in posts. URLs must be publicly reachable over HTTPS. Use POST /v1/media/presign for uploads up to 5GB. Zernio auto-compresses images and videos that exceed platform limits (videos over 200 MB may not be compressed).
3979
4136
  */
@@ -26698,14 +26855,9 @@ export type ListAdsData = {
26698
26855
  };
26699
26856
  };
26700
26857
 
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);
26858
+ export type ListAdsResponse = (AdsListResponse | (AdsListResponse & {
26859
+ backfillPending: true;
26860
+ }));
26709
26861
 
26710
26862
  export type ListAdsError = (ErrorResponse | {
26711
26863
  error?: string;
@@ -27539,14 +27691,9 @@ export type GetAdTreeData = {
27539
27691
  };
27540
27692
  };
27541
27693
 
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);
27694
+ export type GetAdTreeResponse = (AdTreeResponse | (AdTreeResponse & {
27695
+ backfillPending: true;
27696
+ }));
27550
27697
 
27551
27698
  export type GetAdTreeError = ({
27552
27699
  error?: string;
@@ -27577,63 +27724,9 @@ export type GetAdsTimelineData = {
27577
27724
  };
27578
27725
  };
27579
27726
 
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);
27727
+ export type GetAdsTimelineResponse = (AdsTimelineResponse | (AdsTimelineResponse & {
27728
+ backfillPending: true;
27729
+ }));
27637
27730
 
27638
27731
  export type GetAdsTimelineError = (ErrorResponse | {
27639
27732
  error?: string;
@@ -27827,36 +27920,9 @@ export type GetCampaignAnalyticsData = {
27827
27920
  };
27828
27921
  };
27829
27922
 
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);
27923
+ export type GetCampaignAnalyticsResponse = (CampaignAnalyticsResponse | (CampaignAnalyticsResponse & {
27924
+ backfillPending: true;
27925
+ }));
27860
27926
 
27861
27927
  export type GetCampaignAnalyticsError = (ErrorResponse | {
27862
27928
  error?: string;
@@ -28280,34 +28346,9 @@ export type GetAdAnalyticsData = {
28280
28346
  };
28281
28347
  };
28282
28348
 
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);
28349
+ export type GetAdAnalyticsResponse = (AdAnalyticsResponse | (AdAnalyticsResponse & {
28350
+ backfillPending: true;
28351
+ }));
28311
28352
 
28312
28353
  export type GetAdAnalyticsError = (ErrorResponse | {
28313
28354
  error?: string;