@getlatedev/node 0.2.881 → 0.2.882

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
@@ -22884,7 +22884,7 @@ type CreateInboxConversationData = {
22884
22884
  */
22885
22885
  accountId: string;
22886
22886
  /**
22887
- * Recipient identifier. For X this is the numeric user ID; for WhatsApp and SMS, the recipient phone number in international format (digits, country code included); for Slack, the workspace member id (e.g. U01ABCDEF). Provide either this or participantUsername.
22887
+ * Recipient identifier. For X this is the numeric user ID; for WhatsApp and SMS, the recipient phone number in international format (digits, country code included); for Slack, the workspace member id (e.g. U01ABCDEF); for iMessage, a phone number in international format with the leading + or an iMessage email. Provide either this or participantUsername.
22888
22888
  */
22889
22889
  participantId?: string;
22890
22890
  /**
@@ -23054,18 +23054,21 @@ type CreateInboxConversationResponse = ({
23054
23054
  });
23055
23055
  type CreateInboxConversationError = (({
23056
23056
  error?: string;
23057
- code?: 'PLATFORM_NOT_SUPPORTED' | 'PLATFORM_LIMITATION' | 'TEMPLATE_REQUIRED' | 'INVALID_TEMPLATE_PARAMS' | 'INVALID_TEMPLATE_BUTTON_PARAM' | 'INVALID_TEMPLATE_HEADER' | 'INVALID_TEMPLATE_CARD_PARAM' | 'DIRECT_SEND_NOT_ELIGIBLE' | 'DIRECT_SEND_LIMITED' | 'DIRECT_SEND_BLOCKED';
23057
+ code?: 'PLATFORM_NOT_SUPPORTED' | 'PLATFORM_LIMITATION' | 'TEMPLATE_REQUIRED' | 'INVALID_TEMPLATE_PARAMS' | 'INVALID_TEMPLATE_BUTTON_PARAM' | 'INVALID_TEMPLATE_HEADER' | 'INVALID_TEMPLATE_CARD_PARAM' | 'DIRECT_SEND_NOT_ELIGIBLE' | 'DIRECT_SEND_LIMITED' | 'DIRECT_SEND_BLOCKED' | 'invalid_content';
23058
23058
  } | WhatsAppTemplateLookupError) | {
23059
23059
  error?: string;
23060
23060
  } | unknown | ({
23061
23061
  error?: string;
23062
23062
  code?: 'account_not_found' | 'PARTICIPANT_NOT_FOUND';
23063
- } | WhatsAppTemplateLookupError) | ({
23063
+ } | WhatsAppTemplateLookupError) | {
23064
+ error?: string;
23065
+ code?: 'recipient_opted_out' | 'recipient_must_message_first';
23066
+ } | ({
23064
23067
  error?: string;
23065
23068
  code?: 'DM_NOT_ALLOWED';
23066
23069
  } | WhatsAppTemplateLookupError) | ({
23067
23070
  error?: string;
23068
- code?: 'rate_limited';
23071
+ code?: 'rate_limited' | 'new_contact_limit';
23069
23072
  } | WhatsAppTemplateLookupError) | WhatsAppTemplateLookupError);
23070
23073
  type SearchInboxConversationsData = {
23071
23074
  query: {
package/dist/index.d.ts CHANGED
@@ -22884,7 +22884,7 @@ type CreateInboxConversationData = {
22884
22884
  */
22885
22885
  accountId: string;
22886
22886
  /**
22887
- * Recipient identifier. For X this is the numeric user ID; for WhatsApp and SMS, the recipient phone number in international format (digits, country code included); for Slack, the workspace member id (e.g. U01ABCDEF). Provide either this or participantUsername.
22887
+ * Recipient identifier. For X this is the numeric user ID; for WhatsApp and SMS, the recipient phone number in international format (digits, country code included); for Slack, the workspace member id (e.g. U01ABCDEF); for iMessage, a phone number in international format with the leading + or an iMessage email. Provide either this or participantUsername.
22888
22888
  */
22889
22889
  participantId?: string;
22890
22890
  /**
@@ -23054,18 +23054,21 @@ type CreateInboxConversationResponse = ({
23054
23054
  });
23055
23055
  type CreateInboxConversationError = (({
23056
23056
  error?: string;
23057
- code?: 'PLATFORM_NOT_SUPPORTED' | 'PLATFORM_LIMITATION' | 'TEMPLATE_REQUIRED' | 'INVALID_TEMPLATE_PARAMS' | 'INVALID_TEMPLATE_BUTTON_PARAM' | 'INVALID_TEMPLATE_HEADER' | 'INVALID_TEMPLATE_CARD_PARAM' | 'DIRECT_SEND_NOT_ELIGIBLE' | 'DIRECT_SEND_LIMITED' | 'DIRECT_SEND_BLOCKED';
23057
+ code?: 'PLATFORM_NOT_SUPPORTED' | 'PLATFORM_LIMITATION' | 'TEMPLATE_REQUIRED' | 'INVALID_TEMPLATE_PARAMS' | 'INVALID_TEMPLATE_BUTTON_PARAM' | 'INVALID_TEMPLATE_HEADER' | 'INVALID_TEMPLATE_CARD_PARAM' | 'DIRECT_SEND_NOT_ELIGIBLE' | 'DIRECT_SEND_LIMITED' | 'DIRECT_SEND_BLOCKED' | 'invalid_content';
23058
23058
  } | WhatsAppTemplateLookupError) | {
23059
23059
  error?: string;
23060
23060
  } | unknown | ({
23061
23061
  error?: string;
23062
23062
  code?: 'account_not_found' | 'PARTICIPANT_NOT_FOUND';
23063
- } | WhatsAppTemplateLookupError) | ({
23063
+ } | WhatsAppTemplateLookupError) | {
23064
+ error?: string;
23065
+ code?: 'recipient_opted_out' | 'recipient_must_message_first';
23066
+ } | ({
23064
23067
  error?: string;
23065
23068
  code?: 'DM_NOT_ALLOWED';
23066
23069
  } | WhatsAppTemplateLookupError) | ({
23067
23070
  error?: string;
23068
- code?: 'rate_limited';
23071
+ code?: 'rate_limited' | 'new_contact_limit';
23069
23072
  } | WhatsAppTemplateLookupError) | WhatsAppTemplateLookupError);
23070
23073
  type SearchInboxConversationsData = {
23071
23074
  query: {
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: "@getlatedev/node",
39
- version: "0.2.881",
39
+ version: "0.2.882",
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: "@getlatedev/node",
8
- version: "0.2.881",
8
+ version: "0.2.882",
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": "@getlatedev/node",
3
- "version": "0.2.881",
3
+ "version": "0.2.882",
4
4
  "description": "The official Node.js library for the Zernio API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -3705,7 +3705,9 @@ export const listInboxConversations = <ThrowOnError extends boolean = false>(opt
3705
3705
  * Create conversation
3706
3706
  * Start a direct message conversation with a user. If a conversation with that recipient already exists, the message is added to the existing thread.
3707
3707
  *
3708
- * Supported platforms: X, Bluesky, Reddit, WhatsApp, SMS, and Slack. Other platforms return PLATFORM_NOT_SUPPORTED.
3708
+ * Supported platforms: X, Bluesky, Reddit, WhatsApp, SMS, Slack, and iMessage. Other platforms return PLATFORM_NOT_SUPPORTED.
3709
+ *
3710
+ * **iMessage.** Pass the recipient as participantId: a phone number in international format (+15551234567) or an iMessage email. Senders ordered through Zernio can message contacts who never wrote to them. The first message to such a contact must be a personal, plain-text note: no links, email addresses, phone numbers, prices, attachments or marketing. It is checked against those rules and reviewed for spam before sending; one that fails returns 400 with code `invalid_content` and nothing is sent. Each sender may open at most one new conversation every 15 minutes, and a new sender warms up: 2 new conversations per 24 hours on days 1-2 after activation, 5 on days 3-4, 10 on days 5-7, 20 on days 8-14, 30 on days 15-21 and 50 after that. Beyond that the request returns 429 with code `new_contact_limit` and a time to retry. The warm-up counts from when a sender ordered through Zernio went live; senders registered from your own provider account are not warmed up by Zernio. Until the contact replies, the opening is the only message the thread accepts: further sends return 409 `recipient_must_message_first`. Once the contact has written, the thread behaves like any other and is not limited. Recipients can report a first message as junk, and reports can get a sender blocked permanently, so keep the reply rate high (above roughly 30%). A sender registered with your own provider account may lack the add-on for new contacts; its sends to them return 409 `recipient_must_message_first`, and an opt-in link is the way in. A contact who opted out returns 409 `recipient_opted_out`.
3709
3711
  *
3710
3712
  * **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.
3711
3713
  *
@@ -3835,6 +3837,15 @@ export const getInboxConversationMessages = <ThrowOnError extends boolean = fals
3835
3837
  * return a `400` with code `131056`. Sends to other recipients are
3836
3838
  * unaffected, so parallelise across recipients rather than flooding one.
3837
3839
  *
3840
+ * iMessage pacing: messages to contacts who have not written to the
3841
+ * sender in the last 24 hours must be at least 2 minutes apart per
3842
+ * sender; a send inside that window returns `429` with code
3843
+ * `new_contact_limit` and the time to retry. Replies to contacts who
3844
+ * wrote within the last day are not paced. A thread opened with
3845
+ * `POST /v1/inbox/conversations` accepts no message after the opening
3846
+ * until the contact replies (`409 recipient_must_message_first`). Text
3847
+ * must be shorter than 10,000 characters.
3848
+ *
3838
3849
  * WhatsApp template messages: to send an approved template into this
3839
3850
  * conversation (required when the 24-hour customer-service window is
3840
3851
  * closed), use the `template` field with a single element carrying the
@@ -5397,10 +5408,11 @@ export const setImessageSubscription = <ThrowOnError extends boolean = false>(op
5397
5408
  /**
5398
5409
  * Create a tracked iMessage opt-in link
5399
5410
  * Generates a per-campaign link that opens Messages on this sender with
5400
- * `body` prefilled. iMessage is send-first: a sender can only message a
5401
- * contact who has written to it (a send to anyone else fails with
5402
- * `recipient_must_message_first`), and the contact's tap-and-send is
5403
- * what opens that door.
5411
+ * `body` prefilled. A thread the contact opens skips the pacing and the
5412
+ * first-message content rule that apply when the sender writes first,
5413
+ * and it is the only way in for senders without the add-on for new
5414
+ * contacts (their sends to anyone else fail with
5415
+ * `recipient_must_message_first`).
5404
5416
  *
5405
5417
  * Each link carries a unique code in place of the `[opt-in-code]`
5406
5418
  * placeholder; when the contact sends it, the resulting `message.received`
@@ -22332,7 +22332,7 @@ export type CreateInboxConversationData = {
22332
22332
  */
22333
22333
  accountId: string;
22334
22334
  /**
22335
- * Recipient identifier. For X this is the numeric user ID; for WhatsApp and SMS, the recipient phone number in international format (digits, country code included); for Slack, the workspace member id (e.g. U01ABCDEF). Provide either this or participantUsername.
22335
+ * Recipient identifier. For X this is the numeric user ID; for WhatsApp and SMS, the recipient phone number in international format (digits, country code included); for Slack, the workspace member id (e.g. U01ABCDEF); for iMessage, a phone number in international format with the leading + or an iMessage email. Provide either this or participantUsername.
22336
22336
  */
22337
22337
  participantId?: string;
22338
22338
  /**
@@ -22504,18 +22504,21 @@ export type CreateInboxConversationResponse = ({
22504
22504
 
22505
22505
  export type CreateInboxConversationError = (({
22506
22506
  error?: string;
22507
- code?: 'PLATFORM_NOT_SUPPORTED' | 'PLATFORM_LIMITATION' | 'TEMPLATE_REQUIRED' | 'INVALID_TEMPLATE_PARAMS' | 'INVALID_TEMPLATE_BUTTON_PARAM' | 'INVALID_TEMPLATE_HEADER' | 'INVALID_TEMPLATE_CARD_PARAM' | 'DIRECT_SEND_NOT_ELIGIBLE' | 'DIRECT_SEND_LIMITED' | 'DIRECT_SEND_BLOCKED';
22507
+ code?: 'PLATFORM_NOT_SUPPORTED' | 'PLATFORM_LIMITATION' | 'TEMPLATE_REQUIRED' | 'INVALID_TEMPLATE_PARAMS' | 'INVALID_TEMPLATE_BUTTON_PARAM' | 'INVALID_TEMPLATE_HEADER' | 'INVALID_TEMPLATE_CARD_PARAM' | 'DIRECT_SEND_NOT_ELIGIBLE' | 'DIRECT_SEND_LIMITED' | 'DIRECT_SEND_BLOCKED' | 'invalid_content';
22508
22508
  } | WhatsAppTemplateLookupError) | {
22509
22509
  error?: string;
22510
22510
  } | unknown | ({
22511
22511
  error?: string;
22512
22512
  code?: 'account_not_found' | 'PARTICIPANT_NOT_FOUND';
22513
- } | WhatsAppTemplateLookupError) | ({
22513
+ } | WhatsAppTemplateLookupError) | {
22514
+ error?: string;
22515
+ code?: 'recipient_opted_out' | 'recipient_must_message_first';
22516
+ } | ({
22514
22517
  error?: string;
22515
22518
  code?: 'DM_NOT_ALLOWED';
22516
22519
  } | WhatsAppTemplateLookupError) | ({
22517
22520
  error?: string;
22518
- code?: 'rate_limited';
22521
+ code?: 'rate_limited' | 'new_contact_limit';
22519
22522
  } | WhatsAppTemplateLookupError) | WhatsAppTemplateLookupError);
22520
22523
 
22521
22524
  export type SearchInboxConversationsData = {