@zernio/node 0.2.661 → 0.2.663

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
@@ -18832,6 +18832,27 @@ type CreateInboxConversationData = {
18832
18832
  */
18833
18833
  filename?: string;
18834
18834
  };
18835
+ /**
18836
+ * WhatsApp only. Required to send a template whose approved header format is LOCATION: Meta only accepts the location's lat/long at send time, never at template creation, so there is nothing to fill in automatically. Cannot be combined with headerMedia (a template has exactly one header).
18837
+ */
18838
+ headerLocation?: {
18839
+ /**
18840
+ * Latitude in decimal degrees.
18841
+ */
18842
+ latitude: number;
18843
+ /**
18844
+ * Longitude in decimal degrees.
18845
+ */
18846
+ longitude: number;
18847
+ /**
18848
+ * Location name shown to the recipient (e.g. a business name).
18849
+ */
18850
+ name?: string;
18851
+ /**
18852
+ * Location address shown to the recipient.
18853
+ */
18854
+ address?: string;
18855
+ };
18835
18856
  };
18836
18857
  };
18837
18858
  type CreateInboxConversationResponse = ({
@@ -19907,6 +19928,38 @@ type SendInboxMessageResponse = ({
19907
19928
  type?: string;
19908
19929
  url?: string;
19909
19930
  }>;
19931
+ /**
19932
+ * Facebook/Instagram only. Present when an attachment and text were both requested: Meta has no single body shape for both, so the send is two Meta messages under the hood. First element === messageId (the attachment); second is the follow-up text.
19933
+ */
19934
+ messageIds?: Array<(string)>;
19935
+ /**
19936
+ * Facebook/Instagram only. The attachment was delivered but the follow-up text message was rejected by Meta and was not stored; the response is still a 200 because the attachment send succeeded.
19937
+ */
19938
+ partialFailure?: {
19939
+ part?: 'text';
19940
+ error?: string;
19941
+ /**
19942
+ * Meta's own diagnostic fields for the rejected follow-up, same shape as the 400 response's platformError.
19943
+ */
19944
+ platformError?: {
19945
+ /**
19946
+ * Meta error code
19947
+ */
19948
+ code?: number;
19949
+ /**
19950
+ * Meta error_subcode
19951
+ */
19952
+ subcode?: number;
19953
+ /**
19954
+ * Meta fbtrace_id, quote this in a Meta bug report
19955
+ */
19956
+ fbtraceId?: string;
19957
+ /**
19958
+ * Meta error type (e.g. OAuthException)
19959
+ */
19960
+ type?: string;
19961
+ };
19962
+ };
19910
19963
  };
19911
19964
  });
19912
19965
  type SendInboxMessageError = ({
package/dist/index.d.ts CHANGED
@@ -18832,6 +18832,27 @@ type CreateInboxConversationData = {
18832
18832
  */
18833
18833
  filename?: string;
18834
18834
  };
18835
+ /**
18836
+ * WhatsApp only. Required to send a template whose approved header format is LOCATION: Meta only accepts the location's lat/long at send time, never at template creation, so there is nothing to fill in automatically. Cannot be combined with headerMedia (a template has exactly one header).
18837
+ */
18838
+ headerLocation?: {
18839
+ /**
18840
+ * Latitude in decimal degrees.
18841
+ */
18842
+ latitude: number;
18843
+ /**
18844
+ * Longitude in decimal degrees.
18845
+ */
18846
+ longitude: number;
18847
+ /**
18848
+ * Location name shown to the recipient (e.g. a business name).
18849
+ */
18850
+ name?: string;
18851
+ /**
18852
+ * Location address shown to the recipient.
18853
+ */
18854
+ address?: string;
18855
+ };
18835
18856
  };
18836
18857
  };
