@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.
Files changed (203) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +82 -112
  3. package/client.d.mts +42 -6
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +42 -6
  6. package/client.d.ts.map +1 -1
  7. package/client.js +39 -3
  8. package/client.js.map +1 -1
  9. package/client.mjs +39 -3
  10. package/client.mjs.map +1 -1
  11. package/core/error.d.mts +13 -0
  12. package/core/error.d.mts.map +1 -1
  13. package/core/error.d.ts +13 -0
  14. package/core/error.d.ts.map +1 -1
  15. package/core/error.js +5 -1
  16. package/core/error.js.map +1 -1
  17. package/core/error.mjs +5 -1
  18. package/core/error.mjs.map +1 -1
  19. package/package.json +1 -1
  20. package/resources/available-number.d.mts +13 -1
  21. package/resources/available-number.d.mts.map +1 -1
  22. package/resources/available-number.d.ts +13 -1
  23. package/resources/available-number.d.ts.map +1 -1
  24. package/resources/available-number.js +2 -1
  25. package/resources/available-number.js.map +1 -1
  26. package/resources/available-number.mjs +2 -1
  27. package/resources/available-number.mjs.map +1 -1
  28. package/resources/chats/chats.d.mts +175 -70
  29. package/resources/chats/chats.d.mts.map +1 -1
  30. package/resources/chats/chats.d.ts +175 -70
  31. package/resources/chats/chats.d.ts.map +1 -1
  32. package/resources/chats/chats.js +65 -61
  33. package/resources/chats/chats.js.map +1 -1
  34. package/resources/chats/chats.mjs +65 -61
  35. package/resources/chats/chats.mjs.map +1 -1
  36. package/resources/chats/index.d.mts +3 -2
  37. package/resources/chats/index.d.mts.map +1 -1
  38. package/resources/chats/index.d.ts +3 -2
  39. package/resources/chats/index.d.ts.map +1 -1
  40. package/resources/chats/index.js +3 -1
  41. package/resources/chats/index.js.map +1 -1
  42. package/resources/chats/index.mjs +1 -0
  43. package/resources/chats/index.mjs.map +1 -1
  44. package/resources/chats/location.d.mts +25 -25
  45. package/resources/chats/location.d.mts.map +1 -1
  46. package/resources/chats/location.d.ts +25 -25
  47. package/resources/chats/location.d.ts.map +1 -1
  48. package/resources/chats/location.js +27 -27
  49. package/resources/chats/location.js.map +1 -1
  50. package/resources/chats/location.mjs +27 -27
  51. package/resources/chats/location.mjs.map +1 -1
  52. package/resources/chats/messages.d.mts +28 -21
  53. package/resources/chats/messages.d.mts.map +1 -1
  54. package/resources/chats/messages.d.ts +28 -21
  55. package/resources/chats/messages.d.ts.map +1 -1
  56. package/resources/chats/messages.js +16 -16
  57. package/resources/chats/messages.js.map +1 -1
  58. package/resources/chats/messages.mjs +16 -16
  59. package/resources/chats/messages.mjs.map +1 -1
  60. package/resources/chats/polls.d.mts +171 -0
  61. package/resources/chats/polls.d.mts.map +1 -0
  62. package/resources/chats/polls.d.ts +171 -0
  63. package/resources/chats/polls.d.ts.map +1 -0
  64. package/resources/chats/polls.js +95 -0
  65. package/resources/chats/polls.js.map +1 -0
  66. package/resources/chats/polls.mjs +91 -0
  67. package/resources/chats/polls.mjs.map +1 -0
  68. package/resources/contact-card.d.mts +29 -28
  69. package/resources/contact-card.d.mts.map +1 -1
  70. package/resources/contact-card.d.ts +29 -28
  71. package/resources/contact-card.d.ts.map +1 -1
  72. package/resources/contact-card.js +23 -22
  73. package/resources/contact-card.js.map +1 -1
  74. package/resources/contact-card.mjs +23 -22
  75. package/resources/contact-card.mjs.map +1 -1
  76. package/resources/experiences.d.mts +91 -0
  77. package/resources/experiences.d.mts.map +1 -0
  78. package/resources/experiences.d.ts +91 -0
  79. package/resources/experiences.d.ts.map +1 -0
  80. package/resources/experiences.js +29 -0
  81. package/resources/experiences.js.map +1 -0
  82. package/resources/experiences.mjs +25 -0
  83. package/resources/experiences.mjs.map +1 -0
  84. package/resources/index.d.mts +7 -3
  85. package/resources/index.d.mts.map +1 -1
  86. package/resources/index.d.ts +7 -3
  87. package/resources/index.d.ts.map +1 -1
  88. package/resources/index.js +10 -2
  89. package/resources/index.js.map +1 -1
  90. package/resources/index.mjs +5 -1
  91. package/resources/index.mjs.map +1 -1
  92. package/resources/messages/index.d.mts +3 -0
  93. package/resources/messages/index.d.mts.map +1 -0
  94. package/resources/messages/index.d.ts +3 -0
  95. package/resources/messages/index.d.ts.map +1 -0
  96. package/resources/messages/index.js +9 -0
  97. package/resources/messages/index.js.map +1 -0
  98. package/resources/messages/index.mjs +4 -0
  99. package/resources/messages/index.mjs.map +1 -0
  100. package/resources/messages/messages.d.mts +795 -0
  101. package/resources/messages/messages.d.mts.map +1 -0
  102. package/resources/messages/messages.d.ts +795 -0
  103. package/resources/messages/messages.d.ts.map +1 -0
  104. package/resources/messages/messages.js +298 -0
  105. package/resources/messages/messages.js.map +1 -0
  106. package/resources/messages/messages.mjs +293 -0
  107. package/resources/messages/messages.mjs.map +1 -0
  108. package/resources/messages/poll.d.mts +131 -0
  109. package/resources/messages/poll.d.mts.map +1 -0
  110. package/resources/messages/poll.d.ts +131 -0
  111. package/resources/messages/poll.d.ts.map +1 -0
  112. package/resources/messages/poll.js +119 -0
  113. package/resources/messages/poll.js.map +1 -0
  114. package/resources/messages/poll.mjs +115 -0
  115. package/resources/messages/poll.mjs.map +1 -0
  116. package/resources/messages.d.mts +1 -747
  117. package/resources/messages.d.mts.map +1 -1
  118. package/resources/messages.d.ts +1 -747
  119. package/resources/messages.d.ts.map +1 -1
  120. package/resources/messages.js +2 -275
  121. package/resources/messages.js.map +1 -1
  122. package/resources/messages.mjs +1 -273
  123. package/resources/messages.mjs.map +1 -1
  124. package/resources/payment-handles.d.mts +87 -0
  125. package/resources/payment-handles.d.mts.map +1 -0
  126. package/resources/payment-handles.d.ts +87 -0
  127. package/resources/payment-handles.d.ts.map +1 -0
  128. package/resources/payment-handles.js +76 -0
  129. package/resources/payment-handles.js.map +1 -0
  130. package/resources/payment-handles.mjs +72 -0
  131. package/resources/payment-handles.mjs.map +1 -0
  132. package/resources/payment-providers.d.mts +58 -0
  133. package/resources/payment-providers.d.mts.map +1 -0
  134. package/resources/payment-providers.d.ts +58 -0
  135. package/resources/payment-providers.d.ts.map +1 -0
  136. package/resources/payment-providers.js +45 -0
  137. package/resources/payment-providers.js.map +1 -0
  138. package/resources/payment-providers.mjs +41 -0
  139. package/resources/payment-providers.mjs.map +1 -0
  140. package/resources/payment-requests.d.mts +2 -2
  141. package/resources/payment-requests.d.ts +2 -2
  142. package/resources/payment-requests.js +2 -2
  143. package/resources/payment-requests.mjs +2 -2
  144. package/resources/payments.d.mts +116 -0
  145. package/resources/payments.d.mts.map +1 -0
  146. package/resources/payments.d.ts +116 -0
  147. package/resources/payments.d.ts.map +1 -0
  148. package/resources/payments.js +70 -0
  149. package/resources/payments.js.map +1 -0
  150. package/resources/payments.mjs +66 -0
  151. package/resources/payments.mjs.map +1 -0
  152. package/resources/phone-numbers.d.mts +11 -11
  153. package/resources/phone-numbers.d.mts.map +1 -1
  154. package/resources/phone-numbers.d.ts +11 -11
  155. package/resources/phone-numbers.d.ts.map +1 -1
  156. package/resources/phone-numbers.js +13 -13
  157. package/resources/phone-numbers.js.map +1 -1
  158. package/resources/phone-numbers.mjs +13 -13
  159. package/resources/phone-numbers.mjs.map +1 -1
  160. package/resources/webhook-events.d.mts +1 -1
  161. package/resources/webhook-events.d.mts.map +1 -1
  162. package/resources/webhook-events.d.ts +1 -1
  163. package/resources/webhook-events.d.ts.map +1 -1
  164. package/resources/webhook-subscriptions.d.mts +11 -11
  165. package/resources/webhook-subscriptions.d.mts.map +1 -1
  166. package/resources/webhook-subscriptions.d.ts +11 -11
  167. package/resources/webhook-subscriptions.d.ts.map +1 -1
  168. package/resources/webhook-subscriptions.js +13 -13
  169. package/resources/webhook-subscriptions.js.map +1 -1
  170. package/resources/webhook-subscriptions.mjs +13 -13
  171. package/resources/webhook-subscriptions.mjs.map +1 -1
  172. package/resources/webhooks.d.mts +72 -1
  173. package/resources/webhooks.d.mts.map +1 -1
  174. package/resources/webhooks.d.ts +72 -1
  175. package/resources/webhooks.d.ts.map +1 -1
  176. package/src/client.ts +91 -20
  177. package/src/core/error.ts +20 -1
  178. package/src/resources/available-number.ts +14 -1
  179. package/src/resources/chats/chats.ts +203 -85
  180. package/src/resources/chats/index.ts +3 -2
  181. package/src/resources/chats/location.ts +28 -28
  182. package/src/resources/chats/messages.ts +40 -32
  183. package/src/resources/chats/polls.ts +196 -0
  184. package/src/resources/contact-card.ts +36 -35
  185. package/src/resources/experiences.ts +118 -0
  186. package/src/resources/index.ts +23 -5
  187. package/src/resources/messages/index.ts +18 -0
  188. package/src/resources/messages/messages.ts +958 -0
  189. package/src/resources/messages/poll.ts +151 -0
  190. package/src/resources/messages.ts +1 -894
  191. package/src/resources/payment-handles.ts +114 -0
  192. package/src/resources/payment-providers.ts +81 -0
  193. package/src/resources/payment-requests.ts +2 -2
  194. package/src/resources/payments.ts +163 -0
  195. package/src/resources/phone-numbers.ts +14 -14
  196. package/src/resources/webhook-events.ts +9 -0
  197. package/src/resources/webhook-subscriptions.ts +14 -14
  198. package/src/resources/webhooks.ts +82 -0
  199. package/src/version.ts +1 -1
  200. package/version.d.mts +1 -1
  201. package/version.d.ts +1 -1
  202. package/version.js +1 -1
  203. package/version.mjs +1 -1
