@zernio/node 0.2.1024 → 0.2.1026

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.1024",
39
+ version: "0.2.1026",
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.1024",
8
+ version: "0.2.1026",
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.1024",
3
+ "version": "0.2.1026",
4
4
  "description": "The official Node.js library for the Zernio API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -11237,7 +11237,7 @@ export type Webhook = {
11237
11237
  /**
11238
11238
  * Events subscribed to
11239
11239
  */
11240
- events?: Array<('post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'post.platform.published' | 'post.platform.failed' | 'post.platform.deleted' | 'post.tiktok.url_resolved' | 'post.external.created' | 'post.external.updated' | 'post.external.deleted' | 'account.connected' | 'account.disconnected' | 'account.ads.initial_sync_completed' | 'account.ads.sync_failed' | 'account.ads.sync_recovered' | 'analytics.synced' | 'message.received' | 'conversation.started' | 'conversation.control_changed' | 'call.received' | 'call.ended' | 'call.failed' | 'call.permission_request' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.failed' | 'reaction.received' | 'referral.received' | 'comment.received' | 'review.new' | 'review.updated' | 'lead.received' | 'ad.status_changed' | 'whatsapp.template.status_updated' | 'whatsapp.template.category_updated' | 'whatsapp.account.name_status_updated' | 'whatsapp.automatic_event' | 'whatsapp.number.activated' | 'whatsapp.number.declined' | 'whatsapp.number.action_required' | 'whatsapp.number.verification_required' | 'whatsapp.number.suspended' | 'whatsapp.number.reactivated' | 'whatsapp.number.released' | 'whatsapp.number.kyc_submitted' | 'phone_number.stock_available' | 'verification.approved' | 'verification.failed' | 'sms.registration.action_required' | 'sms.registration.status_updated' | 'branded_calling.identity.status_updated' | 'branded_calling.identity.action_required' | 'branded_calling.number.status_updated' | 'rcs.agent.status_updated' | 'commerce.product.created' | 'commerce.product.updated' | 'commerce.product.deleted')>;
11240
+ events?: Array<('post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'post.platform.published' | 'post.platform.failed' | 'post.platform.deleted' | 'post.tiktok.url_resolved' | 'post.external.created' | 'post.external.updated' | 'post.external.deleted' | 'account.connected' | 'account.disconnected' | 'account.ads.initial_sync_completed' | 'account.ads.sync_failed' | 'account.ads.sync_recovered' | 'analytics.synced' | 'message.received' | 'conversation.started' | 'conversation.control_changed' | 'call.received' | 'call.ended' | 'call.failed' | 'call.permission_request' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.failed' | 'reaction.received' | 'referral.received' | 'comment.received' | 'review.new' | 'review.updated' | 'lead.received' | 'ad.status_changed' | 'whatsapp.template.status_updated' | 'whatsapp.template.category_updated' | 'whatsapp.account.name_status_updated' | 'whatsapp.contact.identity_changed' | 'whatsapp.automatic_event' | 'whatsapp.number.activated' | 'whatsapp.number.declined' | 'whatsapp.number.action_required' | 'whatsapp.number.verification_required' | 'whatsapp.number.suspended' | 'whatsapp.number.reactivated' | 'whatsapp.number.released' | 'whatsapp.number.kyc_submitted' | 'phone_number.stock_available' | 'verification.approved' | 'verification.failed' | 'sms.registration.action_required' | 'sms.registration.status_updated' | 'branded_calling.identity.status_updated' | 'branded_calling.identity.action_required' | 'branded_calling.number.status_updated' | 'rcs.agent.status_updated' | 'commerce.product.created' | 'commerce.product.updated' | 'commerce.product.deleted')>;
11241
11241
  /**
11242
11242
  * Whether webhook delivery is enabled
11243
11243
  */
@@ -13058,6 +13058,8 @@ export type WebhookPayloadMessageDeliveryStatus = {
13058
13058
  */
13059
13059
  explanation?: (string) | null;
13060
13060
  } | null;
