@linqapp/sdk 0.32.1 → 0.33.1
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/CHANGELOG.md +26 -0
- package/README.md +82 -112
- package/client.d.mts +42 -6
- package/client.d.mts.map +1 -1
- package/client.d.ts +42 -6
- package/client.d.ts.map +1 -1
- package/client.js +39 -3
- package/client.js.map +1 -1
- package/client.mjs +39 -3
- package/client.mjs.map +1 -1
- package/core/error.d.mts +13 -0
- package/core/error.d.mts.map +1 -1
- package/core/error.d.ts +13 -0
- package/core/error.d.ts.map +1 -1
- package/core/error.js +5 -1
- package/core/error.js.map +1 -1
- package/core/error.mjs +5 -1
- package/core/error.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/available-number.d.mts +13 -1
- package/resources/available-number.d.mts.map +1 -1
- package/resources/available-number.d.ts +13 -1
- package/resources/available-number.d.ts.map +1 -1
- package/resources/available-number.js +2 -1
- package/resources/available-number.js.map +1 -1
- package/resources/available-number.mjs +2 -1
- package/resources/available-number.mjs.map +1 -1
- package/resources/chats/chats.d.mts +175 -70
- package/resources/chats/chats.d.mts.map +1 -1
- package/resources/chats/chats.d.ts +175 -70
- package/resources/chats/chats.d.ts.map +1 -1
- package/resources/chats/chats.js +65 -61
- package/resources/chats/chats.js.map +1 -1
- package/resources/chats/chats.mjs +65 -61
- package/resources/chats/chats.mjs.map +1 -1
- package/resources/chats/index.d.mts +3 -2
- package/resources/chats/index.d.mts.map +1 -1
- package/resources/chats/index.d.ts +3 -2
- package/resources/chats/index.d.ts.map +1 -1
- package/resources/chats/index.js +3 -1
- package/resources/chats/index.js.map +1 -1
- package/resources/chats/index.mjs +1 -0
- package/resources/chats/index.mjs.map +1 -1
- package/resources/chats/location.d.mts +25 -25
- package/resources/chats/location.d.mts.map +1 -1
- package/resources/chats/location.d.ts +25 -25
- package/resources/chats/location.d.ts.map +1 -1
- package/resources/chats/location.js +27 -27
- package/resources/chats/location.js.map +1 -1
- package/resources/chats/location.mjs +27 -27
- package/resources/chats/location.mjs.map +1 -1
- package/resources/chats/messages.d.mts +28 -21
- package/resources/chats/messages.d.mts.map +1 -1
- package/resources/chats/messages.d.ts +28 -21
- package/resources/chats/messages.d.ts.map +1 -1
- package/resources/chats/messages.js +16 -16
- package/resources/chats/messages.js.map +1 -1
- package/resources/chats/messages.mjs +16 -16
- package/resources/chats/messages.mjs.map +1 -1
- package/resources/chats/polls.d.mts +171 -0
- package/resources/chats/polls.d.mts.map +1 -0
- package/resources/chats/polls.d.ts +171 -0
- package/resources/chats/polls.d.ts.map +1 -0
- package/resources/chats/polls.js +95 -0
- package/resources/chats/polls.js.map +1 -0
- package/resources/chats/polls.mjs +91 -0
- package/resources/chats/polls.mjs.map +1 -0
- package/resources/contact-card.d.mts +29 -28
- package/resources/contact-card.d.mts.map +1 -1
- package/resources/contact-card.d.ts +29 -28
- package/resources/contact-card.d.ts.map +1 -1
- package/resources/contact-card.js +23 -22
- package/resources/contact-card.js.map +1 -1
- package/resources/contact-card.mjs +23 -22
- package/resources/contact-card.mjs.map +1 -1
- package/resources/experiences.d.mts +91 -0
- package/resources/experiences.d.mts.map +1 -0
- package/resources/experiences.d.ts +91 -0
- package/resources/experiences.d.ts.map +1 -0
- package/resources/experiences.js +29 -0
- package/resources/experiences.js.map +1 -0
- package/resources/experiences.mjs +25 -0
- package/resources/experiences.mjs.map +1 -0
- package/resources/index.d.mts +7 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +7 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +10 -2
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +5 -1
- package/resources/index.mjs.map +1 -1
- package/resources/messages/index.d.mts +3 -0
- package/resources/messages/index.d.mts.map +1 -0
- package/resources/messages/index.d.ts +3 -0
- package/resources/messages/index.d.ts.map +1 -0
- package/resources/messages/index.js +9 -0
- package/resources/messages/index.js.map +1 -0
- package/resources/messages/index.mjs +4 -0
- package/resources/messages/index.mjs.map +1 -0
- package/resources/messages/messages.d.mts +795 -0
- package/resources/messages/messages.d.mts.map +1 -0
- package/resources/messages/messages.d.ts +795 -0
- package/resources/messages/messages.d.ts.map +1 -0
- package/resources/messages/messages.js +298 -0
- package/resources/messages/messages.js.map +1 -0
- package/resources/messages/messages.mjs +293 -0
- package/resources/messages/messages.mjs.map +1 -0
- package/resources/messages/poll.d.mts +131 -0
- package/resources/messages/poll.d.mts.map +1 -0
- package/resources/messages/poll.d.ts +131 -0
- package/resources/messages/poll.d.ts.map +1 -0
- package/resources/messages/poll.js +119 -0
- package/resources/messages/poll.js.map +1 -0
- package/resources/messages/poll.mjs +115 -0
- package/resources/messages/poll.mjs.map +1 -0
- package/resources/messages.d.mts +1 -747
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +1 -747
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +2 -275
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +1 -273
- package/resources/messages.mjs.map +1 -1
- package/resources/payment-handles.d.mts +87 -0
- package/resources/payment-handles.d.mts.map +1 -0
- package/resources/payment-handles.d.ts +87 -0
- package/resources/payment-handles.d.ts.map +1 -0
- package/resources/payment-handles.js +76 -0
- package/resources/payment-handles.js.map +1 -0
- package/resources/payment-handles.mjs +72 -0
- package/resources/payment-handles.mjs.map +1 -0
- package/resources/payment-providers.d.mts +58 -0
- package/resources/payment-providers.d.mts.map +1 -0
- package/resources/payment-providers.d.ts +58 -0
- package/resources/payment-providers.d.ts.map +1 -0
- package/resources/payment-providers.js +45 -0
- package/resources/payment-providers.js.map +1 -0
- package/resources/payment-providers.mjs +41 -0
- package/resources/payment-providers.mjs.map +1 -0
- package/resources/payment-requests.d.mts +2 -2
- package/resources/payment-requests.d.ts +2 -2
- package/resources/payment-requests.js +2 -2
- package/resources/payment-requests.mjs +2 -2
- package/resources/payments.d.mts +116 -0
- package/resources/payments.d.mts.map +1 -0
- package/resources/payments.d.ts +116 -0
- package/resources/payments.d.ts.map +1 -0
- package/resources/payments.js +70 -0
- package/resources/payments.js.map +1 -0
- package/resources/payments.mjs +66 -0
- package/resources/payments.mjs.map +1 -0
- package/resources/phone-numbers.d.mts +11 -11
- package/resources/phone-numbers.d.mts.map +1 -1
- package/resources/phone-numbers.d.ts +11 -11
- package/resources/phone-numbers.d.ts.map +1 -1
- package/resources/phone-numbers.js +13 -13
- package/resources/phone-numbers.js.map +1 -1
- package/resources/phone-numbers.mjs +13 -13
- package/resources/phone-numbers.mjs.map +1 -1
- package/resources/webhook-events.d.mts +1 -1
- package/resources/webhook-events.d.mts.map +1 -1
- package/resources/webhook-events.d.ts +1 -1
- package/resources/webhook-events.d.ts.map +1 -1
- package/resources/webhook-subscriptions.d.mts +11 -11
- package/resources/webhook-subscriptions.d.mts.map +1 -1
- package/resources/webhook-subscriptions.d.ts +11 -11
- package/resources/webhook-subscriptions.d.ts.map +1 -1
- package/resources/webhook-subscriptions.js +13 -13
- package/resources/webhook-subscriptions.js.map +1 -1
- package/resources/webhook-subscriptions.mjs +13 -13
- package/resources/webhook-subscriptions.mjs.map +1 -1
- package/resources/webhooks.d.mts +72 -1
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +72 -1
- package/resources/webhooks.d.ts.map +1 -1
- package/src/client.ts +91 -20
- package/src/core/error.ts +20 -1
- package/src/resources/available-number.ts +14 -1
- package/src/resources/chats/chats.ts +203 -85
- package/src/resources/chats/index.ts +3 -2
- package/src/resources/chats/location.ts +28 -28
- package/src/resources/chats/messages.ts +40 -32
- package/src/resources/chats/polls.ts +196 -0
- package/src/resources/contact-card.ts +36 -35
- package/src/resources/experiences.ts +118 -0
- package/src/resources/index.ts +23 -5
- package/src/resources/messages/index.ts +18 -0
- package/src/resources/messages/messages.ts +958 -0
- package/src/resources/messages/poll.ts +151 -0
- package/src/resources/messages.ts +1 -894
- package/src/resources/payment-handles.ts +114 -0
- package/src/resources/payment-providers.ts +81 -0
- package/src/resources/payment-requests.ts +2 -2
- package/src/resources/payments.ts +163 -0
- package/src/resources/phone-numbers.ts +14 -14
- package/src/resources/webhook-events.ts +9 -0
- package/src/resources/webhook-subscriptions.ts +14 -14
- package/src/resources/webhooks.ts +82 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":"AAEA,oCAAiC"}
|
package/resources/messages.js
CHANGED
|
@@ -1,279 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const pagination_1 = require("../core/pagination.js");
|
|
7
|
-
const headers_1 = require("../internal/headers.js");
|
|
8
|
-
const path_1 = require("../internal/utils/path.js");
|
|
9
|
-
/**
|
|
10
|
-
* Messages are individual communications within a chat thread.
|
|
11
|
-
*
|
|
12
|
-
* Messages can include text, media attachments, rich link previews, special effects
|
|
13
|
-
* (like confetti or fireworks), and reactions. All messages are associated with a
|
|
14
|
-
* specific chat and sent from a phone number you own.
|
|
15
|
-
*
|
|
16
|
-
* Messages support delivery status tracking, read receipts, and editing capabilities.
|
|
17
|
-
*
|
|
18
|
-
* ## Rich Link Previews
|
|
19
|
-
*
|
|
20
|
-
* Send a URL as a `link` part to deliver it with a rich preview card showing the
|
|
21
|
-
* page's title, description, and image (when available). A `link` part must be the
|
|
22
|
-
* **only** part in the message — it cannot be combined with text or media parts.
|
|
23
|
-
* To send a URL without a preview card, include it in a `text` part instead.
|
|
24
|
-
*
|
|
25
|
-
* **Limitations:**
|
|
26
|
-
* - A `link` part cannot be combined with other parts in the same message.
|
|
27
|
-
* - Maximum URL length: 2,048 characters.
|
|
28
|
-
*
|
|
29
|
-
* ## Ephemeral Messages (Privacy Tier)
|
|
30
|
-
*
|
|
31
|
-
* For regulated or sensitive conversations, opt in to the **ephemeral messages** tier by contacting your Linq support contact. When enabled, every message on the covered phone numbers is automatically given a fixed **24-hour retention window** — after that window the platform permanently deletes the message from Linq storage. There is no per-message flag; ephemerality is applied automatically based on your configuration.
|
|
32
|
-
*
|
|
33
|
-
* You can request it at two scopes:
|
|
34
|
-
*
|
|
35
|
-
* | Scope | Effect |
|
|
36
|
-
* |---|---|
|
|
37
|
-
* | **Partner-wide** | Every outbound and inbound message on every phone number under your account is retained for 24 hours, then deleted. |
|
|
38
|
-
* | **Per phone number** | Only the specified phone numbers have their messages auto-deleted. The rest follow the standard message-retention policy. |
|
|
39
|
-
*
|
|
40
|
-
* **Behavioral differences vs the standard default:**
|
|
41
|
-
*
|
|
42
|
-
* | Aspect | Standard | Ephemeral |
|
|
43
|
-
* |---|---|---|
|
|
44
|
-
* | Retention | Retained per the standard message-retention policy | **Hard backstop: 24 hours** from when the message is created |
|
|
45
|
-
* | After expiry | Message stays retrievable | Message is permanently deleted — `GET /v3/messages/{messageId}` returns `404` and it no longer appears in `GET /v3/chats/{chatId}/messages` |
|
|
46
|
-
* | Content on expiry | N/A | Text, formatting, and attachment references are scrubbed; the message is gone, not blanked out |
|
|
47
|
-
* | Cross-partner isolation | Enforced | Enforced |
|
|
48
|
-
*
|
|
49
|
-
* **How the 24-hour window works:**
|
|
50
|
-
*
|
|
51
|
-
* - The window is fixed at **24 hours from message creation** (`created_at`) and cannot be configured per message.
|
|
52
|
-
* - It mirrors the ephemeral *attachments* 1-day backstop, so a message and any media it carries expire together.
|
|
53
|
-
* - Expiry is delivery-independent — the clock starts when the message is created, not when it is delivered or read.
|
|
54
|
-
*
|
|
55
|
-
* **What you observe:**
|
|
56
|
-
*
|
|
57
|
-
* - **No expiry timestamp is exposed.** API responses and webhook payloads do not include the deletion time. If you need it, compute `created_at + 24h` yourself.
|
|
58
|
-
* - **No deletion webhook is sent.** There is no `message.deleted` event — a message simply stops being retrievable once its window passes.
|
|
59
|
-
* - **Delivery is unaffected.** Ephemeral messages send, deliver, and fire the usual `message.sent` / `message.received` and status webhooks exactly like standard messages. Only retention changes.
|
|
60
|
-
*
|
|
61
|
-
* **When to choose ephemeral:**
|
|
62
|
-
*
|
|
63
|
-
* - You have a compliance requirement that the platform must not retain message content beyond a short window.
|
|
64
|
-
* - The conversation is high-sensitivity (PHI, financial, identity verification) and you do not want it sitting in storage long-term.
|
|
65
|
-
* - Your application is the system of record — you capture what you need from the delivery webhook in real time and do not rely on reading message history back from Linq later.
|
|
66
|
-
*
|
|
67
|
-
* **Important:** ephemeral applies in *both directions* — messages you send **and** messages received by the phone numbers in that scope. Because Linq can no longer return the message after 24 hours, persist anything you need to keep from the webhook payload at the time it is delivered.
|
|
68
|
-
*/
|
|
69
|
-
class Messages extends resource_1.APIResource {
|
|
70
|
-
/**
|
|
71
|
-
* Send a message to one or more recipients **without supplying a `from` number**.
|
|
72
|
-
* Linq resolves both the sending line and the target chat for you, then returns
|
|
73
|
-
* exactly which line was used, which chat the message landed in, whether a new
|
|
74
|
-
* chat was created, and every resulting message id.
|
|
75
|
-
*
|
|
76
|
-
* This fuses "create chat" and "send message" behind a single message-centric
|
|
77
|
-
* resource. Provide only the recipients (`to`) and the `message`; the platform
|
|
78
|
-
* decides the rest.
|
|
79
|
-
*
|
|
80
|
-
* ## How the from-number and chat are chosen
|
|
81
|
-
*
|
|
82
|
-
* - **Reuse** — if a chat with exactly these recipients already exists on a line
|
|
83
|
-
* that can still send, the message is sent into that chat on its existing line
|
|
84
|
-
* (`from_selection.reason = reused_active_chat`). The most-recently-active such
|
|
85
|
-
* chat wins; chats stranded on flagged lines (e.g. by an earlier failover) are
|
|
86
|
-
* skipped.
|
|
87
|
-
* - **New** — if no such chat exists, a new chat is created on the best available
|
|
88
|
-
* line (`from_selection.reason = new_best_number`).
|
|
89
|
-
* - **Failover** — if matching chats exist but none is on a line that can send, a
|
|
90
|
-
* **new** chat is created on a fresh best line and the flagged chat is abandoned
|
|
91
|
-
* (`from_selection.reason = failover_flagged`, `previous_chat_id` set). If you
|
|
92
|
-
* supply `continuation_message`, that text is sent as the single message INSTEAD
|
|
93
|
-
* of `message` (useful as a fresh-number-appropriate opener). Exactly one
|
|
94
|
-
* message is sent either way.
|
|
95
|
-
*
|
|
96
|
-
* Recipients (`to`) are an order-independent set: a single handle is a direct
|
|
97
|
-
* chat, multiple handles a group chat.
|
|
98
|
-
*
|
|
99
|
-
* ## Differences from POST /v3/chats
|
|
100
|
-
*
|
|
101
|
-
* - The first message **may contain a link** (including for a newly created chat).
|
|
102
|
-
* Note: sending a link as the very first message on a freshly selected line can
|
|
103
|
-
* elevate that line's flagging risk — it is allowed, not recommended.
|
|
104
|
-
* - Voice memos are **not** supported here. To send an iMessage voice-memo bubble,
|
|
105
|
-
* use `POST /v3/chats/{chatId}/voicememo` with a known chat id.
|
|
106
|
-
*
|
|
107
|
-
* ## Service preference, effects, decorations
|
|
108
|
-
*
|
|
109
|
-
* Set `message.preferred_service` (`iMessage` | `RCS` | `SMS`), `message.effect`,
|
|
110
|
-
* and per-part `text_decorations` exactly as on the other send endpoints.
|
|
111
|
-
*
|
|
112
|
-
* Always responds `202 Accepted` — chat creation is incidental to the send.
|
|
113
|
-
*
|
|
114
|
-
* @example
|
|
115
|
-
* ```ts
|
|
116
|
-
* const message = await client.messages.create({
|
|
117
|
-
* message: {
|
|
118
|
-
* parts: [
|
|
119
|
-
* {
|
|
120
|
-
* type: 'text',
|
|
121
|
-
* value:
|
|
122
|
-
* 'Hi! Thanks for reaching out — how can we help?',
|
|
123
|
-
* },
|
|
124
|
-
* ],
|
|
125
|
-
* },
|
|
126
|
-
* to: ['+14155559876'],
|
|
127
|
-
* });
|
|
128
|
-
* ```
|
|
129
|
-
*/
|
|
130
|
-
create(params, options) {
|
|
131
|
-
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
132
|
-
return this._client.post('/v3/messages', {
|
|
133
|
-
body,
|
|
134
|
-
...options,
|
|
135
|
-
headers: (0, headers_1.buildHeaders)([
|
|
136
|
-
{ ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined) },
|
|
137
|
-
options?.headers,
|
|
138
|
-
]),
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Retrieve all messages in a conversation thread. Given any message ID in the
|
|
143
|
-
* thread, returns the originator message and all replies in chronological order.
|
|
144
|
-
*
|
|
145
|
-
* If the message is not part of a thread, returns just that single message.
|
|
146
|
-
*
|
|
147
|
-
* Supports pagination and configurable ordering.
|
|
148
|
-
*
|
|
149
|
-
* @example
|
|
150
|
-
* ```ts
|
|
151
|
-
* // Automatically fetches more pages as needed.
|
|
152
|
-
* for await (const message of client.messages.listMessagesThread(
|
|
153
|
-
* '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
|
|
154
|
-
* )) {
|
|
155
|
-
* // ...
|
|
156
|
-
* }
|
|
157
|
-
* ```
|
|
158
|
-
*/
|
|
159
|
-
listMessagesThread(messageID, query = {}, options) {
|
|
160
|
-
return this._client.getAPIList((0, path_1.path) `/v3/messages/${messageID}/thread`, (pagination_1.ListMessagesPagination), {
|
|
161
|
-
query,
|
|
162
|
-
...options,
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Retrieve a specific message by its ID. This endpoint returns the full message
|
|
167
|
-
* details including text, attachments, reactions, and metadata.
|
|
168
|
-
*
|
|
169
|
-
* @example
|
|
170
|
-
* ```ts
|
|
171
|
-
* const message = await client.messages.retrieve(
|
|
172
|
-
* '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
|
|
173
|
-
* );
|
|
174
|
-
* ```
|
|
175
|
-
*/
|
|
176
|
-
retrieve(messageID, options) {
|
|
177
|
-
return this._client.get((0, path_1.path) `/v3/messages/${messageID}`, options);
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* Deletes a message from the Linq API only. This does NOT unsend or remove the
|
|
181
|
-
* message from the actual chat — recipients will still see the message.
|
|
182
|
-
*
|
|
183
|
-
* @example
|
|
184
|
-
* ```ts
|
|
185
|
-
* await client.messages.delete(
|
|
186
|
-
* '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
|
|
187
|
-
* );
|
|
188
|
-
* ```
|
|
189
|
-
*/
|
|
190
|
-
delete(messageID, options) {
|
|
191
|
-
return this._client.delete((0, path_1.path) `/v3/messages/${messageID}`, {
|
|
192
|
-
...options,
|
|
193
|
-
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* Add or remove emoji reactions to messages. Reactions let users express their
|
|
198
|
-
* response to a message without sending a new message.
|
|
199
|
-
*
|
|
200
|
-
* **Supported Reactions:**
|
|
201
|
-
*
|
|
202
|
-
* - love ❤️
|
|
203
|
-
* - like 👍
|
|
204
|
-
* - dislike 👎
|
|
205
|
-
* - laugh 😂
|
|
206
|
-
* - emphasize ‼️
|
|
207
|
-
* - question ❓
|
|
208
|
-
* - custom - any emoji (use `custom_emoji` field to specify)
|
|
209
|
-
*
|
|
210
|
-
* @example
|
|
211
|
-
* ```ts
|
|
212
|
-
* const response = await client.messages.addReaction(
|
|
213
|
-
* '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
|
|
214
|
-
* { operation: 'add', type: 'love' },
|
|
215
|
-
* );
|
|
216
|
-
* ```
|
|
217
|
-
*/
|
|
218
|
-
addReaction(messageID, body, options) {
|
|
219
|
-
return this._client.post((0, path_1.path) `/v3/messages/${messageID}/reactions`, { body, ...options });
|
|
220
|
-
}
|
|
221
|
-
/**
|
|
222
|
-
* Edit the text content of a specific part of a previously sent message.
|
|
223
|
-
*
|
|
224
|
-
* **Note:** A message can be edited up to 5 times, and only within 15 minutes of
|
|
225
|
-
* when it was originally sent.
|
|
226
|
-
*
|
|
227
|
-
* @example
|
|
228
|
-
* ```ts
|
|
229
|
-
* const message = await client.messages.update(
|
|
230
|
-
* '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
|
|
231
|
-
* { text: 'This is the edited message content' },
|
|
232
|
-
* );
|
|
233
|
-
* ```
|
|
234
|
-
*/
|
|
235
|
-
update(messageID, body, options) {
|
|
236
|
-
return this._client.patch((0, path_1.path) `/v3/messages/${messageID}`, { body, ...options });
|
|
237
|
-
}
|
|
238
|
-
/**
|
|
239
|
-
* Replaces a previously delivered `imessage_app` card on the recipient's screen
|
|
240
|
-
* with new content, instead of posting a new bubble (like a game move redrawing
|
|
241
|
-
* the board).
|
|
242
|
-
*
|
|
243
|
-
* The update is delivered as a **new message** with its own id and delivery
|
|
244
|
-
* lifecycle (`message.sent` / `message.delivered` / `message.failed` webhooks fire
|
|
245
|
-
* for the new id). To update the card again, reference the message id returned by
|
|
246
|
-
* this call.
|
|
247
|
-
*
|
|
248
|
-
* Constraints:
|
|
249
|
-
*
|
|
250
|
-
* - The referenced message must be an `imessage_app` card sent by you (`400`
|
|
251
|
-
* otherwise — inbound cards cannot be updated).
|
|
252
|
-
* - The referenced card must already be delivered (`409` otherwise — retry after
|
|
253
|
-
* the `message.delivered` webhook for it).
|
|
254
|
-
* - The app identity (`team_id`, `bundle_id`, name) is inherited from the original
|
|
255
|
-
* card and cannot change; only `url`, `fallback_text`, and `layout` are
|
|
256
|
-
* replaced.
|
|
257
|
-
* - iMessage-only, like all app cards.
|
|
258
|
-
* - Concurrent updates against the same card are not serialized server-side; the
|
|
259
|
-
* last one delivered wins on the recipient's screen. Serialize updates by always
|
|
260
|
-
* referencing the message id returned by the previous call.
|
|
261
|
-
*
|
|
262
|
-
* @example
|
|
263
|
-
* ```ts
|
|
264
|
-
* const response = await client.messages.updateAppCard(
|
|
265
|
-
* '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
|
|
266
|
-
* {
|
|
267
|
-
* layout: { caption: 'Score: 2 – 1' },
|
|
268
|
-
* fallback_text: 'Score update',
|
|
269
|
-
* url: 'https://app.example.com/card?game=7f3a&move=2',
|
|
270
|
-
* },
|
|
271
|
-
* );
|
|
272
|
-
* ```
|
|
273
|
-
*/
|
|
274
|
-
updateAppCard(messageID, body, options) {
|
|
275
|
-
return this._client.post((0, path_1.path) `/v3/messages/${messageID}/update`, { body, ...options });
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
exports.Messages = Messages;
|
|
4
|
+
const tslib_1 = require("../internal/tslib.js");
|
|
5
|
+
tslib_1.__exportStar(require("./messages/index.js"), exports);
|
|
279
6
|
//# sourceMappingURL=messages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,8DAAiC"}
|
package/resources/messages.mjs
CHANGED
|
@@ -1,275 +1,3 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
import { ListMessagesPagination } from "../core/pagination.mjs";
|
|
4
|
-
import { buildHeaders } from "../internal/headers.mjs";
|
|
5
|
-
import { path } from "../internal/utils/path.mjs";
|
|
6
|
-
/**
|
|
7
|
-
* Messages are individual communications within a chat thread.
|
|
8
|
-
*
|
|
9
|
-
* Messages can include text, media attachments, rich link previews, special effects
|
|
10
|
-
* (like confetti or fireworks), and reactions. All messages are associated with a
|
|
11
|
-
* specific chat and sent from a phone number you own.
|
|
12
|
-
*
|
|
13
|
-
* Messages support delivery status tracking, read receipts, and editing capabilities.
|
|
14
|
-
*
|
|
15
|
-
* ## Rich Link Previews
|
|
16
|
-
*
|
|
17
|
-
* Send a URL as a `link` part to deliver it with a rich preview card showing the
|
|
18
|
-
* page's title, description, and image (when available). A `link` part must be the
|
|
19
|
-
* **only** part in the message — it cannot be combined with text or media parts.
|
|
20
|
-
* To send a URL without a preview card, include it in a `text` part instead.
|
|
21
|
-
*
|
|
22
|
-
* **Limitations:**
|
|
23
|
-
* - A `link` part cannot be combined with other parts in the same message.
|
|
24
|
-
* - Maximum URL length: 2,048 characters.
|
|
25
|
-
*
|
|
26
|
-
* ## Ephemeral Messages (Privacy Tier)
|
|
27
|
-
*
|
|
28
|
-
* For regulated or sensitive conversations, opt in to the **ephemeral messages** tier by contacting your Linq support contact. When enabled, every message on the covered phone numbers is automatically given a fixed **24-hour retention window** — after that window the platform permanently deletes the message from Linq storage. There is no per-message flag; ephemerality is applied automatically based on your configuration.
|
|
29
|
-
*
|
|
30
|
-
* You can request it at two scopes:
|
|
31
|
-
*
|
|
32
|
-
* | Scope | Effect |
|
|
33
|
-
* |---|---|
|
|
34
|
-
* | **Partner-wide** | Every outbound and inbound message on every phone number under your account is retained for 24 hours, then deleted. |
|
|
35
|
-
* | **Per phone number** | Only the specified phone numbers have their messages auto-deleted. The rest follow the standard message-retention policy. |
|
|
36
|
-
*
|
|
37
|
-
* **Behavioral differences vs the standard default:**
|
|
38
|
-
*
|
|
39
|
-
* | Aspect | Standard | Ephemeral |
|
|
40
|
-
* |---|---|---|
|
|
41
|
-
* | Retention | Retained per the standard message-retention policy | **Hard backstop: 24 hours** from when the message is created |
|
|
42
|
-
* | After expiry | Message stays retrievable | Message is permanently deleted — `GET /v3/messages/{messageId}` returns `404` and it no longer appears in `GET /v3/chats/{chatId}/messages` |
|
|
43
|
-
* | Content on expiry | N/A | Text, formatting, and attachment references are scrubbed; the message is gone, not blanked out |
|
|
44
|
-
* | Cross-partner isolation | Enforced | Enforced |
|
|
45
|
-
*
|
|
46
|
-
* **How the 24-hour window works:**
|
|
47
|
-
*
|
|
48
|
-
* - The window is fixed at **24 hours from message creation** (`created_at`) and cannot be configured per message.
|
|
49
|
-
* - It mirrors the ephemeral *attachments* 1-day backstop, so a message and any media it carries expire together.
|
|
50
|
-
* - Expiry is delivery-independent — the clock starts when the message is created, not when it is delivered or read.
|
|
51
|
-
*
|
|
52
|
-
* **What you observe:**
|
|
53
|
-
*
|
|
54
|
-
* - **No expiry timestamp is exposed.** API responses and webhook payloads do not include the deletion time. If you need it, compute `created_at + 24h` yourself.
|
|
55
|
-
* - **No deletion webhook is sent.** There is no `message.deleted` event — a message simply stops being retrievable once its window passes.
|
|
56
|
-
* - **Delivery is unaffected.** Ephemeral messages send, deliver, and fire the usual `message.sent` / `message.received` and status webhooks exactly like standard messages. Only retention changes.
|
|
57
|
-
*
|
|
58
|
-
* **When to choose ephemeral:**
|
|
59
|
-
*
|
|
60
|
-
* - You have a compliance requirement that the platform must not retain message content beyond a short window.
|
|
61
|
-
* - The conversation is high-sensitivity (PHI, financial, identity verification) and you do not want it sitting in storage long-term.
|
|
62
|
-
* - Your application is the system of record — you capture what you need from the delivery webhook in real time and do not rely on reading message history back from Linq later.
|
|
63
|
-
*
|
|
64
|
-
* **Important:** ephemeral applies in *both directions* — messages you send **and** messages received by the phone numbers in that scope. Because Linq can no longer return the message after 24 hours, persist anything you need to keep from the webhook payload at the time it is delivered.
|
|
65
|
-
*/
|
|
66
|
-
export class Messages extends APIResource {
|
|
67
|
-
/**
|
|
68
|
-
* Send a message to one or more recipients **without supplying a `from` number**.
|
|
69
|
-
* Linq resolves both the sending line and the target chat for you, then returns
|
|
70
|
-
* exactly which line was used, which chat the message landed in, whether a new
|
|
71
|
-
* chat was created, and every resulting message id.
|
|
72
|
-
*
|
|
73
|
-
* This fuses "create chat" and "send message" behind a single message-centric
|
|
74
|
-
* resource. Provide only the recipients (`to`) and the `message`; the platform
|
|
75
|
-
* decides the rest.
|
|
76
|
-
*
|
|
77
|
-
* ## How the from-number and chat are chosen
|
|
78
|
-
*
|
|
79
|
-
* - **Reuse** — if a chat with exactly these recipients already exists on a line
|
|
80
|
-
* that can still send, the message is sent into that chat on its existing line
|
|
81
|
-
* (`from_selection.reason = reused_active_chat`). The most-recently-active such
|
|
82
|
-
* chat wins; chats stranded on flagged lines (e.g. by an earlier failover) are
|
|
83
|
-
* skipped.
|
|
84
|
-
* - **New** — if no such chat exists, a new chat is created on the best available
|
|
85
|
-
* line (`from_selection.reason = new_best_number`).
|
|
86
|
-
* - **Failover** — if matching chats exist but none is on a line that can send, a
|
|
87
|
-
* **new** chat is created on a fresh best line and the flagged chat is abandoned
|
|
88
|
-
* (`from_selection.reason = failover_flagged`, `previous_chat_id` set). If you
|
|
89
|
-
* supply `continuation_message`, that text is sent as the single message INSTEAD
|
|
90
|
-
* of `message` (useful as a fresh-number-appropriate opener). Exactly one
|
|
91
|
-
* message is sent either way.
|
|
92
|
-
*
|
|
93
|
-
* Recipients (`to`) are an order-independent set: a single handle is a direct
|
|
94
|
-
* chat, multiple handles a group chat.
|
|
95
|
-
*
|
|
96
|
-
* ## Differences from POST /v3/chats
|
|
97
|
-
*
|
|
98
|
-
* - The first message **may contain a link** (including for a newly created chat).
|
|
99
|
-
* Note: sending a link as the very first message on a freshly selected line can
|
|
100
|
-
* elevate that line's flagging risk — it is allowed, not recommended.
|
|
101
|
-
* - Voice memos are **not** supported here. To send an iMessage voice-memo bubble,
|
|
102
|
-
* use `POST /v3/chats/{chatId}/voicememo` with a known chat id.
|
|
103
|
-
*
|
|
104
|
-
* ## Service preference, effects, decorations
|
|
105
|
-
*
|
|
106
|
-
* Set `message.preferred_service` (`iMessage` | `RCS` | `SMS`), `message.effect`,
|
|
107
|
-
* and per-part `text_decorations` exactly as on the other send endpoints.
|
|
108
|
-
*
|
|
109
|
-
* Always responds `202 Accepted` — chat creation is incidental to the send.
|
|
110
|
-
*
|
|
111
|
-
* @example
|
|
112
|
-
* ```ts
|
|
113
|
-
* const message = await client.messages.create({
|
|
114
|
-
* message: {
|
|
115
|
-
* parts: [
|
|
116
|
-
* {
|
|
117
|
-
* type: 'text',
|
|
118
|
-
* value:
|
|
119
|
-
* 'Hi! Thanks for reaching out — how can we help?',
|
|
120
|
-
* },
|
|
121
|
-
* ],
|
|
122
|
-
* },
|
|
123
|
-
* to: ['+14155559876'],
|
|
124
|
-
* });
|
|
125
|
-
* ```
|
|
126
|
-
*/
|
|
127
|
-
create(params, options) {
|
|
128
|
-
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
129
|
-
return this._client.post('/v3/messages', {
|
|
130
|
-
body,
|
|
131
|
-
...options,
|
|
132
|
-
headers: buildHeaders([
|
|
133
|
-
{ ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined) },
|
|
134
|
-
options?.headers,
|
|
135
|
-
]),
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Retrieve all messages in a conversation thread. Given any message ID in the
|
|
140
|
-
* thread, returns the originator message and all replies in chronological order.
|
|
141
|
-
*
|
|
142
|
-
* If the message is not part of a thread, returns just that single message.
|
|
143
|
-
*
|
|
144
|
-
* Supports pagination and configurable ordering.
|
|
145
|
-
*
|
|
146
|
-
* @example
|
|
147
|
-
* ```ts
|
|
148
|
-
* // Automatically fetches more pages as needed.
|
|
149
|
-
* for await (const message of client.messages.listMessagesThread(
|
|
150
|
-
* '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
|
|
151
|
-
* )) {
|
|
152
|
-
* // ...
|
|
153
|
-
* }
|
|
154
|
-
* ```
|
|
155
|
-
*/
|
|
156
|
-
listMessagesThread(messageID, query = {}, options) {
|
|
157
|
-
return this._client.getAPIList(path `/v3/messages/${messageID}/thread`, (ListMessagesPagination), {
|
|
158
|
-
query,
|
|
159
|
-
...options,
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Retrieve a specific message by its ID. This endpoint returns the full message
|
|
164
|
-
* details including text, attachments, reactions, and metadata.
|
|
165
|
-
*
|
|
166
|
-
* @example
|
|
167
|
-
* ```ts
|
|
168
|
-
* const message = await client.messages.retrieve(
|
|
169
|
-
* '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
|
|
170
|
-
* );
|
|
171
|
-
* ```
|
|
172
|
-
*/
|
|
173
|
-
retrieve(messageID, options) {
|
|
174
|
-
return this._client.get(path `/v3/messages/${messageID}`, options);
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* Deletes a message from the Linq API only. This does NOT unsend or remove the
|
|
178
|
-
* message from the actual chat — recipients will still see the message.
|
|
179
|
-
*
|
|
180
|
-
* @example
|
|
181
|
-
* ```ts
|
|
182
|
-
* await client.messages.delete(
|
|
183
|
-
* '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
|
|
184
|
-
* );
|
|
185
|
-
* ```
|
|
186
|
-
*/
|
|
187
|
-
delete(messageID, options) {
|
|
188
|
-
return this._client.delete(path `/v3/messages/${messageID}`, {
|
|
189
|
-
...options,
|
|
190
|
-
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* Add or remove emoji reactions to messages. Reactions let users express their
|
|
195
|
-
* response to a message without sending a new message.
|
|
196
|
-
*
|
|
197
|
-
* **Supported Reactions:**
|
|
198
|
-
*
|
|
199
|
-
* - love ❤️
|
|
200
|
-
* - like 👍
|
|
201
|
-
* - dislike 👎
|
|
202
|
-
* - laugh 😂
|
|
203
|
-
* - emphasize ‼️
|
|
204
|
-
* - question ❓
|
|
205
|
-
* - custom - any emoji (use `custom_emoji` field to specify)
|
|
206
|
-
*
|
|
207
|
-
* @example
|
|
208
|
-
* ```ts
|
|
209
|
-
* const response = await client.messages.addReaction(
|
|
210
|
-
* '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
|
|
211
|
-
* { operation: 'add', type: 'love' },
|
|
212
|
-
* );
|
|
213
|
-
* ```
|
|
214
|
-
*/
|
|
215
|
-
addReaction(messageID, body, options) {
|
|
216
|
-
return this._client.post(path `/v3/messages/${messageID}/reactions`, { body, ...options });
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* Edit the text content of a specific part of a previously sent message.
|
|
220
|
-
*
|
|
221
|
-
* **Note:** A message can be edited up to 5 times, and only within 15 minutes of
|
|
222
|
-
* when it was originally sent.
|
|
223
|
-
*
|
|
224
|
-
* @example
|
|
225
|
-
* ```ts
|
|
226
|
-
* const message = await client.messages.update(
|
|
227
|
-
* '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
|
|
228
|
-
* { text: 'This is the edited message content' },
|
|
229
|
-
* );
|
|
230
|
-
* ```
|
|
231
|
-
*/
|
|
232
|
-
update(messageID, body, options) {
|
|
233
|
-
return this._client.patch(path `/v3/messages/${messageID}`, { body, ...options });
|
|
234
|
-
}
|
|
235
|
-
/**
|
|
236
|
-
* Replaces a previously delivered `imessage_app` card on the recipient's screen
|
|
237
|
-
* with new content, instead of posting a new bubble (like a game move redrawing
|
|
238
|
-
* the board).
|
|
239
|
-
*
|
|
240
|
-
* The update is delivered as a **new message** with its own id and delivery
|
|
241
|
-
* lifecycle (`message.sent` / `message.delivered` / `message.failed` webhooks fire
|
|
242
|
-
* for the new id). To update the card again, reference the message id returned by
|
|
243
|
-
* this call.
|
|
244
|
-
*
|
|
245
|
-
* Constraints:
|
|
246
|
-
*
|
|
247
|
-
* - The referenced message must be an `imessage_app` card sent by you (`400`
|
|
248
|
-
* otherwise — inbound cards cannot be updated).
|
|
249
|
-
* - The referenced card must already be delivered (`409` otherwise — retry after
|
|
250
|
-
* the `message.delivered` webhook for it).
|
|
251
|
-
* - The app identity (`team_id`, `bundle_id`, name) is inherited from the original
|
|
252
|
-
* card and cannot change; only `url`, `fallback_text`, and `layout` are
|
|
253
|
-
* replaced.
|
|
254
|
-
* - iMessage-only, like all app cards.
|
|
255
|
-
* - Concurrent updates against the same card are not serialized server-side; the
|
|
256
|
-
* last one delivered wins on the recipient's screen. Serialize updates by always
|
|
257
|
-
* referencing the message id returned by the previous call.
|
|
258
|
-
*
|
|
259
|
-
* @example
|
|
260
|
-
* ```ts
|
|
261
|
-
* const response = await client.messages.updateAppCard(
|
|
262
|
-
* '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
|
|
263
|
-
* {
|
|
264
|
-
* layout: { caption: 'Score: 2 – 1' },
|
|
265
|
-
* fallback_text: 'Score update',
|
|
266
|
-
* url: 'https://app.example.com/card?game=7f3a&move=2',
|
|
267
|
-
* },
|
|
268
|
-
* );
|
|
269
|
-
* ```
|
|
270
|
-
*/
|
|
271
|
-
updateAppCard(messageID, body, options) {
|
|
272
|
-
return this._client.post(path `/v3/messages/${messageID}/update`, { body, ...options });
|
|
273
|
-
}
|
|
274
|
-
}
|
|
2
|
+
export * from "./messages/index.mjs";
|
|
275
3
|
//# sourceMappingURL=messages.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.mjs","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,
|
|
1
|
+
{"version":3,"file":"messages.mjs","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,qCAAiC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
|
4
|
+
/**
|
|
5
|
+
* Let an agent pay on a customer's behalf with a single-use virtual card.
|
|
6
|
+
* Connect a customer once, then create a payment — a virtual card is minted
|
|
7
|
+
* scoped to that purchase and the card details are handed back for checkout.
|
|
8
|
+
*/
|
|
9
|
+
export declare class PaymentHandles extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Starts connecting a customer (by phone/email) so an agent can pay on their
|
|
12
|
+
* behalf. Linq drives the OTP + consent ceremony through the messaging channel;
|
|
13
|
+
* this returns `pending` and a `connection.created` webhook fires once the
|
|
14
|
+
* customer completes it.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const paymentHandleConnection =
|
|
19
|
+
* await client.paymentHandles.connect('handle');
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
connect(handle: string, options?: RequestOptions): APIPromise<PaymentHandleConnection>;
|
|
23
|
+
/**
|
|
24
|
+
* Get a handle's connection status
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const paymentHandleConnection =
|
|
29
|
+
* await client.paymentHandles.connection('handle');
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
connection(handle: string, options?: RequestOptions): APIPromise<PaymentHandleConnection>;
|
|
33
|
+
/**
|
|
34
|
+
* Revokes this partner's grant for the customer. Only your grant is removed; the
|
|
35
|
+
* customer's wallet at the provider is untouched.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* const paymentHandleConnection =
|
|
40
|
+
* await client.paymentHandles.revoke('handle');
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
revoke(handle: string, options?: RequestOptions): APIPromise<PaymentHandleConnection>;
|
|
44
|
+
/**
|
|
45
|
+
* Completes the ceremony `connect` started: verifies the code, records the
|
|
46
|
+
* customer's consent, and stores the connection. Returns `connected` on success,
|
|
47
|
+
* after which payments for this handle no longer need the customer present.
|
|
48
|
+
*
|
|
49
|
+
* The code reaches you however your channel works — typically the customer replies
|
|
50
|
+
* with it in the thread. Codes are single-use and short-lived; if one has expired,
|
|
51
|
+
* call `connect` again for a fresh `connect_id`.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* const paymentHandleConnection =
|
|
56
|
+
* await client.paymentHandles.verify('handle', {
|
|
57
|
+
* code: '482913',
|
|
58
|
+
* connect_id: 'cs_01HZY8',
|
|
59
|
+
* });
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
verify(handle: string, body: PaymentHandleVerifyParams, options?: RequestOptions): APIPromise<PaymentHandleConnection>;
|
|
63
|
+
}
|
|
64
|
+
export interface PaymentHandleConnection {
|
|
65
|
+
/**
|
|
66
|
+
* Returned only by `connect`, and only while the ceremony is pending. Nothing on
|
|
67
|
+
* our side persists it — it comes back from the provider and is required again to
|
|
68
|
+
* verify — so hold it until you submit the code.
|
|
69
|
+
*/
|
|
70
|
+
connect_id?: string;
|
|
71
|
+
handle?: string;
|
|
72
|
+
status?: 'not_connected' | 'pending' | 'connected' | 'revoked';
|
|
73
|
+
}
|
|
74
|
+
export interface PaymentHandleVerifyParams {
|
|
75
|
+
/**
|
|
76
|
+
* The one-time code the customer received.
|
|
77
|
+
*/
|
|
78
|
+
code: string;
|
|
79
|
+
/**
|
|
80
|
+
* The id returned by `connect`.
|
|
81
|
+
*/
|
|
82
|
+
connect_id: string;
|
|
83
|
+
}
|
|
84
|
+
export declare namespace PaymentHandles {
|
|
85
|
+
export { type PaymentHandleConnection as PaymentHandleConnection, type PaymentHandleVerifyParams as PaymentHandleVerifyParams, };
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=payment-handles.d.mts.map
|