@@ -0,0 +1,114 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { RequestOptions } from '../internal/request-options';
6
+ import { path } from '../internal/utils/path';
7
+
8
+ /**
9
+ * Let an agent pay on a customer's behalf with a single-use virtual card.
10
+ * Connect a customer once, then create a payment — a virtual card is minted
11
+ * scoped to that purchase and the card details are handed back for checkout.
12
+ */
13
+ export class PaymentHandles extends APIResource {
14
+ /**
15
+ * Starts connecting a customer (by phone/email) so an agent can pay on their
16
+ * behalf. Linq drives the OTP + consent ceremony through the messaging channel;
17
+ * this returns `pending` and a `connection.created` webhook fires once the
18
+ * customer completes it.
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * const paymentHandleConnection =
23
+ * await client.paymentHandles.connect('handle');
24
+ * ```
25
+ */
26
+ connect(handle: string, options?: RequestOptions): APIPromise<PaymentHandleConnection> {
27
+ return this._client.post(path`/v3/payments/handles/${handle}/connect`, options);
28
+ }
29
+
30
+ /**
31
+ * Get a handle's connection status
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * const paymentHandleConnection =
36
+ * await client.paymentHandles.connection('handle');
37
+ * ```
38
+ */
39
+ connection(handle: string, options?: RequestOptions): APIPromise<PaymentHandleConnection> {
40
+ return this._client.get(path`/v3/payments/handles/${handle}/connection`, options);
41
+ }
42
+
43
+ /**
44
+ * Revokes this partner's grant for the customer. Only your grant is removed; the
45
+ * customer's wallet at the provider is untouched.
46
+ *
47
+ * @example
48
+ * ```ts
49
+ * const paymentHandleConnection =
50
+ * await client.paymentHandles.revoke('handle');
51
+ * ```
52
+ */
53
+ revoke(handle: string, options?: RequestOptions): APIPromise<PaymentHandleConnection> {
54
+ return this._client.delete(path`/v3/payments/handles/${handle}/connection`, options);
55
+ }
56
+
57
+ /**
58
+ * Completes the ceremony `connect` started: verifies the code, records the
59
+ * customer's consent, and stores the connection. Returns `connected` on success,
60
+ * after which payments for this handle no longer need the customer present.
61
+ *
62
+ * The code reaches you however your channel works — typically the customer replies
63
+ * with it in the thread. Codes are single-use and short-lived; if one has expired,
64
+ * call `connect` again for a fresh `connect_id`.
65
+ *
66
+ * @example
67
+ * ```ts
68
+ * const paymentHandleConnection =
69
+ * await client.paymentHandles.verify('handle', {
70
+ * code: '482913',
71
+ * connect_id: 'cs_01HZY8',
72
+ * });
73
+ * ```
74
+ */
75
+ verify(
76
+ handle: string,
77
+ body: PaymentHandleVerifyParams,
78
+ options?: RequestOptions,
79
+ ): APIPromise<PaymentHandleConnection> {
80
+ return this._client.post(path`/v3/payments/handles/${handle}/verify`, { body, ...options });
81
+ }
82
+ }
83
+
84
+ export interface PaymentHandleConnection {
85
+ /**
86
+ * Returned only by `connect`, and only while the ceremony is pending. Nothing on
87
+ * our side persists it — it comes back from the provider and is required again to
88
+ * verify — so hold it until you submit the code.
89
+ */
90
+ connect_id?: string;
91
+
92
+ handle?: string;
93
+
94
+ status?: 'not_connected' | 'pending' | 'connected' | 'revoked';
95
+ }
96
+
97
+ export interface PaymentHandleVerifyParams {
98
+ /**
99
+ * The one-time code the customer received.
100
+ */
101
+ code: string;
102
+
103
+ /**
104
+ * The id returned by `connect`.
105
+ */
106
+ connect_id: string;
107
+ }
108
+
109
+ export declare namespace PaymentHandles {
110
+ export {
111
+ type PaymentHandleConnection as PaymentHandleConnection,
112
+ type PaymentHandleVerifyParams as PaymentHandleVerifyParams,
113
+ };
114
+ }
@@ -0,0 +1,81 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { RequestOptions } from '../internal/request-options';
6
+ import { path } from '../internal/utils/path';
7
+
8
+ /**
9
+ * Let an agent pay on a customer's behalf with a single-use virtual card.
10
+ * Connect a customer once, then create a payment — a virtual card is minted
11
+ * scoped to that purchase and the card details are handed back for checkout.
12
+ */
13
+ export class PaymentProviders extends APIResource {
14
+ /**
15
+ * Returns your organization's onboarding status for a payment provider.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * const paymentProvider =
20
+ * await client.paymentProviders.retrieve('provider');
21
+ * ```
22
+ */
23
+ retrieve(provider: string, options?: RequestOptions): APIPromise<PaymentProvider> {
24
+ return this._client.get(path`/v3/payments/providers/${provider}`, options);
25
+ }
26
+
27
+ /**
28
+ * Begins connecting your organization to a payment provider (e.g. `agentcard`).
29
+ * Returns a hosted URL where an admin authorizes the connection; on completion the
30
+ * provider redirects back and Linq stores your connected credentials.
31
+ *
32
+ * @example
33
+ * ```ts
34
+ * const response = await client.paymentProviders.connect(
35
+ * 'provider',
36
+ * {
37
+ * return_url: 'https://partner.example/settings/payments',
38
+ * },
39
+ * );
40
+ * ```
41
+ */
42
+ connect(
43
+ provider: string,
44
+ body: PaymentProviderConnectParams,
45
+ options?: RequestOptions,
46
+ ): APIPromise<PaymentProviderConnectResponse> {
47
+ return this._client.post(path`/v3/payments/providers/${provider}/connect`, { body, ...options });
48
+ }
49
+ }
50
+
51
+ export interface PaymentProvider {
52
+ provider?: string;
53
+
54
+ status?: 'onboarding' | 'ready' | 'disabled';
55
+ }
56
+
57
+ export interface PaymentProviderConnectResponse {
58
+ /**
59
+ * Send the admin here to authorize the connection.
60
+ */
61
+ hosted_url?: string;
62
+
63
+ session_id?: string;
64
+
65
+ status?: string;
66
+ }
67
+
68
+ export interface PaymentProviderConnectParams {
69
+ /**
70
+ * Where to send the admin after they authorize the connection.
71
+ */
72
+ return_url: string;
73
+ }
74
+
75
+ export declare namespace PaymentProviders {
76
+ export {
77
+ type PaymentProvider as PaymentProvider,
78
+ type PaymentProviderConnectResponse as PaymentProviderConnectResponse,
79
+ type PaymentProviderConnectParams as PaymentProviderConnectParams,
80
+ };
81
+ }
@@ -25,7 +25,7 @@ import { path } from '../internal/utils/path';
25
25
  *