13061
+ pricing?: WhatsAppMessagePricing;
13062
+ billingConversation?: WhatsAppBillingConversation;
13061
13063
  conversation: InboxWebhookConversation;
13062
13064
  account: InboxWebhookAccount;
13063
13065
  /**
@@ -13227,6 +13229,8 @@ export type WebhookPayloadMessageSent = {
13227
13229
  */
13228
13230
  sentVia?: ('human' | 'api' | 'broadcast' | 'sequence' | 'workflow' | 'comment_automation' | 'bulk-api') | null;
13229
13231
  };
13232
+ pricing?: WhatsAppMessagePricing;
13233
+ billingConversation?: WhatsAppBillingConversation;
13230
13234
  conversation: InboxWebhookConversation;
13231
13235
  account: InboxWebhookAccount;
13232
13236
  /**
@@ -13816,6 +13820,58 @@ export type platform16 = 'whatsapp';
13816
13820
  */
13817
13821
  export type status33 = 'APPROVED' | 'DECLINED' | 'PENDING_REVIEW';
13818
13822
 
13823
+ /**
13824
+ * Webhook payload for the `whatsapp.contact.identity_changed` event. Fired when
13825
+ * Meta reports that a WhatsApp user is now known by a different identifier: a
13826
+ * `system` message of type `user_changed_number`, `user_changed_user_id` or
13827
+ * `user_identity_changed`, or a `user_id_update` webhook (BSUID regenerated).
13828
+ * Zernio re-keys the inbox conversation and contact channel before firing.
13829
+ *
13830
+ */
13831
+ export type WebhookPayloadWhatsAppContactIdentityChanged = {
13832
+ /**
13833
+ * Stable webhook event ID: the dedupe key, also sent as the X-Zernio-Event-Id header and identical on every retry and redelivery. It identifies the event only, never an account or other resource.
13834
+ */
13835
+ id: string;
13836
+ event: 'whatsapp.contact.identity_changed';
13837
+ account: {
13838
+ accountId: string;
13839
+ profileId: string;
13840
+ platform: 'whatsapp';
13841
+ username: string;
13842
+ displayName?: (string) | null;
13843
+ };
13844
+ /**
13845
+ * Which Meta signal reported the change. `user_changed_number`: new phone number. `user_changed_user_id` and `user_id_update`: new BSUID.
13846
+ */
13847
+ reason: 'user_changed_number' | 'user_changed_user_id' | 'user_identity_changed' | 'user_id_update';
13848
+ previous: WhatsAppContactIdentity;
13849
+ current: WhatsAppContactIdentity;
13850
+ /**
13851
+ * Zernio contact id matched on the new identity, null when none exists yet.
13852
+ */
13853
+ contactId: (string) | null;
13854
+ /**
13855
+ * Zernio inbox conversation that was re-keyed, null when there was none.
13856
+ */
13857
+ conversationId: (string) | null;
13858
+ /**
13859
+ * When Meta reported the change.
13860
+ */
13861
+ changedAt: string;
13862
+ /**
13863
+ * UTC time at which Zernio generated this event (set once when the event payload is built, before delivery is queued). Retries and redeliveries keep the original value, so it reflects the event, not the delivery attempt.
13864
+ */
13865
+ timestamp: string;
13866
+ };
13867
+
13868
+ export type event32 = 'whatsapp.contact.identity_changed';
13869
+
13870
+ /**
13871
+ * Which Meta signal reported the change. `user_changed_number`: new phone number. `user_changed_user_id` and `user_id_update`: new BSUID.
13872
+ */
13873
+ export type reason = 'user_changed_number' | 'user_changed_user_id' | 'user_identity_changed' | 'user_id_update';
13874
+
13819
13875
  /**
13820
13876
  * Webhook payload for the `whatsapp.template.category_updated` event.
13821
13877
  * Fired when Meta reclassifies a template's category attached to a
@@ -13878,7 +13934,7 @@ export type WebhookPayloadWhatsAppTemplateCategoryUpdated = {
13878
13934
  timestamp: string;
13879
13935
  };
13880
13936
 
13881
- export type event32 = 'whatsapp.template.category_updated';
13937
+ export type event33 = 'whatsapp.template.category_updated';
13882
13938
 
13883
13939
  /**
13884
13940
  * `scheduled` is Meta's 24h advance notice of an upcoming
@@ -13955,7 +14011,7 @@ export type WebhookPayloadWhatsAppTemplateStatusUpdated = {
13955
14011
  timestamp: string;
13956
14012
  };
13957
14013
 
13958
- export type event33 = 'whatsapp.template.status_updated';
14014
+ export type event34 = 'whatsapp.template.status_updated';
13959
14015
 
13960
14016
  /**
13961
14017
  * New status. Forwarded verbatim from Meta's `event` field.
@@ -13965,6 +14021,27 @@ export type event33 = 'whatsapp.template.status_updated';
13965
14021
  */
