@zernio/node 0.2.132 → 0.2.134

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
@@ -10453,13 +10453,17 @@ type ListInboxCommentsResponse = ({
10453
10453
  */
10454
10454
  subreddit?: (string) | null;
10455
10455
  /**
10456
- * True when this row is an ad (boosted/dark post). `platform` is then the comment platform (facebook or instagram), `id` equals `adId`, and the thread is at GET /v1/ads/{adId}/comments.
10456
+ * True when this row is an ad (boosted/dark post). `platform` is then the placement (facebook = the Page dark post / instagram = the IG media), `id` is `{adId}:{placement}`, and the thread is at GET /v1/ads/{adId}/comments?placement={placement}.
10457
10457
  */
10458
10458
  isAd?: boolean;
10459
10459
  /**
10460
- * Internal Zernio ad id — only on ad rows (same value as `id`).
10460
+ * Internal Zernio ad id — only on ad rows.
10461
10461
  */
10462
10462
  adId?: string;
10463
+ /**
10464
+ * Which side of the ad this row's comments are on — only on ad rows.
10465
+ */
10466
+ placement?: 'facebook' | 'instagram';
10463
10467
  }>;
10464
10468
  pagination?: {
10465
10469
  hasMore?: boolean;
@@ -13819,6 +13823,10 @@ type GetAdCommentsData = {
13819
13823
  */
13820
13824
  cursor?: string;
13821
13825
  limit?: number;
13826
+ /**
13827
+ * Which side of the ad to return comments for. Omit to default to the Instagram side when present, else Facebook. Returns ad_not_commentable if the ad has no such placement.
13828
+ */
13829
+ placement?: 'facebook' | 'instagram';
13822
13830
  };
13823
13831
  };
13824
13832
  type GetAdCommentsResponse = ({
@@ -13831,7 +13839,14 @@ type GetAdCommentsResponse = ({
13831
13839
  cursor?: string;
13832
13840
  };
13833
13841
  meta: {
13842
+ /**
13843
+ * Which side these comments are on (same as `placement`).
13844
+ */
13834
13845
  platform: 'facebook' | 'instagram';
13846
+ /**
13847
+ * The placement these comments are for — useful when you didn't pass ?placement= and want to know which one you got.
13848
+ */
13849
+ placement: 'facebook' | 'instagram';
13835
13850
  /**
13836
13851
  * Internal Zernio ad ID.
13837
13852
  */
@@ -13841,9 +13856,13 @@ type GetAdCommentsResponse = ({
13841
13856
  */
13842
13857
  platformAdId: string;
13843
13858
  /**
13844
- * Underlying post ID the comments belong to. effective_object_story_id for Facebook, effective_instagram_media_id for Instagram.
13859
+ * Underlying post ID the comments belong to. effective_object_story_id for the Facebook side, effective_instagram_media_id for the Instagram side.
13845
13860
  */
13846
13861
  effectiveStoryId: string;
13862
+ /**
13863
+ * Facebook-only. The connected Facebook Page SocialAccount these comments were read through — pass it as `accountId` (with `effectiveStoryId` as the postId) to /v1/inbox/comments to reply/hide/delete. Null when no connected Page was used (then moderation isn't possible).
13864
+ */
13865
+ facebookAccountId?: (string) | null;
13847
13866
  /**
13848
13867
  * Instagram-only. The Instagram-scoped business ID that owns the boosted media (creative.instagram_user_id).
13849
13868
  */
@@ -13853,7 +13872,7 @@ type GetAdCommentsResponse = ({
13853
13872
  */
13854
13873
  instagramPermalink?: string;
13855
13874
  /**
13856
- * Instagram-only. The connected Instagram SocialAccount these comments were read through — use it for reply/hide actions via /v1/inbox/comments.
13875
+ * Instagram-only. The connected Instagram SocialAccount these comments were read through — pass it as `accountId` (with `effectiveStoryId` as the postId) to /v1/inbox/comments to reply/hide/delete.
13857
13876
  */
13858
13877
  instagramAccountId?: string;
13859
13878
  /**
package/dist/index.d.ts CHANGED
@@ -10453,13 +10453,17 @@ type ListInboxCommentsResponse = ({
10453
10453
  */
10454
10454
  subreddit?: (string) | null;
10455
10455
  /**
10456
- * True when this row is an ad (boosted/dark post). `platform` is then the comment platform (facebook or instagram), `id` equals `adId`, and the thread is at GET /v1/ads/{adId}/comments.
10456
+ * True when this row is an ad (boosted/dark post). `platform` is then the placement (facebook = the Page dark post / instagram = the IG media), `id` is `{adId}:{placement}`, and the thread is at GET /v1/ads/{adId}/comments?placement={placement}.
10457
10457
  */
10458
10458
  isAd?: boolean;
10459
10459
  /**
10460
- * Internal Zernio ad id — only on ad rows (same value as `id`).
10460
+ * Internal Zernio ad id — only on ad rows.
10461
10461
  */
10462
10462
  adId?: string;
10463
+ /**
10464
+ * Which side of the ad this row's comments are on — only on ad rows.
10465
+ */
10466
+ placement?: 'facebook' | 'instagram';
10463
10467
  }>;
10464
10468
  pagination?: {
10465
10469
  hasMore?: boolean;
@@ -13819,6 +13823,10 @@ type GetAdCommentsData = {
13819
13823
  */
13820
13824
  cursor?: string;
13821
13825
  limit?: number;
13826
+ /**
13827
+ * Which side of the ad to return comments for. Omit to default to the Instagram side when present, else Facebook. Returns ad_not_commentable if the ad has no such placement.
13828
+ */
13829
+ placement?: 'facebook' | 'instagram';
13822
13830
  };
13823
13831
  };
13824
13832
  type GetAdCommentsResponse = ({
@@ -13831,7 +13839,14 @@ type GetAdCommentsResponse = ({
13831
13839
  cursor?: string;
13832
13840
  };
13833
13841
  meta: {
13842
+ /**
13843
+ * Which side these comments are on (same as `placement`).
13844
+ */
13834
13845
  platform: 'facebook' | 'instagram';
13846
+ /**
13847
+ * The placement these comments are for — useful when you didn't pass ?placement= and want to know which one you got.
13848
+ */
13849
+ placement: 'facebook' | 'instagram';
13835
13850
  /**
13836
13851
  * Internal Zernio ad ID.
13837
13852
  */
@@ -13841,9 +13856,13 @@ type GetAdCommentsResponse = ({
13841
13856
  */
13842
13857
  platformAdId: string;
13843
13858
  /**
13844
- * Underlying post ID the comments belong to. effective_object_story_id for Facebook, effective_instagram_media_id for Instagram.
13859
+ * Underlying post ID the comments belong to. effective_object_story_id for the Facebook side, effective_instagram_media_id for the Instagram side.
13845
13860
  */
13846
13861
  effectiveStoryId: string;
13862
+ /**
13863
+ * Facebook-only. The connected Facebook Page SocialAccount these comments were read through — pass it as `accountId` (with `effectiveStoryId` as the postId) to /v1/inbox/comments to reply/hide/delete. Null when no connected Page was used (then moderation isn't possible).
13864
+ */
13865
+ facebookAccountId?: (string) | null;
13847
13866
  /**
13848
13867
  * Instagram-only. The Instagram-scoped business ID that owns the boosted media (creative.instagram_user_id).
13849
13868
  */
@@ -13853,7 +13872,7 @@ type GetAdCommentsResponse = ({
13853
13872
  */
13854
13873
  instagramPermalink?: string;
13855
13874
  /**
13856
- * Instagram-only. The connected Instagram SocialAccount these comments were read through — use it for reply/hide actions via /v1/inbox/comments.
13875
+ * Instagram-only. The connected Instagram SocialAccount these comments were read through — pass it as `accountId` (with `effectiveStoryId` as the postId) to /v1/inbox/comments to reply/hide/delete.
13857
13876
  */
13858
13877
  instagramAccountId?: string;
13859
13878
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zernio/node",
3
- "version": "0.2.132",
3
+ "version": "0.2.134",
4
4
  "description": "The official Node.js library for the Zernio API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -2082,12 +2082,15 @@ export const deleteTelegramCommands = <ThrowOnError extends boolean = false>(opt
2082
2082
  * Returns posts with comment counts from all connected accounts. Aggregates data across multiple accounts.
2083
2083
  *
2084
2084
  * For users with the Ads add-on (Metronome plans always qualify), the user's Meta ads
2085
- * (boosted/dark posts) are included too, flagged with `isAd: true` and an `adId`. Use
2085
+ * (boosted/dark posts) are included too. There's one row per (ad, placement-with-comments):
2086
+ * an ad that runs on both Facebook feed and Instagram feed produces up to two rows (the
2087
+ * Page dark post and the IG media have separate comment threads), each flagged
2088
+ * `isAd: true` with `adId` and `placement` (`id` is `{adId}:{placement}`). Use
2086
2089
  * `?platform=metaads` to return *only* ad rows; passing `facebook`/`instagram` returns
2087
- * *organic* posts only (no ads); omitting `platform` returns both. Fetch an ad row's
2088
- * thread from GET /v1/ads/{adId}/comments. Ad comment counts are read with the Marketing
2089
- * API token (Facebook) or the connected Instagram account's token (Instagram); an ad
2090
- * whose count can't be read is omitted.
2090
+ * *organic* posts only (no ads); omitting `platform` returns both. Fetch a row's thread
2091
+ * from GET /v1/ads/{adId}/comments?placement={placement}. Ad comment counts are read with
2092
+ * the Marketing API token (Facebook side) or the connected Instagram account's token
2093
+ * (Instagram side); a row whose count can't be read is omitted.
2091
2094
  *
2092
2095
  */
2093
2096
  export const listInboxComments = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<ListInboxCommentsData, ThrowOnError>) => {
@@ -3485,14 +3488,17 @@ export const getAdAnalytics = <ThrowOnError extends boolean = false>(options: Op
3485
3488
  * regular GET /v1/inbox/comments/{postId} endpoint cannot serve because dark posts are
3486
3489
  * not in Zernio's post database.
3487
3490
  *
3488
- * Resolves the ad's creative effective_object_story_id (Facebook) or
3489
- * effective_instagram_media_id (Instagram) via the Marketing API on each call
3490
- * (cached in-process by the platform client), then fetches comments from the Graph API.
3491
- *
3492
- * For Instagram-placed ads, the Instagram account that runs the ad must be connected
3493
- * to Zernio comments are read through that account's token. If none of the connected
3494
- * Instagram accounts on the profile can read the ad's media, the call returns
3495
- * ads_connection_required.
3491
+ * An ad that runs on both Facebook feed and Instagram feed has two separate underlying
3492
+ * posts with separate comment threads (the creative's effective_object_story_id and
3493
+ * effective_instagram_media_id). Use the `placement` query param to pick one; with no
3494
+ * param the Instagram side is returned when it exists, otherwise Facebook. The
3495
+ * identifiers are read from the ad record (persisted during sync) with a Marketing-API
3496
+ * fallback for ads that predate the field.
3497
+ *
3498
+ * For Instagram-placed comments, the Instagram account that runs the ad must be connected
3499
+ * to Zernio — those comments are read through that account's token. If no connected
3500
+ * Instagram account on the profile can read the ad's media, the call returns
3501
+ * ads_connection_required (the Facebook side, if any, is still readable via ?placement=facebook).
3496
3502
  *
3497
3503
  * Meta-only. Other ad platforms (TikTok, LinkedIn, Pinterest, Google, X) do not
3498
3504
  * expose a public per-ad comments API and return feature_not_available.
@@ -10455,13 +10455,17 @@ export type ListInboxCommentsResponse = ({
10455
10455
  */
10456
10456
  subreddit?: (string) | null;
10457
10457
  /**
10458
- * True when this row is an ad (boosted/dark post). `platform` is then the comment platform (facebook or instagram), `id` equals `adId`, and the thread is at GET /v1/ads/{adId}/comments.
10458
+ * True when this row is an ad (boosted/dark post). `platform` is then the placement (facebook = the Page dark post / instagram = the IG media), `id` is `{adId}:{placement}`, and the thread is at GET /v1/ads/{adId}/comments?placement={placement}.
10459
10459
  */
10460
10460
  isAd?: boolean;
10461
10461
  /**
10462
- * Internal Zernio ad id — only on ad rows (same value as `id`).
10462
+ * Internal Zernio ad id — only on ad rows.
10463
10463
  */
10464
10464
  adId?: string;
10465
+ /**
10466
+ * Which side of the ad this row's comments are on — only on ad rows.
10467
+ */
10468
+ placement?: 'facebook' | 'instagram';
10465
10469
  }>;
10466
10470
  pagination?: {
10467
10471
  hasMore?: boolean;
@@ -14138,6 +14142,10 @@ export type GetAdCommentsData = {
14138
14142
  */
14139
14143
  cursor?: string;
14140
14144
  limit?: number;
14145
+ /**
14146
+ * Which side of the ad to return comments for. Omit to default to the Instagram side when present, else Facebook. Returns ad_not_commentable if the ad has no such placement.
14147
+ */
14148
+ placement?: 'facebook' | 'instagram';
14141
14149
  };
14142
14150
  };
14143
14151
 
@@ -14151,7 +14159,14 @@ export type GetAdCommentsResponse = ({
14151
14159
  cursor?: string;
14152
14160
  };
14153
14161
  meta: {
14162
+ /**
14163
+ * Which side these comments are on (same as `placement`).
14164
+ */
14154
14165
  platform: 'facebook' | 'instagram';
14166
+ /**
14167
+ * The placement these comments are for — useful when you didn't pass ?placement= and want to know which one you got.
14168
+ */
14169
+ placement: 'facebook' | 'instagram';
14155
14170
  /**
14156
14171
  * Internal Zernio ad ID.
14157
14172
  */
@@ -14161,9 +14176,13 @@ export type GetAdCommentsResponse = ({
14161
14176
  */
14162
14177
  platformAdId: string;
14163
14178
  /**
14164
- * Underlying post ID the comments belong to. effective_object_story_id for Facebook, effective_instagram_media_id for Instagram.
14179
+ * Underlying post ID the comments belong to. effective_object_story_id for the Facebook side, effective_instagram_media_id for the Instagram side.
14165
14180
  */
14166
14181
  effectiveStoryId: string;
14182
+ /**
14183
+ * Facebook-only. The connected Facebook Page SocialAccount these comments were read through — pass it as `accountId` (with `effectiveStoryId` as the postId) to /v1/inbox/comments to reply/hide/delete. Null when no connected Page was used (then moderation isn't possible).
14184
+ */
14185
+ facebookAccountId?: (string) | null;
14167
14186
  /**
14168
14187
  * Instagram-only. The Instagram-scoped business ID that owns the boosted media (creative.instagram_user_id).
14169
14188
  */
@@ -14173,7 +14192,7 @@ export type GetAdCommentsResponse = ({
14173
14192
  */
14174
14193
  instagramPermalink?: string;
14175
14194
  /**
14176
- * Instagram-only. The connected Instagram SocialAccount these comments were read through — use it for reply/hide actions via /v1/inbox/comments.
14195
+ * Instagram-only. The connected Instagram SocialAccount these comments were read through — pass it as `accountId` (with `effectiveStoryId` as the postId) to /v1/inbox/comments to reply/hide/delete.
14177
14196
  */
14178
14197
  instagramAccountId?: string;
14179
14198
  /**