@zernio/node 0.2.51 → 0.2.53

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.
@@ -680,6 +680,95 @@ export type GoogleBusinessPlatformData = {
680
680
  */
681
681
  export type type2 = 'LEARN_MORE' | 'BOOK' | 'ORDER' | 'SHOP' | 'SIGN_UP' | 'CALL';
682
682
 
683
+ /**
684
+ * The `account` context included in inbox webhook payloads.
685
+ */
686
+ export type InboxWebhookAccount = {
687
+ /**
688
+ * Social account ID
689
+ */
690
+ id: string;
691
+ platform: string;
692
+ username: string;
693
+ displayName?: string;
694
+ };
695
+
696
+ /**
697
+ * The `conversation` context included in inbox webhook payloads.
698
+ */
699
+ export type InboxWebhookConversation = {
700
+ id: string;
701
+ platformConversationId: string;
702
+ participantId?: string;
703
+ participantName?: string;
704
+ participantUsername?: string;
705
+ participantPicture?: string;
706
+ status: 'active' | 'archived';
707
+ };
708
+
709
+ export type status3 = 'active' | 'archived';
710
+
711
+ /**
712
+ * The `message` object included in inbox webhook payloads.
713
+ */
714
+ export type InboxWebhookMessage = {
715
+ /**
716
+ * Internal message ID
717
+ */
718
+ id: string;
719
+ /**
720
+ * Internal conversation ID
721
+ */
722
+ conversationId: string;
723
+ platform: 'instagram' | 'facebook' | 'telegram' | 'whatsapp';
724
+ /**
725
+ * Platform's message ID
726
+ */
727
+ platformMessageId: string;
728
+ direction: 'incoming' | 'outgoing';
729
+ /**
730
+ * Message text content (retained on deleted messages for API consumers; Zernio dashboard UI hides this)
731
+ */
732
+ text: (string) | null;
733
+ attachments: Array<{
734
+ /**
735
+ * Attachment type (image, video, file, sticker, audio)
736
+ */
737
+ type: string;
738
+ /**
739
+ * Attachment URL (may expire for Meta platforms)
740
+ */
741
+ url: string;
742
+ /**
743
+ * Additional attachment metadata
744
+ */
745
+ payload?: {
746
+ [key: string]: unknown;
747
+ };
748
+ }>;
749
+ sender: {
750
+ id: string;
751
+ name?: string;
752
+ username?: string;
753
+ picture?: string;
754
+ /**
755
+ * Instagram profile data. Only present for Instagram conversations.
756
+ */
757
+ instagramProfile?: {
758
+ isFollower?: (boolean) | null;
759
+ isFollowing?: (boolean) | null;
760
+ followerCount?: (number) | null;
761
+ isVerified?: (boolean) | null;
762
+ };
763
+ };
764
+ sentAt: string;
765
+ isRead: boolean;
766
+ };
767
+
768
+ export type platform3 = 'instagram' | 'facebook' | 'telegram' | 'whatsapp';
769
+
770
+ export type direction = 'incoming' | 'outgoing';
771
+
683
772
  export type InstagramAccountInsightsResponse = {
684
773
  success?: boolean;
685
774
  /**
@@ -1065,7 +1154,7 @@ export type PlatformAnalytics = {
1065
1154
  errorMessage?: (string) | null;
1066
1155
  };
1067
1156
 
1068
- export type status3 = 'published' | 'failed';
1157
+ export type status4 = 'published' | 'failed';
1069
1158
 
1070
1159
  /**
1071
1160
  * Sync state of analytics for this platform
@@ -1175,7 +1264,7 @@ export type Post = {
1175
1264
  updatedAt?: string;
1176
1265
  };
1177
1266
 
1178
- export type status4 = 'draft' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'partial';
1267
+ export type status5 = 'draft' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'partial';
1179
1268
 
1180
1269
  export type visibility = 'public' | 'private' | 'unlisted';
1181
1270
 
@@ -1291,7 +1380,7 @@ export type PostLog = {
1291
1380
  */
1292
1381
  export type action = 'publish' | 'retry' | 'media_upload' | 'rate_limit_pause' | 'token_refresh' | 'cancelled';
1293
1382
 
1294
- export type status5 = 'success' | 'failed' | 'pending' | 'skipped';
1383
+ export type status6 = 'success' | 'failed' | 'pending' | 'skipped';
1295
1384
 
1296
1385
  export type PostRetryResponse = {
1297
1386
  message?: string;
@@ -1662,7 +1751,7 @@ export type SocialAccount = {
1662
1751
  };
1663
1752
  };
1664
1753
 
1665
- export type platform3 = 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat' | 'whatsapp' | 'linkedinads' | 'metaads' | 'pinterestads' | 'tiktokads' | 'xads' | 'googleads';
1754
+ export type platform4 = 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat' | 'whatsapp' | 'linkedinads' | 'metaads' | 'pinterestads' | 'tiktokads' | 'xads' | 'googleads';
1666
1755
 
1667
1756
  /**
1668
1757
  * **Deprecated.** With the new ads account model, ads accounts are separate SocialAccount
@@ -1885,7 +1974,7 @@ export type UploadTokenResponse = {
1885
1974
  status?: 'pending' | 'completed' | 'expired';
1886
1975
  };
1887
1976
 
1888
- export type status6 = 'pending' | 'completed' | 'expired';
1977
+ export type status7 = 'pending' | 'completed' | 'expired';
1889
1978
 
1890
1979
  export type UploadTokenStatusResponse = {
1891
1980
  token?: string;
@@ -1956,7 +2045,7 @@ export type Webhook = {
1956
2045
  /**
1957
2046
  * Events subscribed to
1958
2047
  */
1959
- events?: Array<('post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'account.connected' | 'account.disconnected' | 'message.received' | 'message.sent' | 'comment.received')>;
2048
+ events?: Array<('post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'account.connected' | 'account.disconnected' | 'message.received' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.failed' | 'comment.received')>;
1960
2049
  /**
1961
2050
  * Whether webhook delivery is enabled
1962
2051
  */
@@ -1990,7 +2079,7 @@ export type WebhookLog = {
1990
2079
  * Name of the webhook that was triggered
1991
2080
  */
1992
2081
  webhookName?: string;
1993
- event?: 'post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'account.connected' | 'account.disconnected' | 'message.received' | 'message.sent' | 'comment.received' | 'webhook.test';
2082
+ event?: 'post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'account.connected' | 'account.disconnected' | 'message.received' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.failed' | 'comment.received' | 'webhook.test';
1994
2083
  url?: string;
1995
2084
  status?: 'success' | 'failed';
1996
2085
  /**
@@ -2022,9 +2111,9 @@ export type WebhookLog = {
2022
2111
  createdAt?: string;
2023
2112
  };
2024
2113
 
2025
- export type event = 'post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'account.connected' | 'account.disconnected' | 'message.received' | 'message.sent' | 'comment.received' | 'webhook.test';
2114
+ export type event = 'post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'account.connected' | 'account.disconnected' | 'message.received' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.failed' | 'comment.received' | 'webhook.test';
2026
2115
 
2027
- export type status7 = 'success' | 'failed';
2116
+ export type status8 = 'success' | 'failed';
2028
2117
 
2029
2118
  /**
2030
2119
  * Webhook payload for account connected events
@@ -2162,7 +2251,7 @@ export type WebhookPayloadComment = {
2162
2251
 
2163
2252
  export type event4 = 'comment.received';
2164
2253
 
2165
- export type platform4 = 'instagram' | 'facebook' | 'twitter' | 'youtube' | 'linkedin' | 'bluesky' | 'reddit';
2254
+ export type platform5 = 'instagram' | 'facebook' | 'twitter' | 'youtube' | 'linkedin' | 'bluesky' | 'reddit';
2166
2255
 
2167
2256
  /**
2168
2257
  * Webhook payload for message received events
@@ -2282,11 +2371,106 @@ export type WebhookPayloadMessage = {
2282
2371
 
2283
2372
  export type event5 = 'message.received';
2284
2373
 
2285
- export type platform5 = 'instagram' | 'facebook' | 'telegram' | 'whatsapp';
2374
+ /**
2375
+ * Webhook payload for `message.deleted` events. Fires when the sender
2376
+ * deletes (unsends) a message. Supported platforms: Instagram (incoming
2377
+ * unsend) and WhatsApp (when the business deletes an outgoing message
2378
+ * via the Cloud API).
2379
+ *
2380
+ * The `message.text` and `message.attachments` fields retain the content
2381
+ * that existed before the delete. The Zernio dashboard UI does not show
2382
+ * this content, but authorized API consumers may access it for
2383
+ * moderation, compliance, or archival use cases.
2384
+ *
2385
+ */
2386
+ export type WebhookPayloadMessageDeleted = {
2387
+ id: string;
2388
+ event: 'message.deleted';
2389
+ message: InboxWebhookMessage;
2390
+ deletedAt: string;
2391
+ conversation: InboxWebhookConversation;
2392
+ account: InboxWebhookAccount;
2393
+ timestamp: string;
2394
+ };
2286
2395
 
2287
- export type direction = 'incoming' | 'outgoing';
2396
+ export type event6 = 'message.deleted';
2288
2397
 
2289
- export type status8 = 'active' | 'archived';
2398
+ /**
2399
+ * Shared payload for `message.delivered`, `message.read`, and
2400
+ * `message.failed` events. Fires when the platform reports a new
2401
+ * delivery state for an outgoing message.
2402
+ *
2403
+ * Platform support:
2404
+ * * `message.delivered` — WhatsApp, Facebook Messenger.
2405
+ * * `message.read` — WhatsApp, Facebook Messenger, Instagram.
2406
+ * * `message.failed` — WhatsApp only (other platforms don't expose
2407
+ * per-message failure via webhook).
2408
+ *
2409
+ */
2410
+ export type WebhookPayloadMessageDeliveryStatus = {
2411
+ id: string;
2412
+ event: 'message.delivered' | 'message.read' | 'message.failed';
2413
+ message: InboxWebhookMessage;
2414
+ /**
2415
+ * When the platform reported this status.
2416
+ */
2417
+ statusAt: string;
2418
+ /**
2419
+ * Populated only on `message.failed`.
2420
+ */
2421
+ error?: {
2422
+ code?: number;
2423
+ title?: string;
2424
+ message?: string;
2425
+ } | null;
2426
+ conversation: InboxWebhookConversation;
2427
+ account: InboxWebhookAccount;
2428
+ timestamp: string;
2429
+ };
2430
+
2431
+ export type event7 = 'message.delivered' | 'message.read' | 'message.failed';
2432
+
2433
+ /**
2434
+ * Webhook payload for `message.edited` events. Fires when the sender
2435
+ * edits a previously-sent message. Supported platforms: Instagram,
2436
+ * Facebook Messenger, Telegram. The `message` object reflects the
2437
+ * LATEST state; `editHistory` contains every prior version in order
2438
+ * (oldest first), so the last entry is the version immediately before
2439
+ * the current content.
2440
+ *
2441
+ */
2442
+ export type WebhookPayloadMessageEdited = {
2443
+ id: string;
2444
+ event: 'message.edited';
2445
+ message: InboxWebhookMessage;
2446
+ /**
2447
+ * Prior versions of the message, oldest first.
2448
+ */
2449
+ editHistory: Array<{
2450
+ text: (string) | null;
2451
+ attachments: Array<{
2452
+ type?: string;
2453
+ url?: string;
2454
+ payload?: {
2455
+ [key: string]: unknown;
2456
+ };
2457
+ }>;
2458
+ editedAt: string;
2459
+ }>;
2460
+ /**
2461
+ * Total number of edits applied to this message.
2462
+ */
2463
+ editCount: number;
2464
+ /**
2465
+ * When the most recent edit happened.
2466
+ */
2467
+ editedAt: string;
2468
+ conversation: InboxWebhookConversation;
2469
+ account: InboxWebhookAccount;
2470
+ timestamp: string;
2471
+ };
2472
+
2473
+ export type event8 = 'message.edited';
2290
2474
 
2291
2475
  /**
2292
2476
  * Webhook payload for message sent events (fired when a message is sent via the API)
@@ -2362,7 +2546,7 @@ export type WebhookPayloadMessageSent = {
2362
2546
  timestamp: string;
2363
2547
  };
2364
2548
 
2365
- export type event6 = 'message.sent';
2549
+ export type event9 = 'message.sent';
2366
2550
 
2367
2551
  /**
2368
2552
  * Webhook payload for post events
@@ -2390,7 +2574,7 @@ export type WebhookPayloadPost = {
2390
2574
  timestamp: string;
2391
2575
  };
2392
2576
 
2393
- export type event7 = 'post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled';
2577
+ export type event10 = 'post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled';
2394
2578
 
2395
2579
  /**
2396
2580
  * Webhook payload for test deliveries
@@ -2408,7 +2592,7 @@ export type WebhookPayloadTest = {
2408
2592
  timestamp: string;
2409
2593
  };
2410
2594
 
2411
- export type event8 = 'webhook.test';
2595
+ export type event11 = 'webhook.test';
2412
2596
 
2413
2597
  export type WhatsAppBodyComponent = {
2414
2598
  type: 'body';
@@ -4588,7 +4772,7 @@ export type SelectFacebookPageData = {
4588
4772
  /**
4589
4773
  * Decoded user profile object from the OAuth callback
4590
4774
  */
4591
- userProfile?: {
4775
+ userProfile: {
4592
4776
  id?: string;
4593
4777
  name?: string;
4594
4778
  profilePicture?: string;
@@ -6884,7 +7068,7 @@ export type GetWebhookLogsData = {
6884
7068
  /**
6885
7069
  * Filter by event type
6886
7070
  */
6887
- event?: 'post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'account.connected' | 'account.disconnected' | 'message.received' | 'message.sent' | 'comment.received' | 'webhook.test';
7071
+ event?: 'post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'account.connected' | 'account.disconnected' | 'message.received' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.failed' | 'comment.received' | 'webhook.test';
6888
7072
  /**
6889
7073
  * Maximum number of logs to return (max 100)
6890
7074
  */
@@ -7361,6 +7545,55 @@ export type GetInboxConversationMessagesResponse = ({
7361
7545
  * Instagram story mention
7362
7546
  */
7363
7547
  isStoryMention?: (boolean) | null;
7548
+ /**
7549
+ * True if the sender has edited this message at least once.
7550
+ */
7551
+ isEdited?: boolean;
7552
+ /**
7553
+ * When the most recent edit happened.
7554
+ */
7555
+ editedAt?: (string) | null;
7556
+ /**
7557
+ * Total number of edits applied.
7558
+ */
7559
+ editCount?: number;
7560
+ /**
7561
+ * Every prior version of the message, oldest first.
7562
+ */
7563
+ editHistory?: Array<{
7564
+ text?: (string) | null;
7565
+ attachments?: Array<{
7566
+ type?: string;
7567
+ url?: string;
7568
+ payload?: {
7569
+ [key: string]: unknown;
7570
+ };
7571
+ }>;
7572
+ editedAt?: string;
7573
+ }>;
7574
+ /**
7575
+ * True if the sender has deleted (unsent) this message. The original `message` and `attachments` fields remain populated.
7576
+ */
7577
+ isDeleted?: boolean;
7578
+ deletedAt?: (string) | null;
7579
+ /**
7580
+ * Lifecycle status for outgoing messages. Not all platforms emit every state (see webhook support matrix).
7581
+ */
7582
+ deliveryStatus?: ('sent' | 'delivered' | 'read' | 'failed' | 'deleted') | null;
7583
+ deliveredAt?: (string) | null;
7584
+ readAt?: (string) | null;
7585
+ /**
7586
+ * Original send time for outgoing messages (used for Messenger watermark queries).
7587
+ */
7588
+ sentAt?: (string) | null;
7589
+ /**
7590
+ * Populated when `deliveryStatus === "failed"`.
7591
+ */
7592
+ deliveryError?: {
7593
+ code?: number;
7594
+ title?: string;
7595
+ message?: string;
7596
+ } | null;
7364
7597
  }>;
7365
7598
  lastUpdated?: string;
7366
7599
  });