26
26
  * ## Connected accounts (Stripe Standard, direct charges)
27
27
  *
28
- * Agent Pay runs on **Stripe Connect Standard accounts** using **direct
28
+ * Payments run on **Stripe Connect Standard accounts** using **direct
29
29
  * charges**: the charge is created on *your* connected account and **you are
30
30
  * the merchant of record**. That means the money, the payout schedule, the
31
31
  * customer relationship, and the compliance surface are all yours — Linq
@@ -108,7 +108,7 @@ import { path } from '../internal/utils/path';
108
108
  * no-install checkout sheet. Everywhere else (Android, desktop, iPhones
109
109
  * without the App Clip yet) the same URL opens the web checkout, so the link
110
110
  * always works. The App Clip experience for your payment links is registered
111
- * automatically by Linq and refreshed whenever you update your Agent Pay
111
+ * automatically by Linq and refreshed whenever you update your payments
112
112
  * branding; a newly registered experience can take up to ~24 hours to
113
113
  * activate on Apple's side, during which links open the web checkout.
114
114
  *
@@ -0,0 +1,163 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { RequestOptions } from '../internal/request-options';
6
+ import { path } from '../internal/utils/path';
7
+
8
+ /**
9
+ * Let an agent pay on a customer's behalf with a single-use virtual card.
10
+ * Connect a customer once, then create a payment — a virtual card is minted
11
+ * scoped to that purchase and the card details are handed back for checkout.
12
+ */
13
+ export class Payments extends APIResource {
14
+ /**
15
+ * Advances the pay flow for a connected customer handle and returns a `status`
16
+ * describing where it is (`needs_connection`, `awaiting_user_action`, `ready`,
17
+ * ...). A payment `id` appears once a card is minted. Idempotent on the
18
+ * `Idempotency-Key` header.
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * const payment = await client.payments.create({
23
+ * amount_cents: 2500,
24
+ * currency: 'usd',
25
+ * handle: '+14155550123',
26
+ * });
27
+ * ```
28
+ */
29
+ create(body: PaymentCreateParams, options?: RequestOptions): APIPromise<Payment> {
30
+ return this._client.post('/v3/payments', { body, ...options });
31
+ }
32
+
33
+ /**
34
+ * Get a payment
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * const payment = await client.payments.retrieve('paymentId');
39
+ * ```
40
+ */
41
+ retrieve(paymentID: string, options?: RequestOptions): APIPromise<Payment> {
42
+ return this._client.get(path`/v3/payments/${paymentID}`, options);
43
+ }
44
+
45
+ /**
46
+ * Closes the virtual card and cancels the payment.
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const payment = await client.payments.cancel('paymentId');
51
+ * ```
52
+ */
53
+ cancel(paymentID: string, options?: RequestOptions): APIPromise<Payment> {
54
+ return this._client.post(path`/v3/payments/${paymentID}/cancel`, options);
55
+ }
56
+
57
+ /**
58
+ * Returns a short-lived handoff for a `ready` payment. Fetch the card credentials
59
+ * **directly from the provider** with the returned `user_token` at `fetch_url` —
60
+ * the card number never passes through Linq. Do not persist PAN/CVC.
61
+ *
62
+ * @example
63
+ * ```ts
64
+ * const response = await client.payments.credentials(
65
+ * 'paymentId',
66
+ * );
67
+ * ```
68
+ */
69
+ credentials(paymentID: string, options?: RequestOptions): APIPromise<PaymentCredentialsResponse> {
70
+ return this._client.get(path`/v3/payments/${paymentID}/credentials`, options);
71
+ }
72
+ }
73
+
74
+ export interface Payment {
75
+ id?: string;
76
+
77
+ amount_cents?: number;
78
+
79
+ /**
80
+ * Present when the customer must approve with a passkey.
81
+ */
82
+ approval_url?: string;
83
+
84
+ /**
85
+ * Present when the customer must attach a card.
86
+ */
87
+ attach_url?: string;
88
+
89
+ currency?: string;
90
+
91
+ description?: string;
92
+
93
+ handle?: string;
94
+
95
+ status?:
96
+ | 'needs_connection'
97
+ | 'connecting'
98
+ | 'awaiting_user_action'
99
+ | 'ready'
100
+ | 'authorized'
101
+ | 'succeeded'
102
+ | 'declined'
103
+ | 'canceled'
104
+ | 'expired';
105
+ }
106
+
107
+ export interface PaymentCredentialsResponse {
108
+ /**
109
+ * Fetch the card directly from the provider with these — never through Linq.
110
+ */
111
+ handoff?: PaymentCredentialsResponse.Handoff;
112
+ }
113
+
114
+ export namespace PaymentCredentialsResponse {
115
+ /**
116
+ * Fetch the card directly from the provider with these — never through Linq.
117
+ */
118
+ export interface Handoff {
119
+ card_ref?: string;
120
+
121
+ fetch_url?: string;
122
+
123
+ provider?: string;
124
+
125
+ /**
126
+ * Short-lived bearer to fetch the card from the provider.
127
+ */
128
+ user_token?: string;
129
+ }
130
+ }
131
+
132
+ export interface PaymentCreateParams {
133
+ amount_cents: number;
134
+
135
+ currency: string;
136
+
137
+ /**
138
+ * Customer phone (E.164) or email.
139
+ */
140
+ handle: string;
141
+
142
+ description?: string;
143
+
144
+ merchant?: PaymentCreateParams.Merchant;
145
+
146
+ metadata?: { [key: string]: string };
147
+ }
148
+
149
+ export namespace PaymentCreateParams {
150
+ export interface Merchant {
151
+ name?: string;
152
+
153
+ url?: string;
154
+ }
155
+ }
156
+
157
+ export declare namespace Payments {
158
+ export {
159
+ type Payment as Payment,
160
+ type PaymentCredentialsResponse as PaymentCredentialsResponse,
161
+ type PaymentCreateParams as PaymentCreateParams,
162
+ };
163
+ }
@@ -15,20 +15,6 @@ import { path } from '../internal/utils/path';
15
15
  * in the `from` field.
