@zernio/node 0.2.154 → 0.2.156

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
@@ -13130,6 +13130,38 @@ type GetBroadcastError = ({
13130
13130
  error?: string;
13131
13131
  });
13132
13132
  type UpdateBroadcastData = {
13133
+ body?: {
13134
+ name?: string;
13135
+ description?: string;
13136
+ /**
13137
+ * Generic message payload (used for non-WhatsApp platforms).
13138
+ */
13139
+ message?: {
13140
+ text?: string;
13141
+ };
13142
+ /**
13143
+ * WhatsApp template payload (used when platform is `whatsapp`).
13144
+ */
13145
+ template?: {
13146
+ name?: string;
13147
+ language?: string;
13148
+ /**
13149
+ * Maps template variable positions to contact fields. Keys are position strings ("1", "2"); values are { field, customValue }.
13150
+ */
13151
+ variableMapping?: {
13152
+ [key: string]: {
13153
+ field?: 'name' | 'phone' | 'email' | 'company' | 'custom';
13154
+ customValue?: string;
13155
+ };
13156
+ };
13157
+ };
13158
+ /**
13159
+ * Recipient segment filters (tags, channels, subscription state).
13160
+ */
13161
+ segmentFilters?: {
13162
+ [key: string]: unknown;
13163
+ };
13164
+ };
13133
13165
  path: {
13134
13166
  broadcastId: string;
13135
13167
  };
@@ -13238,6 +13270,10 @@ type ListBroadcastRecipientsResponse = ({
13238
13270
  status?: 'pending' | 'sent' | 'delivered' | 'read' | 'failed';
13239
13271
  messageId?: string;
13240
13272
  error?: string;
13273
+ /**
13274
+ * Meta WhatsApp error code (e.g. 131049 for antispam, 131021 for invalid phone, 131026 for re-engagement required). Only populated for status=failed.
13275
+ */
13276
+ errorCode?: (number) | null;
13241
13277
  sentAt?: string;
13242
13278
  deliveredAt?: string;
13243
13279
  readAt?: string;
@@ -13421,6 +13457,32 @@ type GetSequenceError = ({
13421
13457
  error?: string;
13422
13458
  });
13423
13459
  type UpdateSequenceData = {
13460
+ body?: {
13461
+ name?: string;
13462
+ description?: string;
13463
+ /**
13464
+ * Replace the full step list. Only allowed while the sequence is draft or paused.
13465
+ */
13466
+ steps?: Array<{
13467
+ order: number;
13468
+ delayMinutes: number;
13469
+ message?: {
13470
+ text?: string;
13471
+ };
13472
+ template?: {
13473
+ name?: string;
13474
+ language?: string;
13475
+ variableMapping?: {
13476
+ [key: string]: {
13477
+ field?: 'name' | 'phone' | 'email' | 'company' | 'custom';
13478
+ customValue?: string;
13479
+ };
13480
+ };
13481
+ };
13482
+ }>;
13483
+ exitOnReply?: boolean;
13484
+ exitOnUnsubscribe?: boolean;
13485
+ };
13424
13486
  path: {
13425
13487
  sequenceId: string;
13426
13488
  };
package/dist/index.d.ts CHANGED
@@ -13130,6 +13130,38 @@ type GetBroadcastError = ({
13130
13130
  error?: string;
13131
13131
  });
13132
13132
  type UpdateBroadcastData = {
13133
+ body?: {
13134
+ name?: string;
13135
+ description?: string;
13136
+ /**
13137
+ * Generic message payload (used for non-WhatsApp platforms).
13138
+ */
13139
+ message?: {
13140
+ text?: string;
13141
+ };
13142
+ /**
13143
+ * WhatsApp template payload (used when platform is `whatsapp`).
13144
+ */
13145
+ template?: {
13146
+ name?: string;
13147
+ language?: string;
13148
+ /**
13149
+ * Maps template variable positions to contact fields. Keys are position strings ("1", "2"); values are { field, customValue }.
13150
+ */
13151
+ variableMapping?: {
13152
+ [key: string]: {
13153
+ field?: 'name' | 'phone' | 'email' | 'company' | 'custom';
13154
+ customValue?: string;
13155
+ };
13156
+ };
13157
+ };
13158
+ /**
13159
+ * Recipient segment filters (tags, channels, subscription state).
13160
+ */
13161
+ segmentFilters?: {
13162
+ [key: string]: unknown;
13163
+ };
13164
+ };
13133
13165
  path: {
13134
13166
  broadcastId: string;
13135
13167
  };
@@ -13238,6 +13270,10 @@ type ListBroadcastRecipientsResponse = ({
13238
13270
  status?: 'pending' | 'sent' | 'delivered' | 'read' | 'failed';
13239
13271
  messageId?: string;
13240
13272
  error?: string;
13273
+ /**
13274
+ * Meta WhatsApp error code (e.g. 131049 for antispam, 131021 for invalid phone, 131026 for re-engagement required). Only populated for status=failed.
13275
+ */
13276
+ errorCode?: (number) | null;
13241
13277
  sentAt?: string;
13242
13278
  deliveredAt?: string;
13243
13279
  readAt?: string;
@@ -13421,6 +13457,32 @@ type GetSequenceError = ({
13421
13457
  error?: string;
13422
13458
  });
13423
13459
  type UpdateSequenceData = {
13460
+ body?: {
13461
+ name?: string;
13462
+ description?: string;
13463
+ /**
13464
+ * Replace the full step list. Only allowed while the sequence is draft or paused.
13465
+ */
13466
+ steps?: Array<{
13467
+ order: number;
13468
+ delayMinutes: number;
13469
+ message?: {
13470
+ text?: string;
13471
+ };
13472
+ template?: {
13473
+ name?: string;
13474
+ language?: string;
13475
+ variableMapping?: {
13476
+ [key: string]: {
13477
+ field?: 'name' | 'phone' | 'email' | 'company' | 'custom';
13478
+ customValue?: string;
13479
+ };
13480
+ };
13481
+ };
13482
+ }>;
13483
+ exitOnReply?: boolean;
13484
+ exitOnUnsubscribe?: boolean;
13485
+ };
13424
13486
  path: {
13425
13487
  sequenceId: string;
13426
13488
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zernio/node",
3
- "version": "0.2.154",
3
+ "version": "0.2.156",
4
4
  "description": "The official Node.js library for the Zernio API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -3190,7 +3190,7 @@ export const getSequence = <ThrowOnError extends boolean = false>(options: Optio
3190
3190
 
3191
3191
  /**
3192
3192
  * Update sequence
3193
- * Update a sequence's name, steps, or exit conditions. Active sequences can be updated without pausing.
3193
+ * Update a sequence's name, steps, or exit conditions. Steps can only be modified while the sequence is draft or paused.
3194
3194
  */
3195
3195
  export const updateSequence = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdateSequenceData, ThrowOnError>) => {
3196
3196
  return (options?.client ?? client).patch<UpdateSequenceResponse, UpdateSequenceError, ThrowOnError>({
@@ -13355,6 +13355,38 @@ export type GetBroadcastError = ({
13355
13355
  });
13356
13356
 
13357
13357
  export type UpdateBroadcastData = {
13358
+ body?: {
13359
+ name?: string;
13360
+ description?: string;
13361
+ /**
13362
+ * Generic message payload (used for non-WhatsApp platforms).
13363
+ */
13364
+ message?: {
13365
+ text?: string;
13366
+ };
13367
+ /**
13368
+ * WhatsApp template payload (used when platform is `whatsapp`).
13369
+ */
13370
+ template?: {
13371
+ name?: string;
13372
+ language?: string;
13373
+ /**
13374
+ * Maps template variable positions to contact fields. Keys are position strings ("1", "2"); values are { field, customValue }.
13375
+ */
13376
+ variableMapping?: {
13377
+ [key: string]: {
13378
+ field?: 'name' | 'phone' | 'email' | 'company' | 'custom';
13379
+ customValue?: string;
13380
+ };
13381
+ };
13382
+ };
13383
+ /**
13384
+ * Recipient segment filters (tags, channels, subscription state).
13385
+ */
13386
+ segmentFilters?: {
13387
+ [key: string]: unknown;
13388
+ };
13389
+ };
13358
13390
  path: {
13359
13391
  broadcastId: string;
13360
13392
  };
@@ -13479,6 +13511,10 @@ export type ListBroadcastRecipientsResponse = ({
13479
13511
  status?: 'pending' | 'sent' | 'delivered' | 'read' | 'failed';
13480
13512
  messageId?: string;
13481
13513
  error?: string;
13514
+ /**
13515
+ * Meta WhatsApp error code (e.g. 131049 for antispam, 131021 for invalid phone, 131026 for re-engagement required). Only populated for status=failed.
13516
+ */
13517
+ errorCode?: (number) | null;
13482
13518
  sentAt?: string;
13483
13519
  deliveredAt?: string;
13484
13520
  readAt?: string;
@@ -13676,6 +13712,32 @@ export type GetSequenceError = ({
13676
13712
  });
13677
13713
 
13678
13714
  export type UpdateSequenceData = {
13715
+ body?: {
13716
+ name?: string;
13717
+ description?: string;
13718
+ /**
13719
+ * Replace the full step list. Only allowed while the sequence is draft or paused.
13720
+ */
13721
+ steps?: Array<{
13722
+ order: number;
13723
+ delayMinutes: number;
13724
+ message?: {
13725
+ text?: string;
13726
+ };
13727
+ template?: {
13728
+ name?: string;
13729
+ language?: string;
13730
+ variableMapping?: {
13731
+ [key: string]: {
13732
+ field?: 'name' | 'phone' | 'email' | 'company' | 'custom';
13733
+ customValue?: string;
13734
+ };
13735
+ };
13736
+ };
13737
+ }>;
13738
+ exitOnReply?: boolean;
13739
+ exitOnUnsubscribe?: boolean;
13740
+ };
13679
13741
  path: {
13680
13742
  sequenceId: string;
13681
13743
  };