18837
18858
  type CreateInboxConversationResponse = ({
@@ -19907,6 +19928,38 @@ type SendInboxMessageResponse = ({
19907
19928
  type?: string;
19908
19929
  url?: string;
19909
19930
  }>;
19931
+ /**
19932
+ * Facebook/Instagram only. Present when an attachment and text were both requested: Meta has no single body shape for both, so the send is two Meta messages under the hood. First element === messageId (the attachment); second is the follow-up text.
19933
+ */
19934
+ messageIds?: Array<(string)>;
19935
+ /**
19936
+ * Facebook/Instagram only. The attachment was delivered but the follow-up text message was rejected by Meta and was not stored; the response is still a 200 because the attachment send succeeded.
19937
+ */
19938
+ partialFailure?: {
19939
+ part?: 'text';
19940
+ error?: string;
19941
+ /**
19942
+ * Meta's own diagnostic fields for the rejected follow-up, same shape as the 400 response's platformError.
19943
+ */
19944
+ platformError?: {
19945
+ /**
19946
+ * Meta error code
19947
+ */
19948
+ code?: number;
19949
+ /**
19950
+ * Meta error_subcode
19951
+ */
19952
+ subcode?: number;
19953
+ /**
19954
+ * Meta fbtrace_id, quote this in a Meta bug report
19955
+ */
19956
+ fbtraceId?: string;
19957
+ /**
19958
+ * Meta error type (e.g. OAuthException)
19959
+ */
19960
+ type?: string;
19961
+ };
19962
+ };
19910
19963
  };
19911
19964
  });
19912
19965
  type SendInboxMessageError = ({
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.661",
39
+ version: "0.2.663",
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.661",
8
+ version: "0.2.663",
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.661",
3
+ "version": "0.2.663",
4
4
  "description": "The official Node.js library for the Zernio API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -3305,7 +3305,7 @@ export const listInboxConversations = <ThrowOnError extends boolean = false>(opt
3305
3305
  *
3306
3306
  * Slack: pass a workspace member id as participantId (list them with GET /v1/accounts/{accountId}/slack-members). Zernio opens the DM channel with that member and sends the message; the thread then behaves like any other Slack conversation in the inbox. The member must belong to the connected workspace.
3307
3307
  *
3308
- * WhatsApp: this is the endpoint for sending an approved template message to a phone number. Provide templateName, templateLanguage, and templateParams (variable values for the text header, body and dynamic URL buttons, in that order), with the recipient phone in participantId. A template is required because WhatsApp does not permit freeform messages to open a conversation; a missing template returns TEMPLATE_REQUIRED. Templates with media headers (image, video, document) are handled automatically: Zernio reads the approved template definition and fills the header at send time with the template's approved sample asset. To send a DIFFERENT asset per message (e.g. a distinct invoice PDF for each recipient), pass the headerMedia field with a public link (or a Meta media id); it overrides the sample for that send. A button that carries its own value at send time (a copy-code button holding a Pix payment code or a coupon, a flow token) is sent with templateButtonParams, addressed by the button's index; templateParams covers text variables and dynamic URL buttons only. Calling this for a number you already have a thread with simply sends the template into that thread, which also makes it the way to re-engage a contact after the 24-hour customer-service window has closed. Once the recipient replies (opening the 24h window), send freeform messages with the send-message endpoint (POST /v1/inbox/conversations/{conversationId}/messages). Template fields are accepted on the JSON body only, not on multipart requests. Alternatively, WhatsApp Business Accounts eligible for Meta Direct Send can open a conversation with a business-initiated utility text message and no template: pass category: 'utility' together with message (and no templateName). See the category field below.
3308
+ * WhatsApp: this is the endpoint for sending an approved template message to a phone number. Provide templateName, templateLanguage, and templateParams (variable values for the text header, body and dynamic URL buttons, in that order), with the recipient phone in participantId. A template is required because WhatsApp does not permit freeform messages to open a conversation; a missing template returns TEMPLATE_REQUIRED. Templates with media headers (image, video, document) are handled automatically: Zernio reads the approved template definition and fills the header at send time with the template's approved sample asset. To send a DIFFERENT asset per message (e.g. a distinct invoice PDF for each recipient), pass the headerMedia field with a public link (or a Meta media id); it overrides the sample for that send. A template whose approved header format is LOCATION has no header asset to reconstruct at all: Meta only accepts the location at send time, so pass headerLocation (latitude and longitude required) whenever such a template is sent; headerMedia and headerLocation cannot both be supplied. A button that carries its own value at send time (a copy-code button holding a Pix payment code or a coupon, a flow token) is sent with templateButtonParams, addressed by the button's index; templateParams covers text variables and dynamic URL buttons only. Calling this for a number you already have a thread with simply sends the template into that thread, which also makes it the way to re-engage a contact after the 24-hour customer-service window has closed. Once the recipient replies (opening the 24h window), send freeform messages with the send-message endpoint (POST /v1/inbox/conversations/{conversationId}/messages). Template fields are accepted on the JSON body only, not on multipart requests. Alternatively, WhatsApp Business Accounts eligible for Meta Direct Send can open a conversation with a business-initiated utility text message and no template: pass category: 'utility' together with message (and no templateName). See the category field below.
3309
3309
  *
3310
3310
  * DM eligibility (X/Twitter): Before sending, the endpoint checks if the recipient accepts DMs from your account (via the receives_your_dm field). If not, a 422 error with code DM_NOT_ALLOWED is returned. You can skip this check with skipDmCheck: true if you have already verified eligibility.
3311
3311
  *
@@ -18471,6 +18471,27 @@ export type CreateInboxConversationData = {
18471
18471
  */
18472
18472
  filename?: string;
18473
18473
  };
18474
+ /**
18475
+ * WhatsApp only. Required to send a template whose approved header format is LOCATION: Meta only accepts the location's lat/long at send time, never at template creation, so there is nothing to fill in automatically. Cannot be combined with headerMedia (a template has exactly one header).
18476
+ */
18477
+ headerLocation?: {
18478
+ /**
18479
+ * Latitude in decimal degrees.
18480
+ */
18481
+ latitude: number;
18482
+ /**
18483
+ * Longitude in decimal degrees.
18484
+ */
18485
+ longitude: number;
18486
+ /**
18487
+ * Location name shown to the recipient (e.g. a business name).
18488
+ */
18489
+ name?: string;
18490
+ /**
18491
+ * Location address shown to the recipient.
18492
+ */
18493
+ address?: string;
18494
+ };
18474
18495
  };
18475
18496
  };