16
16
  */
17
17
  export class PhoneNumbers extends APIResource {
18
- /**
19
- * Returns all phone numbers assigned to the authenticated partner. Use this
20
- * endpoint to discover which phone numbers are available for use as the `from`
21
- * field when creating a chat, listing chats, or sending a voice memo.
22
- *
23
- * @example
24
- * ```ts
25
- * const phoneNumbers = await client.phoneNumbers.list();
26
- * ```
27
- */
28
- list(options?: RequestOptions): APIPromise<PhoneNumberListResponse> {
29
- return this._client.get('/v3/phone_numbers', options);
30
- }
31
-
32
18
  /**
33
19
  * Updates the forwarding number for a phone number. The forwarding number is where
34
20
  * inbound calls will be forwarded to.
@@ -50,6 +36,20 @@ export class PhoneNumbers extends APIResource {
50
36
  ): APIPromise<PhoneNumberUpdateResponse> {
51
37
  return this._client.put(path`/v3/phone_numbers/${phoneNumberID}`, { body, ...options });
52
38
  }
39
+
40
+ /**
41
+ * Returns all phone numbers assigned to the authenticated partner. Use this
42
+ * endpoint to discover which phone numbers are available for use as the `from`
43
+ * field when creating a chat, listing chats, or sending a voice memo.
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * const phoneNumbers = await client.phoneNumbers.list();
48
+ * ```
49
+ */
50
+ list(options?: RequestOptions): APIPromise<PhoneNumberListResponse> {
51
+ return this._client.get('/v3/phone_numbers', options);
52
+ }
53
53
  }
