@zernio/node 0.2.95 → 0.2.96

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
@@ -3496,6 +3496,29 @@ type WebhookPayloadMessage = {
3496
3496
  flowResponseData?: {
3497
3497
  [key: string]: unknown;
3498
3498
  };
3499
+ /**
3500
+ * WhatsApp only. Click-to-WhatsApp (CTWA) ad attribution. Present
3501
+ * only on the FIRST inbound message after a user reaches the
3502
+ * business via a CTWA ad. Forwarded verbatim from Meta's referral
3503
+ * envelope so it can be replayed to the Conversions API for
3504
+ * Business Messaging. Attribution window is 7 days from click.
3505
+ *
3506
+ */
3507
+ referral?: {
3508
+ /**
3509
+ * Meta's GCLID-equivalent click identifier.
3510
+ */
3511
+ ctwa_clid?: string;
3512
+ source_id?: string;
3513
+ source_type?: string;
3514
+ source_url?: string;
3515
+ headline?: string;
3516
+ body?: string;
3517
+ media_type?: string;
3518
+ image_url?: string;
3519
+ video_url?: string;
3520
+ thumbnail_url?: string;
3521
+ };
3499
3522
  } | null;
3500
3523
  timestamp: string;
3501
3524
  };
@@ -8611,10 +8634,43 @@ type GetInboxConversationMessagesData = {
8611
8634
  * Social account ID
8612
8635
  */
8613
8636
  accountId: string;
8637
+ /**
8638
+ * Opaque pagination cursor. Pass `pagination.nextCursor` from a prior response.
8639
+ */
8640
+ cursor?: string;
8641
+ /**
8642
+ * Number of messages to return per page. Default 100, max 100.
8643
+ */
8644
+ limit?: number;
8645
+ /**
8646
+ * Order of returned messages. Default `asc` (oldest first, chat style).
8647
+ * For Twitter, Facebook and Bluesky, only intra-page ordering is
8648
+ * affected — pages always walk newest→oldest. See `sortOrderApplied`
8649
+ * in the response.
8650
+ *
8651
+ */
8652
+ sortOrder?: 'asc' | 'desc';
8614
8653
  };
8615
8654
  };