18476
18497
 
@@ -19562,6 +19583,38 @@ export type SendInboxMessageResponse = ({
19562
19583
  type?: string;
19563
19584
  url?: string;
19564
19585
  }>;
19586
+ /**
19587
+ * Facebook/Instagram only. Present when an attachment and text were both requested: Meta has no single body shape for both, so the send is two Meta messages under the hood. First element === messageId (the attachment); second is the follow-up text.
19588
+ */
19589
+ messageIds?: Array<(string)>;
19590
+ /**
19591
+ * Facebook/Instagram only. The attachment was delivered but the follow-up text message was rejected by Meta and was not stored; the response is still a 200 because the attachment send succeeded.
19592
+ */
19593
+ partialFailure?: {
19594
+ part?: 'text';
19595
+ error?: string;
19596
+ /**
19597
+ * Meta's own diagnostic fields for the rejected follow-up, same shape as the 400 response's platformError.
19598
+ */
19599
+ platformError?: {
19600
+ /**
19601
+ * Meta error code
19602
+ */
19603
+ code?: number;
19604
+ /**
19605
+ * Meta error_subcode
19606
+ */
19607
+ subcode?: number;
19608
+ /**
19609
+ * Meta fbtrace_id, quote this in a Meta bug report
19610
+ */
19611
+ fbtraceId?: string;
19612
+ /**
19613
+ * Meta error type (e.g. OAuthException)
19614
+ */
19615
+ type?: string;
19616
+ };
19617
+ };
19565
19618
  };
19566
19619
  });
19567
19620