54
54
 
55
55
  export interface PhoneNumberUpdateResponse {
@@ -159,6 +159,15 @@ export type WebhookEventType =
159
159
  | 'message.edited'
160
160
  | 'reaction.added'
161
161
  | 'reaction.removed'
162
+ | 'poll.received'
163
+ | 'poll.failed'
164
+ | 'poll.sent'
165
+ | 'poll.delivered'
166
+ | 'poll.read'
167
+ | 'poll.updated'
168
+ | 'poll.vote.added'
169
+ | 'poll.vote.removed'
170
+ | 'poll.reaction.added'
162
171
  | 'participant.added'
163
172
  | 'participant.removed'
164
173
  | 'chat.created'
@@ -187,20 +187,6 @@ export class WebhookSubscriptions extends APIResource {
187
187
  return this._client.post('/v3/webhook-subscriptions', { body, ...options });
188
188
  }
189
189
 
190
- /**
191
- * Retrieve all webhook subscriptions for the authenticated partner. Returns a list
192
- * of active and inactive subscriptions with their configuration and status.
193
- *
194
- * @example
195
- * ```ts
196
- * const webhookSubscriptions =
197
- * await client.webhookSubscriptions.list();
198
- * ```
199
- */
200
- list(options?: RequestOptions): APIPromise<WebhookSubscriptionListResponse> {
201
- return this._client.get('/v3/webhook-subscriptions', options);
202
- }
203
-
204
190
  /**
205
191
  * Retrieve details for a specific webhook subscription including its target URL,
206
192
  * subscribed events, and current status.
@@ -243,6 +229,20 @@ export class WebhookSubscriptions extends APIResource {
243
229
  return this._client.put(path`/v3/webhook-subscriptions/${subscriptionID}`, { body, ...options });
244
230
  }
245
231
 
232
+ /**
233
+ * Retrieve all webhook subscriptions for the authenticated partner. Returns a list
234
+ * of active and inactive subscriptions with their configuration and status.
235
+ *
236
+ * @example
237
+ * ```ts
238
+ * const webhookSubscriptions =
239
+ * await client.webhookSubscriptions.list();
240
+ * ```
241
+ */
242
+ list(options?: RequestOptions): APIPromise<WebhookSubscriptionListResponse> {
243
+ return this._client.get('/v3/webhook-subscriptions', options);
244
+ }
245
+
246
246
  /**
247
247
  * Delete a webhook subscription.
248
248
  *
@@ -102,6 +102,17 @@ export interface MessageEventV2 {
102
102
  */
103
103
  read_at?: string | null;
104
104
 
105
+ /**
106
+ * Present only when this message was recovered by reconciliation rather than
107
+ * delivered live, and set to the time of that recovery. The field is omitted
108
+ * entirely for normally-delivered messages, which is the overwhelming majority.
109
+ * When present, expect `sent_at` to be substantially earlier than delivery of this
110
+ * event: the message is genuine but is arriving late and out of real-time order,
111
+ * so treat it as history rather than as a live inbound (for example, suppress
112
+ * auto-replies).
113
+ */
114
+ reconciled_at?: string;
115
+
105
116
  /**
106
117
  * Reference to the message this is replying to (for threaded replies)
107
118
  */
@@ -173,6 +184,21 @@ export namespace MessageEventV2 {
173
184
  * Current health bucket for the chat. See the
174
185
  * [Chat Health guide](/guides/chats/chat-health) for what each value means and how
175
186
  * to react. `doc_url` deep-links to the relevant section.
187
+ *
188
+ * `OPTED_OUT` is terminal — the recipient sent `STOP`, `UNSUBSCRIBE`, `OPTOUT`,
189
+ * `CANCEL`, `END`, or `QUIT`. The keyword must be the whole trimmed message, never
190
+ * part of a longer one: `STOP` counts, `please stop` does not. Most keywords must
191
+ * match exactly, including case. `OPT OUT` is the exception — it matches in any
192
+ * casing, with or without the space or a hyphen, so `opt out`, `Opt-Out` and
193
+ * `optout` all count. It clears if they later send `START`, `OPTIN`, or `UNSTOP`,
194
+ * or if they keep replying on the chat — sustained two-way conversation is treated
195
+ * as a sign the stop keyword was a false positive.
196
+ *
197
+ * Linq enforces this: while a recipient is opted out, every send to them is
198
+ * rejected with `403` (error code `2024`) before the message is queued, across
199
+ * every chat and every line on your account. Nothing is delivered, including a
200
+ * final courtesy message — to send one, set `override_optout: true` on that single
201
+ * request.
176
202
  */
177
203
  status: 'HEALTHY' | 'AT_RISK' | 'CRITICAL' | 'OPTED_OUT';
178
204
 
@@ -345,6 +371,17 @@ export interface MessagePayload {
345
371
  */
346
372
  read_at?: string | null;
347
373
 
374
+ /**
375
+ * Present only when this message was recovered by reconciliation rather than
376
+ * delivered live, and set to the time of that recovery. The field is omitted
377
+ * entirely for normally-delivered messages, which is the overwhelming majority.
378
+ * When present, expect `sent_at` to be substantially earlier than delivery of this
379
+ * event: the message is genuine but is arriving late and out of real-time order,
380
+ * so treat it as history rather than as a live inbound (for example, suppress
381
+ * auto-replies).
382
+ */
383
+ reconciled_at?: string;
384
+
348
385
  /**
349
386
  * Reference to the message this is replying to
350
387
  */
@@ -935,6 +972,9 @@ export interface MessageFailedWebhookEvent {
935
972
  * Error details for message.failed webhook events. See
936
973
  * [WebhookErrorCode](#/components/schemas/WebhookErrorCode) for the full error
937
974
  * code reference.
975
+ *
976
+ * In rare cases the message can still be delivered after this event fires — a
977
+ * `message.delivered` webhook for the same message ID may follow.
938
978
  */
939
979
  data: MessageFailedWebhookEvent.Data;
940
980
 
@@ -975,6 +1015,9 @@ export namespace MessageFailedWebhookEvent {
975
1015
  * Error details for message.failed webhook events. See
976
1016
  * [WebhookErrorCode](#/components/schemas/WebhookErrorCode) for the full error
977
1017
  * code reference.
1018
+ *
1019
+ * In rare cases the message can still be delivered after this event fires — a
1020
+ * `message.delivered` webhook for the same message ID may follow.
978
1021
  */
979
1022
  export interface Data {
980
1023
  /**
@@ -1157,6 +1200,21 @@ export namespace MessageEditedWebhookEvent {
1157
1200
  * Current health bucket for the chat. See the
1158
1201
  * [Chat Health guide](/guides/chats/chat-health) for what each value means and how
1159
1202
  * to react. `doc_url` deep-links to the relevant section.
1203
+ *
1204
+ * `OPTED_OUT` is terminal — the recipient sent `STOP`, `UNSUBSCRIBE`, `OPTOUT`,
1205
+ * `CANCEL`, `END`, or `QUIT`. The keyword must be the whole trimmed message, never
1206
+ * part of a longer one: `STOP` counts, `please stop` does not. Most keywords must
1207
+ * match exactly, including case. `OPT OUT` is the exception — it matches in any
1208
+ * casing, with or without the space or a hyphen, so `opt out`, `Opt-Out` and
1209
+ * `optout` all count. It clears if they later send `START`, `OPTIN`, or `UNSTOP`,
1210
+ * or if they keep replying on the chat — sustained two-way conversation is treated
1211
+ * as a sign the stop keyword was a false positive.
1212
+ *
1213
+ * Linq enforces this: while a recipient is opted out, every send to them is
1214
+ * rejected with `403` (error code `2024`) before the message is queued, across
1215
+ * every chat and every line on your account. Nothing is delivered, including a
1216
+ * final courtesy message — to send one, set `override_optout: true` on that single
1217
+ * request.
1160
1218
  */
1161
1219
  status: 'HEALTHY' | 'AT_RISK' | 'CRITICAL' | 'OPTED_OUT';
1162
1220
 
@@ -1579,6 +1637,21 @@ export namespace ChatCreatedWebhookEvent {
1579
1637
  * Current health bucket for the chat. See the
1580
1638
  * [Chat Health guide](/guides/chats/chat-health) for what each value means and how
1581
1639
  * to react. `doc_url` deep-links to the relevant section.
1640
+ *
1641
+ * `OPTED_OUT` is terminal — the recipient sent `STOP`, `UNSUBSCRIBE`, `OPTOUT`,
1642
+ * `CANCEL`, `END`, or `QUIT`. The keyword must be the whole trimmed message, never
1643
+ * part of a longer one: `STOP` counts, `please stop` does not. Most keywords must
1644
+ * match exactly, including case. `OPT OUT` is the exception — it matches in any
1645
+ * casing, with or without the space or a hyphen, so `opt out`, `Opt-Out` and
1646
+ * `optout` all count. It clears if they later send `START`, `OPTIN`, or `UNSTOP`,
1647
+ * or if they keep replying on the chat — sustained two-way conversation is treated
1648
+ * as a sign the stop keyword was a false positive.
1649
+ *
1650
+ * Linq enforces this: while a recipient is opted out, every send to them is
1651
+ * rejected with `403` (error code `2024`) before the message is queued, across
1652
+ * every chat and every line on your account. Nothing is delivered, including a
1653
+ * final courtesy message — to send one, set `override_optout: true` on that single
1654
+ * request.
1582
1655
  */
1583
1656
  status: 'HEALTHY' | 'AT_RISK' | 'CRITICAL' | 'OPTED_OUT';
1584
1657
 
@@ -2072,6 +2145,15 @@ export interface PhoneNumberStatusUpdatedWebhookEvent {
2072
2145
  | 'message.edited'
2073
2146
  | 'reaction.added'
2074
2147
  | 'reaction.removed'
2148
+ | 'poll.received'
2149
+ | 'poll.failed'
2150
+ | 'poll.sent'
2151
+ | 'poll.delivered'
2152
+ | 'poll.read'
2153
+ | 'poll.updated'
2154
+ | 'poll.vote.added'
2155
+ | 'poll.vote.removed'
2156
+ | 'poll.reaction.added'
2075
2157
  | 'participant.added'
2076
2158
  | 'participant.removed'
2077
2159
  | 'chat.created'
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.32.1'; // x-release-please-version
1
+ export const VERSION = '0.33.1'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.32.1";
1
+ export declare const VERSION = "0.33.1";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.32.1";
1
+ export declare const VERSION = "0.33.1";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.32.1'; // x-release-please-version
4
+ exports.VERSION = '0.33.1'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.32.1'; // x-release-please-version
1
+ export const VERSION = '0.33.1'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map