8616
8655
  type GetInboxConversationMessagesResponse = ({
8617
8656
  status?: string;
8657
+ pagination?: {
8658
+ /**
8659
+ * Whether more messages are available beyond this page.
8660
+ */
8661
+ hasMore?: boolean;
8662
+ /**
8663
+ * Opaque cursor to fetch the next page. `null` on the last page.
8664
+ */
8665
+ nextCursor?: (string) | null;
8666
+ };
8667
+ /**
8668
+ * Sort order actually applied to the returned page. May
8669
+ * differ from the requested `sortOrder` for Twitter,
8670
+ * Facebook and Bluesky (always `desc` regardless of request).
8671
+ *
8672
+ */
8673
+ sortOrderApplied?: 'asc' | 'desc';
8618
8674
  messages?: Array<{
8619
8675
  id?: string;
8620
8676
  conversationId?: string;
package/dist/index.d.ts CHANGED
@@ -3496,6 +3496,29 @@ type WebhookPayloadMessage = {
3496
3496
  flowResponseData?: {
3497
3497
  [key: string]: unknown;
3498
3498
  };
3499
+ /**
3500
+ * WhatsApp only. Click-to-WhatsApp (CTWA) ad attribution. Present
3501
+ * only on the FIRST inbound message after a user reaches the
3502
+ * business via a CTWA ad. Forwarded verbatim from Meta's referral
3503
+ * envelope so it can be replayed to the Conversions API for
3504
+ * Business Messaging. Attribution window is 7 days from click.
3505
+ *
3506
+ */
3507
+ referral?: {
3508
+ /**
3509
+ * Meta's GCLID-equivalent click identifier.
3510
+ */
3511
+ ctwa_clid?: string;
3512
+ source_id?: string;
3513
+ source_type?: string;
3514
+ source_url?: string;
3515
+ headline?: string;
3516
+ body?: string;
3517
+ media_type?: string;
3518
+ image_url?: string;
3519
+ video_url?: string;
3520
+ thumbnail_url?: string;
3521
+ };
3499
3522
  } | null;
3500
3523
  timestamp: string;
3501
3524
  };
@@ -8611,10 +8634,43 @@ type GetInboxConversationMessagesData = {
8611
8634
  * Social account ID
8612
8635
  */
8613
8636
  accountId: string;
8637
+ /**
8638
+ * Opaque pagination cursor. Pass `pagination.nextCursor` from a prior response.
8639
+ */
8640
+ cursor?: string;
8641
+ /**
8642
+ * Number of messages to return per page. Default 100, max 100.
8643
+ */
8644
+ limit?: number;
8645
+ /**
8646
+ * Order of returned messages. Default `asc` (oldest first, chat style).
8647
+ * For Twitter, Facebook and Bluesky, only intra-page ordering is
8648
+ * affected — pages always walk newest→oldest. See `sortOrderApplied`
8649
+ * in the response.
8650
+ *
8651
+ */
8652
+ sortOrder?: 'asc' | 'desc';
8614
8653
  };
8615
8654
  };
8616
8655
  type GetInboxConversationMessagesResponse = ({
8617
8656
  status?: string;
8657
+ pagination?: {
8658
+ /**
8659
+ * Whether more messages are available beyond this page.
8660
+ */
8661
+ hasMore?: boolean;
8662
+ /**
8663
+ * Opaque cursor to fetch the next page. `null` on the last page.
8664
+ */
8665
+ nextCursor?: (string) | null;
8666
+ };
8667
+ /**
8668
+ * Sort order actually applied to the returned page. May
8669
+ * differ from the requested `sortOrder` for Twitter,
8670
+ * Facebook and Bluesky (always `desc` regardless of request).
8671
+ *
8672
+ */
8673
+ sortOrderApplied?: 'asc' | 'desc';
8618
8674
  messages?: Array<{
8619
8675
  id?: string;
8620
8676
  conversationId?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zernio/node",
3
- "version": "0.2.95",
3
+ "version": "0.2.96",
4
4
  "description": "The official Node.js library for the Zernio API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -1710,7 +1710,25 @@ export const updateInboxConversation = <ThrowOnError extends boolean = false>(op
1710
1710
 
1711
1711
  /**
1712
1712
  * List messages
1713
- * Fetch messages for a specific conversation. Requires accountId query parameter.
1713
+ * Fetch messages for a specific conversation, with cursor-based pagination
1714
+ * and ordering control.
1715
+ *
1716
+ * Pagination: pass `pagination.nextCursor` from a prior response back as
1717
+ * the `cursor` query param to fetch the next page. The cursor is opaque;
1718
+ * do not parse or construct it client-side.
1719
+ *
1720
+ * Sort order: defaults to `asc` (oldest first, chat style). For the
1721
+ * "show me the latest messages" pattern, pass `?sortOrder=desc&limit=N`.
1722
+ * For Twitter, Facebook and Bluesky, the upstream APIs only return
1723
+ * newest-first and have no order parameter — sort order is best-effort
1724
+ * and only reverses items within a single page (pages still walk
1725
+ * newest→oldest). The response field `sortOrderApplied` tells you what
1726
+ * was actually applied.
1727
+ *
1728
+ * Reddit threads are paginated client-side because Reddit's API has no
1729
+ * per-thread cursor. Very long threads may be upstream-truncated by
1730
+ * Reddit's inbox/sent windows (~100 most-recent items each); this is a
1731
+ * Reddit platform limitation.
1714
1732
  *
1715
1733
  * Twitter/X limitation: X's encrypted "X Chat" messages are not accessible via the API. Conversations where the other participant uses encrypted X Chat may only show your outgoing messages. See the list conversations endpoint for more details.
1716
1734
  *
@@ -3034,6 +3034,29 @@ export type WebhookPayloadMessage = {
3034
3034
  flowResponseData?: {
3035
3035
  [key: string]: unknown;
3036
3036
  };
3037
+ /**
3038
+ * WhatsApp only. Click-to-WhatsApp (CTWA) ad attribution. Present
3039
+ * only on the FIRST inbound message after a user reaches the
3040
+ * business via a CTWA ad. Forwarded verbatim from Meta's referral
3041
+ * envelope so it can be replayed to the Conversions API for
3042
+ * Business Messaging. Attribution window is 7 days from click.
3043
+ *
3044
+ */
3045
+ referral?: {
3046
+ /**
3047
+ * Meta's GCLID-equivalent click identifier.
3048
+ */
3049
+ ctwa_clid?: string;
3050
+ source_id?: string;
3051
+ source_type?: string;
3052
+ source_url?: string;
3053
+ headline?: string;
3054
+ body?: string;
3055
+ media_type?: string;
3056
+ image_url?: string;
3057
+ video_url?: string;
3058
+ thumbnail_url?: string;
3059
+ };
3037
3060
  } | null;
3038
3061
  timestamp: string;
3039
3062
  };
@@ -8563,11 +8586,44 @@ export type GetInboxConversationMessagesData = {
8563
8586
  * Social account ID
8564
8587
  */
8565
8588
  accountId: string;
8589
+ /**
8590
+ * Opaque pagination cursor. Pass `pagination.nextCursor` from a prior response.
8591
+ */
8592
+ cursor?: string;
8593
+ /**
8594
+ * Number of messages to return per page. Default 100, max 100.
8595
+ */
8596
+ limit?: number;
8597
+ /**
8598
+ * Order of returned messages. Default `asc` (oldest first, chat style).
8599
+ * For Twitter, Facebook and Bluesky, only intra-page ordering is
8600
+ * affected — pages always walk newest→oldest. See `sortOrderApplied`
8601
+ * in the response.
8602
+ *
8603
+ */
8604
+ sortOrder?: 'asc' | 'desc';
8566
8605
  };
8567
8606
  };
8568
8607
 
8569
8608
  export type GetInboxConversationMessagesResponse = ({
8570
8609
  status?: string;
8610
+ pagination?: {
8611
+ /**
8612
+ * Whether more messages are available beyond this page.
8613
+ */
8614
+ hasMore?: boolean;
8615
+ /**
8616
+ * Opaque cursor to fetch the next page. `null` on the last page.
8617
+ */
8618
+ nextCursor?: (string) | null;
8619
+ };
8620
+ /**
8621
+ * Sort order actually applied to the returned page. May
8622
+ * differ from the requested `sortOrder` for Twitter,
8623
+ * Facebook and Bluesky (always `desc` regardless of request).
8624
+ *
8625
+ */
8626
+ sortOrderApplied?: 'asc' | 'desc';
8571
8627
  messages?: Array<{
8572
8628
  id?: string;
8573
8629
  conversationId?: string;