13966
14022
  export type status34 = 'APPROVED' | 'REJECTED' | 'PENDING' | 'PAUSED' | 'DISABLED' | 'IN_APPEAL' | 'PENDING_DELETION';
13967
14023
 
14024
+ /**
14025
+ * WhatsApp only. Meta's `conversation` object from the status webhook (the billing
14026
+ * window, not the Zernio inbox `conversation`). Same presence rules as `pricing`;
14027
+ * from Graph API v24 Meta sends it only inside an open free entry point window.
14028
+ *
14029
+ */
14030
+ export type WhatsAppBillingConversation = {
14031
+ /**
14032
+ * Meta's conversation id.
14033
+ */
14034
+ id: (string) | null;
14035
+ /**
14036
+ * When the window expires. Meta sends it only on the `sent` status.
14037
+ */
14038
+ expiresAt: (string) | null;
14039
+ /**
14040
+ * Meta `origin.type`, for example `marketing`, `utility`, `service`, `referral_conversion`.
14041
+ */
14042
+ originType: (string) | null;
14043
+ } | null;
14044
+
13968
14045
  export type WhatsAppBodyComponent = {
13969
14046
  type: 'body';
13970
14047
  /**
@@ -14012,6 +14089,25 @@ export type WhatsAppCommerceSettings = {
14012
14089
  isCatalogVisible?: boolean;
14013
14090
  };
14014
14091
 
14092
+ export type WhatsAppContactIdentity = {
14093
+ /**
14094
+ * The user's WhatsApp phone number (wa_id), null when Meta did not send it (a username adopter who hides it).
14095
+ */
14096
+ phoneNumber: (string) | null;
14097
+ /**
14098
+ * Meta business-scoped user id (BSUID), for example `US.13491208655302741918`.
14099
+ */
14100
+ businessScopedUserId: (string) | null;
14101
+ /**
14102
+ * Parent BSUID, shared across the businesses of one portfolio when Meta sends it.
14103
+ */
14104
+ parentBusinessScopedUserId: (string) | null;
14105
+ /**
14106
+ * The user's WhatsApp username, when Meta sent one with the change. Null on `previous`.
14107
+ */
14108
+ whatsappUsername: (string) | null;
14109
+ };
14110
+
14015
14111
  export type WhatsAppFooterComponent = {
14016
14112
  type: 'footer';
14017
14113
  /**
@@ -14065,6 +14161,33 @@ export type WhatsAppLimitedTimeOfferComponent = {
14065
14161
  };
14066
14162
  };
14067
14163
 
14164
+ /**
14165
+ * WhatsApp only. Meta's `pricing` object from the status webhook, camelCased.
14166
+ * Present (possibly null) on every WhatsApp `message.sent`, `message.delivered`,
14167
+ * `message.read` and `message.failed`; absent on other platforms. Meta includes it
14168
+ * on `sent` and on one of `delivered` or `read`, so it is null on the others and
14169
+ * usually on `failed`.
14170
+ *
14171
+ */
14172
+ export type WhatsAppMessagePricing = {
14173
+ /**
14174
+ * Whether Meta bills this message. Meta has announced it will deprecate this field.
14175
+ */
14176
+ billable: (boolean) | null;
14177
+ /**
14178
+ * `PMP` (per-message pricing) or `CBP` (conversation-based, messages before 2025-07-01).
14179
+ */
14180
+ pricingModel: (string) | null;
14181
+ /**
14182
+ * Pricing category as Meta sends it, for example `marketing`, `marketing_lite`, `utility`, `authentication`, `authentication-international`, `service`, `referral_conversion`.
14183
+ */
14184
+ category: (string) | null;
14185
+ /**
14186
+ * `regular` (billable), `free_customer_service` or `free_entry_point`.
14187
+ */
14188
+ type: (string) | null;
14189
+ } | null;
14190
+
14068
14191
  export type WhatsAppNamedParamExample = {
14069
14192
  /**
14070
14193
  * Variable name as it appears in the text, without braces (e.g. customer_name for {{customer_name}}).
@@ -24644,7 +24767,7 @@ export type CreateWebhookSettingsData = {
24644
24767
  /**
24645
24768
  * Events to subscribe to (at least one required)
24646
24769
  */
24647
- events: Array<('post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'post.platform.published' | 'post.platform.failed' | 'post.platform.deleted' | 'post.tiktok.url_resolved' | 'post.external.created' | 'post.external.updated' | 'post.external.deleted' | 'account.connected' | 'account.disconnected' | 'account.ads.initial_sync_completed' | 'account.ads.sync_failed' | 'account.ads.sync_recovered' | 'analytics.synced' | 'message.received' | 'conversation.started' | 'conversation.control_changed' | 'call.received' | 'call.ended' | 'call.failed' | 'call.permission_request' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.failed' | 'reaction.received' | 'referral.received' | 'comment.received' | 'review.new' | 'review.updated' | 'lead.received' | 'ad.status_changed' | 'whatsapp.template.status_updated' | 'whatsapp.template.category_updated' | 'whatsapp.account.name_status_updated' | 'whatsapp.automatic_event' | 'whatsapp.number.activated' | 'whatsapp.number.declined' | 'whatsapp.number.action_required' | 'whatsapp.number.verification_required' | 'whatsapp.number.suspended' | 'whatsapp.number.reactivated' | 'whatsapp.number.released' | 'whatsapp.number.kyc_submitted' | 'phone_number.stock_available' | 'verification.approved' | 'verification.failed' | 'sms.registration.action_required' | 'sms.registration.status_updated' | 'branded_calling.identity.status_updated' | 'branded_calling.identity.action_required' | 'branded_calling.number.status_updated' | 'rcs.agent.status_updated' | 'commerce.product.created' | 'commerce.product.updated' | 'commerce.product.deleted')>;
24770
+ events: Array<('post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'post.platform.published' | 'post.platform.failed' | 'post.platform.deleted' | 'post.tiktok.url_resolved' | 'post.external.created' | 'post.external.updated' | 'post.external.deleted' | 'account.connected' | 'account.disconnected' | 'account.ads.initial_sync_completed' | 'account.ads.sync_failed' | 'account.ads.sync_recovered' | 'analytics.synced' | 'message.received' | 'conversation.started' | 'conversation.control_changed' | 'call.received' | 'call.ended' | 'call.failed' | 'call.permission_request' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.failed' | 'reaction.received' | 'referral.received' | 'comment.received' | 'review.new' | 'review.updated' | 'lead.received' | 'ad.status_changed' | 'whatsapp.template.status_updated' | 'whatsapp.template.category_updated' | 'whatsapp.account.name_status_updated' | 'whatsapp.contact.identity_changed' | 'whatsapp.automatic_event' | 'whatsapp.number.activated' | 'whatsapp.number.declined' | 'whatsapp.number.action_required' | 'whatsapp.number.verification_required' | 'whatsapp.number.suspended' | 'whatsapp.number.reactivated' | 'whatsapp.number.released' | 'whatsapp.number.kyc_submitted' | 'phone_number.stock_available' | 'verification.approved' | 'verification.failed' | 'sms.registration.action_required' | 'sms.registration.status_updated' | 'branded_calling.identity.status_updated' | 'branded_calling.identity.action_required' | 'branded_calling.number.status_updated' | 'rcs.agent.status_updated' | 'commerce.product.created' | 'commerce.product.updated' | 'commerce.product.deleted')>;
24648
24771
  /**
24649
24772
  * Enable or disable webhook delivery. Defaults to `true` when omitted.
24650
24773
  */
@@ -24712,7 +24835,7 @@ export type UpdateWebhookSettingsData = {
24712
24835
  /**
24713
24836
  * Events to subscribe to. Must contain at least one event if provided.
24714
24837
  */
24715
- events?: Array<('post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'post.platform.published' | 'post.platform.failed' | 'post.platform.deleted' | 'post.tiktok.url_resolved' | 'post.external.created' | 'post.external.updated' | 'post.external.deleted' | 'account.connected' | 'account.disconnected' | 'account.ads.initial_sync_completed' | 'account.ads.sync_failed' | 'account.ads.sync_recovered' | 'analytics.synced' | 'message.received' | 'conversation.started' | 'conversation.control_changed' | 'call.received' | 'call.ended' | 'call.failed' | 'call.permission_request' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.failed' | 'reaction.received' | 'referral.received' | 'comment.received' | 'review.new' | 'review.updated' | 'lead.received' | 'ad.status_changed' | 'whatsapp.template.status_updated' | 'whatsapp.template.category_updated' | 'whatsapp.account.name_status_updated' | 'whatsapp.automatic_event' | 'whatsapp.number.activated' | 'whatsapp.number.declined' | 'whatsapp.number.action_required' | 'whatsapp.number.verification_required' | 'whatsapp.number.suspended' | 'whatsapp.number.reactivated' | 'whatsapp.number.released' | 'whatsapp.number.kyc_submitted' | 'phone_number.stock_available' | 'verification.approved' | 'verification.failed' | 'sms.registration.action_required' | 'sms.registration.status_updated' | 'branded_calling.identity.status_updated' | 'branded_calling.identity.action_required' | 'branded_calling.number.status_updated' | 'rcs.agent.status_updated' | 'commerce.product.created' | 'commerce.product.updated' | 'commerce.product.deleted')>;
24838
+ events?: Array<('post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'post.platform.published' | 'post.platform.failed' | 'post.platform.deleted' | 'post.tiktok.url_resolved' | 'post.external.created' | 'post.external.updated' | 'post.external.deleted' | 'account.connected' | 'account.disconnected' | 'account.ads.initial_sync_completed' | 'account.ads.sync_failed' | 'account.ads.sync_recovered' | 'analytics.synced' | 'message.received' | 'conversation.started' | 'conversation.control_changed' | 'call.received' | 'call.ended' | 'call.failed' | 'call.permission_request' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.failed' | 'reaction.received' | 'referral.received' | 'comment.received' | 'review.new' | 'review.updated' | 'lead.received' | 'ad.status_changed' | 'whatsapp.template.status_updated' | 'whatsapp.template.category_updated' | 'whatsapp.account.name_status_updated' | 'whatsapp.contact.identity_changed' | 'whatsapp.automatic_event' | 'whatsapp.number.activated' | 'whatsapp.number.declined' | 'whatsapp.number.action_required' | 'whatsapp.number.verification_required' | 'whatsapp.number.suspended' | 'whatsapp.number.reactivated' | 'whatsapp.number.released' | 'whatsapp.number.kyc_submitted' | 'phone_number.stock_available' | 'verification.approved' | 'verification.failed' | 'sms.registration.action_required' | 'sms.registration.status_updated' | 'branded_calling.identity.status_updated' | 'branded_calling.identity.action_required' | 'branded_calling.number.status_updated' | 'rcs.agent.status_updated' | 'commerce.product.created' | 'commerce.product.updated' | 'commerce.product.deleted')>;
24716
24839
  /**
24717
24840
  * Enable or disable webhook delivery
24718
24841
  */