@linqapp/sdk 0.35.0 → 0.36.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 +34 -0
- package/client.d.mts +86 -5
- package/client.d.mts.map +1 -1
- package/client.d.ts +86 -5
- package/client.d.ts.map +1 -1
- package/client.js +84 -3
- package/client.js.map +1 -1
- package/client.mjs +84 -3
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/attachments.d.mts +3 -5
- package/resources/attachments.d.mts.map +1 -1
- package/resources/attachments.d.ts +3 -5
- package/resources/attachments.d.ts.map +1 -1
- package/resources/attachments.js +3 -5
- package/resources/attachments.js.map +1 -1
- package/resources/attachments.mjs +3 -5
- package/resources/attachments.mjs.map +1 -1
- package/resources/chats/chats.d.mts +20 -14
- package/resources/chats/chats.d.mts.map +1 -1
- package/resources/chats/chats.d.ts +20 -14
- package/resources/chats/chats.d.ts.map +1 -1
- package/resources/chats/chats.js.map +1 -1
- package/resources/chats/chats.mjs.map +1 -1
- package/resources/chats/messages.d.mts +4 -3
- package/resources/chats/messages.d.mts.map +1 -1
- package/resources/chats/messages.d.ts +4 -3
- package/resources/chats/messages.d.ts.map +1 -1
- package/resources/experiences.d.mts +61 -3
- package/resources/experiences.d.mts.map +1 -1
- package/resources/experiences.d.ts +61 -3
- package/resources/experiences.d.ts.map +1 -1
- package/resources/experiences.js +61 -3
- package/resources/experiences.js.map +1 -1
- package/resources/experiences.mjs +61 -3
- package/resources/experiences.mjs.map +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/messages/messages.d.mts +13 -8
- package/resources/messages/messages.d.mts.map +1 -1
- package/resources/messages/messages.d.ts +13 -8
- package/resources/messages/messages.d.ts.map +1 -1
- package/resources/messages/messages.js.map +1 -1
- package/resources/messages/messages.mjs.map +1 -1
- package/resources/payment-requests.d.mts +35 -0
- package/resources/payment-requests.d.mts.map +1 -1
- package/resources/payment-requests.d.ts +35 -0
- package/resources/payment-requests.d.ts.map +1 -1
- package/resources/payment-requests.js +35 -0
- package/resources/payment-requests.js.map +1 -1
- package/resources/payment-requests.mjs +35 -0
- package/resources/payment-requests.mjs.map +1 -1
- package/resources/phone-numbers.d.mts +229 -1
- package/resources/phone-numbers.d.mts.map +1 -1
- package/resources/phone-numbers.d.ts +229 -1
- package/resources/phone-numbers.d.ts.map +1 -1
- package/resources/phone-numbers.js +36 -0
- package/resources/phone-numbers.js.map +1 -1
- package/resources/phone-numbers.mjs +36 -0
- package/resources/phone-numbers.mjs.map +1 -1
- package/src/client.ts +104 -3
- package/src/resources/attachments.ts +3 -5
- package/src/resources/chats/chats.ts +21 -15
- package/src/resources/chats/messages.ts +4 -3
- package/src/resources/experiences.ts +61 -3
- package/src/resources/index.ts +10 -0
- package/src/resources/messages/messages.ts +13 -8
- package/src/resources/payment-requests.ts +35 -0
- package/src/resources/phone-numbers.ts +286 -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
|
@@ -37,6 +37,228 @@ export declare class PhoneNumbers extends APIResource {
|
|
|
37
37
|
* ```
|
|
38
38
|
*/
|
|
39
39
|
list(options?: RequestOptions): APIPromise<PhoneNumberListResponse>;
|
|
40
|
+
/**
|
|
41
|
+
* Returns the audit's status and, once complete, the report. Audits are scoped to
|
|
42
|
+
* the line in the URL — an `auditId` started on a different line returns `404`.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* const reputationAudit =
|
|
47
|
+
* await client.phoneNumbers.getReputationAudit('auditId', {
|
|
48
|
+
* phoneNumber: 'phoneNumber',
|
|
49
|
+
* });
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
getReputationAudit(auditID: string, params: PhoneNumberGetReputationAuditParams, options?: RequestOptions): APIPromise<ReputationAudit>;
|
|
53
|
+
/**
|
|
54
|
+
* Starts an asynchronous reputation audit for a line and returns an `audit_id`.
|
|
55
|
+
* Poll the GET endpoint for the result.
|
|
56
|
+
*
|
|
57
|
+
* Rate limited per line: only one audit may run at a time (a second request
|
|
58
|
+
* returns `409` while the first is still in progress), and a new audit can't be
|
|
59
|
+
* started for the same line until a cooldown elapses (`429`, with `Retry-After`
|
|
60
|
+
* carrying the wait).
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```ts
|
|
64
|
+
* const reputationAuditStarted =
|
|
65
|
+
* await client.phoneNumbers.startReputationAudit(
|
|
66
|
+
* 'phoneNumber',
|
|
67
|
+
* );
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
startReputationAudit(phoneNumber: string, options?: RequestOptions): APIPromise<ReputationAuditStarted>;
|
|
71
|
+
}
|
|
72
|
+
export interface ReputationActionItem {
|
|
73
|
+
detail?: string;
|
|
74
|
+
expected_impact?: 'high' | 'medium' | 'low';
|
|
75
|
+
/**
|
|
76
|
+
* 1 = do first
|
|
77
|
+
*/
|
|
78
|
+
priority?: number;
|
|
79
|
+
title?: string;
|
|
80
|
+
}
|
|
81
|
+
export interface ReputationAudit {
|
|
82
|
+
audit_id: string;
|
|
83
|
+
/**
|
|
84
|
+
* `pending` until the report is ready — poll until `complete` or `error`.
|
|
85
|
+
*/
|
|
86
|
+
status: 'pending' | 'complete' | 'error';
|
|
87
|
+
/**
|
|
88
|
+
* Present only when `status` is `error`. Short, generic reason safe to display.
|
|
89
|
+
*/
|
|
90
|
+
error?: string;
|
|
91
|
+
/**
|
|
92
|
+
* When the report was generated; signals reflect the line at this moment.
|
|
93
|
+
*/
|
|
94
|
+
generated_at?: string;
|
|
95
|
+
/**
|
|
96
|
+
* The line audited, E.164.
|
|
97
|
+
*/
|
|
98
|
+
phone?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Present only when `status` is `complete`.
|
|
101
|
+
*/
|
|
102
|
+
report?: ReputationReport;
|
|
103
|
+
}
|
|
104
|
+
export interface ReputationAuditStarted {
|
|
105
|
+
/**
|
|
106
|
+
* Identifier for this audit. Poll
|
|
107
|
+
* `GET /v3/phone_numbers/{phoneNumber}/reputation_audit/{auditId}` until `status`
|
|
108
|
+
* is `complete` or `error`.
|
|
109
|
+
*/
|
|
110
|
+
audit_id: string;
|
|
111
|
+
/**
|
|
112
|
+
* A newly started audit is `pending`.
|
|
113
|
+
*/
|
|
114
|
+
status: 'pending' | 'complete' | 'error';
|
|
115
|
+
}
|
|
116
|
+
export interface ReputationDriver {
|
|
117
|
+
/**
|
|
118
|
+
* Stable driver-category identifier — what is dragging the line, or one of its
|
|
119
|
+
* conversations, down.
|
|
120
|
+
*
|
|
121
|
+
* - `low_engagement` — The conversation is one-sided: several messages sent, few
|
|
122
|
+
* or no replies back. Pause or rework outreach where recipients are not
|
|
123
|
+
* replying, and lead with messages that invite a response. Conversation-level:
|
|
124
|
+
* it appears on `evidence.unhealthy_chats[].driver_keys`, never in `drivers`.
|
|
125
|
+
* - `overall_conversation_health` — A large share of the line's active
|
|
126
|
+
* conversations are trending unhealthy. Fix those conversations first — review
|
|
127
|
+
* their content and timing, and whether recipients are engaging.
|
|
128
|
+
* - `volume_spike` — The line's daily sending volume jumped far above its own
|
|
129
|
+
* normal level. Ramp gradually instead of spiking, spread large sends across
|
|
130
|
+
* days, and prioritize people who have already engaged.
|
|
131
|
+
* - `new_conversation_rate` — The line is starting too many brand-new
|
|
132
|
+
* conversations in a single day. Spread new conversations out over time instead
|
|
133
|
+
* of starting many at once.
|
|
134
|
+
* - `opt_out_handling` — Recipients asked this line to stop. Honor every stop
|
|
135
|
+
* request immediately: send nothing further to that recipient unless they opt
|
|
136
|
+
* back in. Every send to them is rejected with `403` (error code `2024`),
|
|
137
|
+
* including a final courtesy message — to send one telling them they can reply
|
|
138
|
+
* to resume, set `override_optout: true` on that single request.
|
|
139
|
+
* - `flagged` — The line is currently restricted and its messages may not be
|
|
140
|
+
* reaching recipients. Move active traffic to a healthy line now, and let this
|
|
141
|
+
* one recover before sending more.
|
|
142
|
+
* - `other` — Fallback for a signal without dedicated partner copy.
|
|
143
|
+
*/
|
|
144
|
+
key?: ReputationDriverKey;
|
|
145
|
+
/**
|
|
146
|
+
* A specific observed figure when available; otherwise a short qualitative note.
|
|
147
|
+
*/
|
|
148
|
+
metric?: string;
|
|
149
|
+
/**
|
|
150
|
+
* One plain-English sentence.
|
|
151
|
+
*/
|
|
152
|
+
summary?: string;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Stable driver-category identifier — what is dragging the line, or one of its
|
|
156
|
+
* conversations, down.
|
|
157
|
+
*
|
|
158
|
+
* - `low_engagement` — The conversation is one-sided: several messages sent, few
|
|
159
|
+
* or no replies back. Pause or rework outreach where recipients are not
|
|
160
|
+
* replying, and lead with messages that invite a response. Conversation-level:
|
|
161
|
+
* it appears on `evidence.unhealthy_chats[].driver_keys`, never in `drivers`.
|
|
162
|
+
* - `overall_conversation_health` — A large share of the line's active
|
|
163
|
+
* conversations are trending unhealthy. Fix those conversations first — review
|
|
164
|
+
* their content and timing, and whether recipients are engaging.
|
|
165
|
+
* - `volume_spike` — The line's daily sending volume jumped far above its own
|
|
166
|
+
* normal level. Ramp gradually instead of spiking, spread large sends across
|
|
167
|
+
* days, and prioritize people who have already engaged.
|
|
168
|
+
* - `new_conversation_rate` — The line is starting too many brand-new
|
|
169
|
+
* conversations in a single day. Spread new conversations out over time instead
|
|
170
|
+
* of starting many at once.
|
|
171
|
+
* - `opt_out_handling` — Recipients asked this line to stop. Honor every stop
|
|
172
|
+
* request immediately: send nothing further to that recipient unless they opt
|
|
173
|
+
* back in. Every send to them is rejected with `403` (error code `2024`),
|
|
174
|
+
* including a final courtesy message — to send one telling them they can reply
|
|
175
|
+
* to resume, set `override_optout: true` on that single request.
|
|
176
|
+
* - `flagged` — The line is currently restricted and its messages may not be
|
|
177
|
+
* reaching recipients. Move active traffic to a healthy line now, and let this
|
|
178
|
+
* one recover before sending more.
|
|
179
|
+
* - `other` — Fallback for a signal without dedicated partner copy.
|
|
180
|
+
*/
|
|
181
|
+
export type ReputationDriverKey = 'low_engagement' | 'overall_conversation_health' | 'volume_spike' | 'new_conversation_rate' | 'opt_out_handling' | 'flagged' | 'other';
|
|
182
|
+
/**
|
|
183
|
+
* The specific conversations behind the drivers, so partners can verify every
|
|
184
|
+
* claim against their own send logs. Each `chat_id` can be fetched via
|
|
185
|
+
* `GET /v3/chats/{chatId}` — its current health appears there.
|
|
186
|
+
*/
|
|
187
|
+
export interface ReputationEvidence {
|
|
188
|
+
/**
|
|
189
|
+
* Worst first — most messages sent after the stop request; honor these
|
|
190
|
+
* immediately.
|
|
191
|
+
*/
|
|
192
|
+
opt_out_chats?: Array<ReputationOptOutChat>;
|
|
193
|
+
/**
|
|
194
|
+
* Up to 15, worst first.
|
|
195
|
+
*/
|
|
196
|
+
unhealthy_chats?: Array<ReputationUnhealthyChat>;
|
|
197
|
+
}
|
|
198
|
+
export interface ReputationOptOutChat {
|
|
199
|
+
chat_id?: string;
|
|
200
|
+
/**
|
|
201
|
+
* Outbound messages sent after the recipient asked to stop.
|
|
202
|
+
*/
|
|
203
|
+
messages_after_stop?: number;
|
|
204
|
+
}
|
|
205
|
+
export interface ReputationReport {
|
|
206
|
+
/**
|
|
207
|
+
* Ordered by `priority`; 1 = do first.
|
|
208
|
+
*/
|
|
209
|
+
action_items?: Array<ReputationActionItem>;
|
|
210
|
+
/**
|
|
211
|
+
* Ranked, highest impact first.
|
|
212
|
+
*/
|
|
213
|
+
drivers?: Array<ReputationDriver>;
|
|
214
|
+
/**
|
|
215
|
+
* The specific conversations behind the drivers, so partners can verify every
|
|
216
|
+
* claim against their own send logs. Each `chat_id` can be fetched via
|
|
217
|
+
* `GET /v3/chats/{chatId}` — its current health appears there.
|
|
218
|
+
*/
|
|
219
|
+
evidence?: ReputationEvidence;
|
|
220
|
+
/**
|
|
221
|
+
* The `key` of the most important driver. Empty string when the line has nothing
|
|
222
|
+
* to act on — the report then carries a single reassurance action item. Its values
|
|
223
|
+
* are the `ReputationDriverKey` vocabulary — see that schema for what each means
|
|
224
|
+
* and what to do about it.
|
|
225
|
+
*/
|
|
226
|
+
primary_driver?: string;
|
|
227
|
+
/**
|
|
228
|
+
* Current reputation of this phone line.
|
|
229
|
+
*
|
|
230
|
+
* - `HEALTHY` — The line is in good standing. Send normally.
|
|
231
|
+
* - `AT_RISK` — Warning signs on the line: engagement is low across many of its
|
|
232
|
+
* conversations, or it's starting too many brand-new conversations in a single
|
|
233
|
+
* day — and a spike in send volume can add to either. Slow the line's send pace,
|
|
234
|
+
* avoid opening many new conversations at once, and review your messaging
|
|
235
|
+
* patterns.
|
|
236
|
+
* - `CRITICAL` — Strong signals that messages from this line aren't landing well.
|
|
237
|
+
* Pause outbound on the line until it recovers.
|
|
238
|
+
*
|
|
239
|
+
* Defaults to `HEALTHY` for lines that have not yet been scored.
|
|
240
|
+
*/
|
|
241
|
+
severity?: 'HEALTHY' | 'AT_RISK' | 'CRITICAL';
|
|
242
|
+
/**
|
|
243
|
+
* Deterministic markdown rendering of this report, suitable for feeding directly
|
|
244
|
+
* to automated systems and AI agents as investigation context. Rendered from the
|
|
245
|
+
* structured fields above, which remain the source of truth.
|
|
246
|
+
*/
|
|
247
|
+
summary_markdown?: string;
|
|
248
|
+
}
|
|
249
|
+
export interface ReputationUnhealthyChat {
|
|
250
|
+
chat_id?: string;
|
|
251
|
+
/**
|
|
252
|
+
* What is dragging this conversation down, in the same vocabulary as the report's
|
|
253
|
+
* drivers. Each key's meaning and the fix for it are documented on
|
|
254
|
+
* `ReputationDriverKey`.
|
|
255
|
+
*/
|
|
256
|
+
driver_keys?: Array<ReputationDriverKey>;
|
|
257
|
+
/**
|
|
258
|
+
* The conversation's current health — the same value `GET /v3/chats/{chatId}`
|
|
259
|
+
* reports for it.
|
|
260
|
+
*/
|
|
261
|
+
status?: 'AT_RISK' | 'CRITICAL' | 'OPTED_OUT';
|
|
40
262
|
}
|
|
41
263
|
export interface PhoneNumberUpdateResponse {
|
|
42
264
|
/**
|
|
@@ -127,7 +349,13 @@ export interface PhoneNumberUpdateParams {
|
|
|
127
349
|
*/
|
|
128
350
|
forwarding_number: string | null;
|
|
129
351
|
}
|
|
352
|
+
export interface PhoneNumberGetReputationAuditParams {
|
|
353
|
+
/**
|
|
354
|
+
* The line in E.164 format.
|
|
355
|
+
*/
|
|
356
|
+
phoneNumber: string;
|
|
357
|
+
}
|
|
130
358
|
export declare namespace PhoneNumbers {
|
|
131
|
-
export { type PhoneNumberUpdateResponse as PhoneNumberUpdateResponse, type PhoneNumberListResponse as PhoneNumberListResponse, type PhoneNumberUpdateParams as PhoneNumberUpdateParams, };
|
|
359
|
+
export { type ReputationActionItem as ReputationActionItem, type ReputationAudit as ReputationAudit, type ReputationAuditStarted as ReputationAuditStarted, type ReputationDriver as ReputationDriver, type ReputationDriverKey as ReputationDriverKey, type ReputationEvidence as ReputationEvidence, type ReputationOptOutChat as ReputationOptOutChat, type ReputationReport as ReputationReport, type ReputationUnhealthyChat as ReputationUnhealthyChat, type PhoneNumberUpdateResponse as PhoneNumberUpdateResponse, type PhoneNumberListResponse as PhoneNumberListResponse, type PhoneNumberUpdateParams as PhoneNumberUpdateParams, type PhoneNumberGetReputationAuditParams as PhoneNumberGetReputationAuditParams, };
|
|
132
360
|
}
|
|
133
361
|
//# sourceMappingURL=phone-numbers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone-numbers.d.ts","sourceRoot":"","sources":["../src/resources/phone-numbers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAG7D;;;;;;;;GAQG;AACH,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;;;;OAaG;IACH,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;;eAaG;YACH,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;SAC5C;KACF;CACF;AAED,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAED,MAAM,WAAW,mCAAmC;IAClD;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EACL,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,mCAAmC,IAAI,mCAAmC,GAChF,CAAC;CACH"}
|
|
@@ -44,6 +44,42 @@ class PhoneNumbers extends resource_1.APIResource {
|
|
|
44
44
|
list(options) {
|
|
45
45
|
return this._client.get('/v3/phone_numbers', options);
|
|
46
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Returns the audit's status and, once complete, the report. Audits are scoped to
|
|
49
|
+
* the line in the URL — an `auditId` started on a different line returns `404`.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* const reputationAudit =
|
|
54
|
+
* await client.phoneNumbers.getReputationAudit('auditId', {
|
|
55
|
+
* phoneNumber: 'phoneNumber',
|
|
56
|
+
* });
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
getReputationAudit(auditID, params, options) {
|
|
60
|
+
const { phoneNumber } = params;
|
|
61
|
+
return this._client.get((0, path_1.path) `/v3/phone_numbers/${phoneNumber}/reputation_audit/${auditID}`, options);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Starts an asynchronous reputation audit for a line and returns an `audit_id`.
|
|
65
|
+
* Poll the GET endpoint for the result.
|
|
66
|
+
*
|
|
67
|
+
* Rate limited per line: only one audit may run at a time (a second request
|
|
68
|
+
* returns `409` while the first is still in progress), and a new audit can't be
|
|
69
|
+
* started for the same line until a cooldown elapses (`429`, with `Retry-After`
|
|
70
|
+
* carrying the wait).
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```ts
|
|
74
|
+
* const reputationAuditStarted =
|
|
75
|
+
* await client.phoneNumbers.startReputationAudit(
|
|
76
|
+
* 'phoneNumber',
|
|
77
|
+
* );
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
startReputationAudit(phoneNumber, options) {
|
|
81
|
+
return this._client.post((0, path_1.path) `/v3/phone_numbers/${phoneNumber}/reputation_audit`, options);
|
|
82
|
+
}
|
|
47
83
|
}
|
|
48
84
|
exports.PhoneNumbers = PhoneNumbers;
|
|
49
85
|
//# sourceMappingURL=phone-numbers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone-numbers.js","sourceRoot":"","sources":["../src/resources/phone-numbers.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAA8C;AAE9C;;;;;;;;GAQG;AACH,MAAa,YAAa,SAAQ,sBAAW;IAC3C;;;;;;;;;;;;;OAaG;IACH,MAAM,CACJ,aAAqB,EACrB,IAA6B,EAC7B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,qBAAqB,aAAa,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1F,CAAC;IAED;;;;;;;;;OASG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;CACF;
|
|
1
|
+
{"version":3,"file":"phone-numbers.js","sourceRoot":"","sources":["../src/resources/phone-numbers.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAA8C;AAE9C;;;;;;;;GAQG;AACH,MAAa,YAAa,SAAQ,sBAAW;IAC3C;;;;;;;;;;;;;OAaG;IACH,MAAM,CACJ,aAAqB,EACrB,IAA6B,EAC7B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,qBAAqB,aAAa,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1F,CAAC;IAED;;;;;;;;;OASG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;IAED;;;;;;;;;;;OAWG;IACH,kBAAkB,CAChB,OAAe,EACf,MAA2C,EAC3C,OAAwB;QAExB,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,qBAAqB,WAAW,qBAAqB,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IACvG,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,oBAAoB,CAAC,WAAmB,EAAE,OAAwB;QAChE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,qBAAqB,WAAW,mBAAmB,EAAE,OAAO,CAAC,CAAC;IAC7F,CAAC;CACF;AA9ED,oCA8EC"}
|
|
@@ -41,5 +41,41 @@ export class PhoneNumbers extends APIResource {
|
|
|
41
41
|
list(options) {
|
|
42
42
|
return this._client.get('/v3/phone_numbers', options);
|
|
43
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Returns the audit's status and, once complete, the report. Audits are scoped to
|
|
46
|
+
* the line in the URL — an `auditId` started on a different line returns `404`.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* const reputationAudit =
|
|
51
|
+
* await client.phoneNumbers.getReputationAudit('auditId', {
|
|
52
|
+
* phoneNumber: 'phoneNumber',
|
|
53
|
+
* });
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
getReputationAudit(auditID, params, options) {
|
|
57
|
+
const { phoneNumber } = params;
|
|
58
|
+
return this._client.get(path `/v3/phone_numbers/${phoneNumber}/reputation_audit/${auditID}`, options);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Starts an asynchronous reputation audit for a line and returns an `audit_id`.
|
|
62
|
+
* Poll the GET endpoint for the result.
|
|
63
|
+
*
|
|
64
|
+
* Rate limited per line: only one audit may run at a time (a second request
|
|
65
|
+
* returns `409` while the first is still in progress), and a new audit can't be
|
|
66
|
+
* started for the same line until a cooldown elapses (`429`, with `Retry-After`
|
|
67
|
+
* carrying the wait).
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* const reputationAuditStarted =
|
|
72
|
+
* await client.phoneNumbers.startReputationAudit(
|
|
73
|
+
* 'phoneNumber',
|
|
74
|
+
* );
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
startReputationAudit(phoneNumber, options) {
|
|
78
|
+
return this._client.post(path `/v3/phone_numbers/${phoneNumber}/reputation_audit`, options);
|
|
79
|
+
}
|
|
44
80
|
}
|
|
45
81
|
//# sourceMappingURL=phone-numbers.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone-numbers.mjs","sourceRoot":"","sources":["../src/resources/phone-numbers.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,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B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,qBAAqB,WAAW,qBAAqB,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IACvG,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,oBAAoB,CAAC,WAAmB,EAAE,OAAwB;QAChE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,qBAAqB,WAAW,mBAAmB,EAAE,OAAO,CAAC,CAAC;IAC7F,CAAC;CACF"}
|
package/src/client.ts
CHANGED
|
@@ -81,10 +81,20 @@ import {
|
|
|
81
81
|
} from './resources/payment-requests';
|
|
82
82
|
import { Payment, PaymentCreateParams, PaymentCredentialsResponse, Payments } from './resources/payments';
|
|
83
83
|
import {
|
|
84
|
+
PhoneNumberGetReputationAuditParams,
|
|
84
85
|
PhoneNumberListResponse,
|
|
85
86
|
PhoneNumberUpdateParams,
|
|
86
87
|
PhoneNumberUpdateResponse,
|
|
87
88
|
PhoneNumbers,
|
|
89
|
+
ReputationActionItem,
|
|
90
|
+
ReputationAudit,
|
|
91
|
+
ReputationAuditStarted,
|
|
92
|
+
ReputationDriver,
|
|
93
|
+
ReputationDriverKey,
|
|
94
|
+
ReputationEvidence,
|
|
95
|
+
ReputationOptOutChat,
|
|
96
|
+
ReputationReport,
|
|
97
|
+
ReputationUnhealthyChat,
|
|
88
98
|
} from './resources/phone-numbers';
|
|
89
99
|
import { PhonenumberListResponse, Phonenumbers } from './resources/phonenumbers';
|
|
90
100
|
import { WebhookEventListResponse, WebhookEventType, WebhookEvents } from './resources/webhook-events';
|
|
@@ -1300,6 +1310,41 @@ export class LinqAPIV3 {
|
|
|
1300
1310
|
* branding; a newly registered experience can take up to ~24 hours to
|
|
1301
1311
|
* activate on Apple's side, during which links open the web checkout.
|
|
1302
1312
|
*
|
|
1313
|
+
* ## Sending it as a card instead
|
|
1314
|
+
*
|
|
1315
|
+
* A `link` part is one way to deliver a request. The other is the
|
|
1316
|
+
* **`agentpay` experience**, which sends the same request as a native card
|
|
1317
|
+
* in Linq's iMessage app — the amount and reason are drawn in the bubble,
|
|
1318
|
+
* and it turns itself into "Paid" in place once the payment succeeds,
|
|
1319
|
+
* without a second message.
|
|
1320
|
+
*
|
|
1321
|
+
* Send it to `POST /v3/chats/{chatId}/messages`:
|
|
1322
|
+
*
|
|
1323
|
+
* ```json
|
|
1324
|
+
* {
|
|
1325
|
+
* "message": {
|
|
1326
|
+
* "experience": {
|
|
1327
|
+
* "name": "agentpay",
|
|
1328
|
+
* "action": "request_payment",
|
|
1329
|
+
* "params": { "checkout_url": "https://zero.linqapp.com/pay/acme?session=tok_..." }
|
|
1330
|
+
* }
|
|
1331
|
+
* }
|
|
1332
|
+
* }
|
|
1333
|
+
* ```
|
|
1334
|
+
*
|
|
1335
|
+
* `checkout_url` is the only required field — pass back exactly what
|
|
1336
|
+
* `POST /v3/payment_requests` returned. **The amount and reason are read
|
|
1337
|
+
* from that request, never from you**, so the card can never claim a
|
|
1338
|
+
* different figure than the checkout will charge. Optional `title` and
|
|
1339
|
+
* `note` override the copy only. The link must be one of your own payment
|
|
1340
|
+
* requests; another partner's is rejected.
|
|
1341
|
+
*
|
|
1342
|
+
* The trade-off against a `link` part: a card is an app card, so it is
|
|
1343
|
+
* iMessage-only, and recipients without the app see a static version of it.
|
|
1344
|
+
* A link works everywhere and is what opens the Apple Pay App Clip. Send
|
|
1345
|
+
* whichever suits the conversation — both settle the same payment request
|
|
1346
|
+
* and fire the same webhooks.
|
|
1347
|
+
*
|
|
1303
1348
|
* ## Webhooks
|
|
1304
1349
|
*
|
|
1305
1350
|
* Subscribe to payment lifecycle events to reconcile server-side rather than
|
|
@@ -1340,9 +1385,55 @@ export class LinqAPIV3 {
|
|
|
1340
1385
|
*/
|
|
1341
1386
|
blockedHandles: API.BlockedHandles = new API.BlockedHandles(this);
|
|
1342
1387
|
/**
|
|
1343
|
-
*
|
|
1344
|
-
*
|
|
1345
|
-
*
|
|
1388
|
+
* An **experience** renders inside Linq's iMessage app as a native card,
|
|
1389
|
+
* instead of as text or a link. You invoke one by name; Linq resolves the
|
|
1390
|
+
* recipient, mints any session it needs, composes the card and sends it.
|
|
1391
|
+
*
|
|
1392
|
+
* Send it to `POST /v3/chats/{chatId}/messages`:
|
|
1393
|
+
*
|
|
1394
|
+
* ```json
|
|
1395
|
+
* {
|
|
1396
|
+
* "message": {
|
|
1397
|
+
* "experience": {
|
|
1398
|
+
* "name": "agentpay",
|
|
1399
|
+
* "action": "request_payment",
|
|
1400
|
+
* "params": { "checkout_url": "https://zero.linqapp.com/pay/acme?session=tok_..." }
|
|
1401
|
+
* }
|
|
1402
|
+
* }
|
|
1403
|
+
* }
|
|
1404
|
+
* ```
|
|
1405
|
+
*
|
|
1406
|
+
* The key is `experience` — what you're invoking. Nested under it is its
|
|
1407
|
+
* `name`, the action you're invoking on it, and that action's params. A card
|
|
1408
|
+
* **is** the whole message on Apple's side, so a message carries either
|
|
1409
|
+
* `experience` or `parts`, never both, and an action goes to exactly one
|
|
1410
|
+
* recipient.
|
|
1411
|
+
*
|
|
1412
|
+
* ## What you can invoke
|
|
1413
|
+
*
|
|
1414
|
+
* | Experience | Action | What the customer sees |
|
|
1415
|
+
* |---|---|---|
|
|
1416
|
+
* | `agentpay` | `request_payment` | A payment request they can pay in the app. Turns itself into "Paid" in place once it settles. |
|
|
1417
|
+
* | `agentcard` | `attach_card` | A prompt to add a card to their wallet. |
|
|
1418
|
+
* | `agentcard` | `approve_card` | A passkey approval for a virtual card. |
|
|
1419
|
+
* | `link` | `open` | A card that opens a URL you supply. |
|
|
1420
|
+
*
|
|
1421
|
+
* `GET /v3/experiences` is the authoritative list for your account, with
|
|
1422
|
+
* every action and the fields each accepts — an action missing there cannot
|
|
1423
|
+
* be sent. Fields are display copy unless documented otherwise.
|
|
1424
|
+
*
|
|
1425
|
+
* ## Params are checked before the card is sent
|
|
1426
|
+
*
|
|
1427
|
+
* Unknown fields are **rejected rather than ignored**, so copy that would
|
|
1428
|
+
* never have rendered fails for you now instead of arriving wrong on
|
|
1429
|
+
* somebody's phone. Some fields are read rather than sent: `agentpay`'s
|
|
1430
|
+
* `request_payment` takes only a `checkout_url` and resolves the amount and
|
|
1431
|
+
* reason from that payment request, so a card can never claim a figure the
|
|
1432
|
+
* checkout will not charge.
|
|
1433
|
+
*
|
|
1434
|
+
* Cards are **iMessage-only**. Recipients without the app see a static
|
|
1435
|
+
* version built from the same copy; SMS and RCS recipients cannot receive
|
|
1436
|
+
* one at all (error codes 2018 and 4005).
|
|
1346
1437
|
*
|
|
1347
1438
|
*/
|
|
1348
1439
|
experiences: API.Experiences = new API.Experiences(this);
|
|
@@ -1704,9 +1795,19 @@ export declare namespace LinqAPIV3 {
|
|
|
1704
1795
|
|
|
1705
1796
|
export {
|
|
1706
1797
|
PhoneNumbers as PhoneNumbers,
|
|
1798
|
+
type ReputationActionItem as ReputationActionItem,
|
|
1799
|
+
type ReputationAudit as ReputationAudit,
|
|
1800
|
+
type ReputationAuditStarted as ReputationAuditStarted,
|
|
1801
|
+
type ReputationDriver as ReputationDriver,
|
|
1802
|
+
type ReputationDriverKey as ReputationDriverKey,
|
|
1803
|
+
type ReputationEvidence as ReputationEvidence,
|
|
1804
|
+
type ReputationOptOutChat as ReputationOptOutChat,
|
|
1805
|
+
type ReputationReport as ReputationReport,
|
|
1806
|
+
type ReputationUnhealthyChat as ReputationUnhealthyChat,
|
|
1707
1807
|
type PhoneNumberUpdateResponse as PhoneNumberUpdateResponse,
|
|
1708
1808
|
type PhoneNumberListResponse as PhoneNumberListResponse,
|
|
1709
1809
|
type PhoneNumberUpdateParams as PhoneNumberUpdateParams,
|
|
1810
|
+
type PhoneNumberGetReputationAuditParams as PhoneNumberGetReputationAuditParams,
|
|
1710
1811
|
};
|
|
1711
1812
|
|
|
1712
1813
|
export {
|
|
@@ -197,10 +197,9 @@ export class Attachments extends APIResource {
|
|
|
197
197
|
*
|
|
198
198
|
* ## Step 1: Request an upload URL
|
|
199
199
|
*
|
|
200
|
-
* Call
|
|
200
|
+
* Call `POST /v3/attachments` with file metadata:
|
|
201
201
|
*
|
|
202
202
|
* ```json
|
|
203
|
-
* POST /v3/attachments
|
|
204
203
|
* {
|
|
205
204
|
* "filename": "photo.jpg",
|
|
206
205
|
* "content_type": "image/jpeg",
|
|
@@ -231,11 +230,10 @@ export class Attachments extends APIResource {
|
|
|
231
230
|
*
|
|
232
231
|
* ## Step 3: Send a message with the attachment
|
|
233
232
|
*
|
|
234
|
-
* Reference the `attachment_id` in a media part
|
|
235
|
-
* as many messages as you want.
|
|
233
|
+
* Reference the `attachment_id` in a media part with `POST /v3/chats`. The ID
|
|
234
|
+
* never expires — use it in as many messages as you want.
|
|
236
235
|
*
|
|
237
236
|
* ```json
|
|
238
|
-
* POST /v3/chats
|
|
239
237
|
* {
|
|
240
238
|
* "from": "+15559876543",
|
|
241
239
|
* "to": ["+15551234567"],
|
|
@@ -481,11 +481,17 @@ export interface MediaPart {
|
|
|
481
481
|
* from/to).
|
|
482
482
|
*
|
|
483
483
|
* A message carries EITHER `parts` — text and attachments, which compose into one
|
|
484
|
-
* bubble — or a single `
|
|
485
|
-
* iMessage app. Never both: an app card is the whole message (Apple's
|
|
486
|
-
* cannot coexist with text), so copy and a card are two sends, not
|
|
484
|
+
* bubble — or a single `experience` invocation, which renders an experience inside
|
|
485
|
+
* Linq's iMessage app. Never both: an app card is the whole message (Apple's
|
|
486
|
+
* `MSMessage` cannot coexist with text), so copy and a card are two sends, not
|
|
487
|
+
* one.
|
|
487
488
|
*/
|
|
488
489
|
export interface MessageContent {
|
|
490
|
+
/**
|
|
491
|
+
* iMessage effect to apply to this message (screen or bubble effect)
|
|
492
|
+
*/
|
|
493
|
+
effect?: ResourcesMessagesAPI.MessageEffect;
|
|
494
|
+
|
|
489
495
|
/**
|
|
490
496
|
* Invokes an action on an experience — a third party that renders inside Linq's
|
|
491
497
|
* iMessage app. Linq resolves the recipient's connection, mints any session the
|
|
@@ -494,12 +500,7 @@ export interface MessageContent {
|
|
|
494
500
|
* Call `GET /v3/experiences/{experience}` for the actions you may invoke and the
|
|
495
501
|
* fields each accepts.
|
|
496
502
|
*/
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
/**
|
|
500
|
-
* iMessage effect to apply to this message (screen or bubble effect)
|
|
501
|
-
*/
|
|
502
|
-
effect?: ResourcesMessagesAPI.MessageEffect;
|
|
503
|
+
experience?: MessageContent.Experience;
|
|
503
504
|
|
|
504
505
|
/**
|
|
505
506
|
* Optional idempotency key for this message. Use this to prevent duplicate sends
|
|
@@ -570,16 +571,16 @@ export namespace MessageContent {
|
|
|
570
571
|
* Call `GET /v3/experiences/{experience}` for the actions you may invoke and the
|
|
571
572
|
* fields each accepts.
|
|
572
573
|
*/
|
|
573
|
-
export interface
|
|
574
|
+
export interface Experience {
|
|
574
575
|
/**
|
|
575
576
|
* Which of its actions, e.g. `attach_card`.
|
|
576
577
|
*/
|
|
577
578
|
action: string;
|
|
578
579
|
|
|
579
580
|
/**
|
|
580
|
-
* The experience to invoke, e.g. `agentcard`.
|
|
581
|
+
* The experience to invoke, e.g. `agentcard` or `agentpay`.
|
|
581
582
|
*/
|
|
582
|
-
|
|
583
|
+
name: string;
|
|
583
584
|
|
|
584
585
|
/**
|
|
585
586
|
* Values for the fields this action exposes. Keys are exactly the field names
|
|
@@ -587,6 +588,10 @@ export namespace MessageContent {
|
|
|
587
588
|
*
|
|
588
589
|
* Display copy only, except a `url`-type field — that value sets the destination,
|
|
589
590
|
* and must be an absolute `https` URL.
|
|
591
|
+
*
|
|
592
|
+
* Some fields are read rather than sent: `agentpay`'s `request_payment` takes only
|
|
593
|
+
* a `checkout_url` and resolves the amount and reason from that payment request
|
|
594
|
+
* itself, so the card cannot state a figure the checkout will not charge.
|
|
590
595
|
*/
|
|
591
596
|
params?: { [key: string]: unknown };
|
|
592
597
|
}
|
|
@@ -1033,9 +1038,10 @@ export interface ChatCreateParams {
|
|
|
1033
1038
|
* from/to).
|
|
1034
1039
|
*
|
|
1035
1040
|
* A message carries EITHER `parts` — text and attachments, which compose into one
|
|
1036
|
-
* bubble — or a single `
|
|
1037
|
-
* iMessage app. Never both: an app card is the whole message (Apple's
|
|
1038
|
-
* cannot coexist with text), so copy and a card are two sends, not
|
|
1041
|
+
* bubble — or a single `experience` invocation, which renders an experience inside
|
|
1042
|
+
* Linq's iMessage app. Never both: an app card is the whole message (Apple's
|
|
1043
|
+
* `MSMessage` cannot coexist with text), so copy and a card are two sends, not
|
|
1044
|
+
* one.
|
|
1039
1045
|
*/
|
|
1040
1046
|
message: MessageContent;
|
|
1041
1047
|
|
|
@@ -393,9 +393,10 @@ export interface MessageSendParams {
|
|
|
393
393
|
* from/to).
|
|
394
394
|
*
|
|
395
395
|
* A message carries EITHER `parts` — text and attachments, which compose into one
|
|
396
|
-
* bubble — or a single `
|
|
397
|
-
* iMessage app. Never both: an app card is the whole message (Apple's
|
|
398
|
-
* cannot coexist with text), so copy and a card are two sends, not
|
|
396
|
+
* bubble — or a single `experience` invocation, which renders an experience inside
|
|
397
|
+
* Linq's iMessage app. Never both: an app card is the whole message (Apple's
|
|
398
|
+
* `MSMessage` cannot coexist with text), so copy and a card are two sends, not
|
|
399
|
+
* one.
|
|
399
400
|
*/
|
|
400
401
|
message: ChatsAPI.MessageContent;
|
|
401
402
|
|