@inkbox/sdk 0.4.3 → 0.4.5
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/README.md +50 -11
- package/dist/agent_identity.d.ts +44 -18
- package/dist/agent_identity.d.ts.map +1 -1
- package/dist/agent_identity.js +48 -12
- package/dist/agent_identity.js.map +1 -1
- package/dist/identities/resources/identities.d.ts +42 -1
- package/dist/identities/resources/identities.d.ts.map +1 -1
- package/dist/identities/resources/identities.js +56 -1
- package/dist/identities/resources/identities.js.map +1 -1
- package/dist/identities/types.d.ts +22 -0
- package/dist/identities/types.d.ts.map +1 -1
- package/dist/identities/types.js +8 -0
- package/dist/identities/types.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/phone/resources/texts.d.ts +23 -18
- package/dist/phone/resources/texts.d.ts.map +1 -1
- package/dist/phone/resources/texts.js +37 -15
- package/dist/phone/resources/texts.js.map +1 -1
- package/dist/phone/types.d.ts +47 -4
- package/dist/phone/types.d.ts.map +1 -1
- package/dist/phone/types.js +24 -2
- package/dist/phone/types.js.map +1 -1
- package/dist/webhooks/types.d.ts +6 -2
- package/dist/webhooks/types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -165,6 +165,30 @@ await identity.releasePhoneNumber();
|
|
|
165
165
|
await identity.delete();
|
|
166
166
|
```
|
|
167
167
|
|
|
168
|
+
### Identity visibility
|
|
169
|
+
|
|
170
|
+
Control which other agent identities can see this identity in API responses.
|
|
171
|
+
Humans and admins always see every identity regardless.
|
|
172
|
+
|
|
173
|
+
```ts
|
|
174
|
+
const identity = await inkbox.getIdentity("sales-bot");
|
|
175
|
+
|
|
176
|
+
// List the current visibility rules. Either a single wildcard row
|
|
177
|
+
// (viewerIdentityId === null — every active identity sees it) or
|
|
178
|
+
// explicit per-viewer rows. An empty list means no agent can see it.
|
|
179
|
+
const rules = await identity.listAccess();
|
|
180
|
+
|
|
181
|
+
// Grant one viewer identity visibility
|
|
182
|
+
const viewer = await inkbox.getIdentity("support-bot");
|
|
183
|
+
await identity.grantAccess(viewer.id);
|
|
184
|
+
|
|
185
|
+
// Make it visible to every active identity in the org (wildcard)
|
|
186
|
+
await identity.grantAccess(null);
|
|
187
|
+
|
|
188
|
+
// Revoke one viewer (keyed by the viewer identity's UUID)
|
|
189
|
+
await identity.revokeAccess(viewer.id);
|
|
190
|
+
```
|
|
191
|
+
|
|
168
192
|
---
|
|
169
193
|
|
|
170
194
|
## Mail
|
|
@@ -282,17 +306,17 @@ Send and receive SMS/MMS through the identity's assigned phone number.
|
|
|
282
306
|
**Outbound SMS rules (read before sending):**
|
|
283
307
|
|
|
284
308
|
- Outbound SMS is currently allowed only from **local** numbers, not toll-free.
|
|
285
|
-
- Each sender phone number is rate-limited to **
|
|
309
|
+
- Each sender phone number is rate-limited to **100 recipient sends per rolling 24-hour window**. A 3-recipient group message counts as 3 recipient sends. A single accepted send may push usage past the cap; the next capped send returns `429 sender_rate_limited`.
|
|
286
310
|
- A new local number takes **~10-15 minutes** for the 10DLC campaign to propagate at the carrier — `phoneNumber.smsStatus` reads `"pending"` until then, and sends will return `409 sender_sms_pending`.
|
|
287
311
|
- The recipient must have texted **`START`** to any number within your organization to opt in. Unknown recipients will fail with `403 recipient_not_opted_in`; recipients who later send `STOP` flip to `403 recipient_opted_out`. You can inspect consent state directly via `inkbox.smsOptIns` — see [SMS Opt-Ins](#sms-opt-ins).
|
|
312
|
+
- **Beta:** Group MMS and conversation sends are beta. Some carriers may reject group chats or MMS from 10DLC numbers even when the sender is ready and recipients have opted in.
|
|
288
313
|
|
|
289
|
-
|
|
314
|
+
Customer-managed 10DLC brands and campaigns lift the default per-number cap to the carrier-assigned tier. Toll-free SMS sending is still coming soon.
|
|
290
315
|
|
|
291
|
-
|
|
292
|
-
- Customer-managed 10DLC brands and campaigns, which lift the per-number 24-hour limit dramatically.
|
|
316
|
+
**TypeScript users:** group rows can legitimately have no single remote party, so text/conversation/webhook `remotePhoneNumber` / `remote_phone_number` fields are typed as `string | null`. One-to-one traffic still populates the remote number.
|
|
293
317
|
|
|
294
318
|
```ts
|
|
295
|
-
// Send
|
|
319
|
+
// Send SMS/MMS. Returns a queued TextMessage; final delivery state arrives
|
|
296
320
|
// via the incomingTextWebhookUrl configured on the sender.
|
|
297
321
|
const sent = await identity.sendText({
|
|
298
322
|
to: "+15551234567",
|
|
@@ -300,6 +324,20 @@ const sent = await identity.sendText({
|
|
|
300
324
|
});
|
|
301
325
|
console.log(sent.id, sent.deliveryStatus); // "queued"
|
|
302
326
|
|
|
327
|
+
// Group MMS uses the same method with an array of recipients.
|
|
328
|
+
const group = await identity.sendText({
|
|
329
|
+
to: ["+15551234567", "+15557654321"],
|
|
330
|
+
text: "Hello group",
|
|
331
|
+
mediaUrls: ["https://example.com/photo.jpg"],
|
|
332
|
+
});
|
|
333
|
+
console.log(group.conversationId, group.recipients);
|
|
334
|
+
|
|
335
|
+
// Reply to an existing conversation by UUID. Do not pass `to` with this form.
|
|
336
|
+
const reply = await identity.sendText({
|
|
337
|
+
conversationId: group.conversationId,
|
|
338
|
+
text: "Following up in the same conversation.",
|
|
339
|
+
});
|
|
340
|
+
|
|
303
341
|
// List text messages
|
|
304
342
|
const texts = await identity.listTexts({ limit: 20 });
|
|
305
343
|
for (const t of texts) {
|
|
@@ -318,13 +356,13 @@ if (text.media) { // MMS attachments (temporary signed URLs)
|
|
|
318
356
|
}
|
|
319
357
|
}
|
|
320
358
|
|
|
321
|
-
// List conversation summaries
|
|
322
|
-
const convos = await identity.listTextConversations({ limit: 20 });
|
|
359
|
+
// List one-to-one conversation summaries; opt into groups explicitly.
|
|
360
|
+
const convos = await identity.listTextConversations({ limit: 20, includeGroups: true });
|
|
323
361
|
for (const c of convos) {
|
|
324
|
-
console.log(c.
|
|
362
|
+
console.log(c.id, c.participants, c.latestHasMedia, c.latestText);
|
|
325
363
|
}
|
|
326
364
|
|
|
327
|
-
// Get messages in a specific conversation
|
|
365
|
+
// Get messages in a specific conversation by remote number or conversation UUID.
|
|
328
366
|
const msgs = await identity.getTextConversation("+15551234567", { limit: 50 });
|
|
329
367
|
|
|
330
368
|
// Mark as read
|
|
@@ -732,7 +770,7 @@ await inkbox.phoneNumbers.update(number.id, {
|
|
|
732
770
|
});
|
|
733
771
|
```
|
|
734
772
|
|
|
735
|
-
The inbound-call payload is flat — no envelope — and carries a singular `contact: { id, name } | null` at the top level. Text payloads use the standard envelope with `data.contact`
|
|
773
|
+
The inbound-call payload is flat — no envelope — and carries a singular `contact: { id, name } | null` at the top level. Text payloads use the standard envelope with `data.contact` and `data.text_message`. One-to-one text events keep `remote_phone_number`; group outbound rows use `conversation_id`, `sender_phone_number`, and `recipients[]`, with per-recipient lifecycle webhooks naming the event target in `data.recipient_phone_number`. The text-message body includes the full delivery-state block (`delivery_status`, `error_code`, `error_detail`, `sent_at`, `delivered_at`, `failed_at`) so receivers can act on outbound failures without a follow-up API call.
|
|
736
774
|
|
|
737
775
|
### Receiving webhooks (typed)
|
|
738
776
|
|
|
@@ -765,7 +803,8 @@ app.post("/hooks/text", express.raw({ type: "*/*" }), (req, res) => {
|
|
|
765
803
|
switch (payload.event_type) {
|
|
766
804
|
case "text.delivery_failed": {
|
|
767
805
|
const m = payload.data.text_message;
|
|
768
|
-
|
|
806
|
+
const recipient = payload.data.recipient_phone_number ?? m.remote_phone_number;
|
|
807
|
+
console.error(`SMS to ${recipient} failed`, m.error_code, m.error_detail);
|
|
769
808
|
break;
|
|
770
809
|
}
|
|
771
810
|
case "text.delivered":
|
package/dist/agent_identity.d.ts
CHANGED
|
@@ -13,8 +13,8 @@ import type { TOTPCode, TOTPConfig } from "./vault/totp.js";
|
|
|
13
13
|
import type { DecryptedVaultSecret, SecretPayload, VaultSecret } from "./vault/types.js";
|
|
14
14
|
import { ForwardMode, MessageDirection } from "./mail/types.js";
|
|
15
15
|
import type { Message, MessageDetail, ThreadDetail } from "./mail/types.js";
|
|
16
|
-
import type { PhoneCall, PhoneCallWithRateLimit, PhoneTranscript, TextConversationSummary, TextMessage } from "./phone/types.js";
|
|
17
|
-
import type { _AgentIdentityData, IdentityMailbox, IdentityPhoneNumber } from "./identities/types.js";
|
|
16
|
+
import type { PhoneCall, PhoneCallWithRateLimit, PhoneTranscript, TextConversationSummary, TextConversationUpdateResult, TextMessage } from "./phone/types.js";
|
|
17
|
+
import type { _AgentIdentityData, IdentityAccess, IdentityMailbox, IdentityPhoneNumber } from "./identities/types.js";
|
|
18
18
|
import type { Tunnel } from "./tunnels/types.js";
|
|
19
19
|
import type { Inkbox } from "./inkbox.js";
|
|
20
20
|
export declare class AgentIdentity {
|
|
@@ -129,6 +129,27 @@ export declare class AgentIdentity {
|
|
|
129
129
|
* Release this identity's phone number (vendor + local).
|
|
130
130
|
*/
|
|
131
131
|
releasePhoneNumber(): Promise<void>;
|
|
132
|
+
/**
|
|
133
|
+
* List who can see this identity.
|
|
134
|
+
*
|
|
135
|
+
* See {@link IdentitiesResource.listAccess}.
|
|
136
|
+
*/
|
|
137
|
+
listAccess(): Promise<IdentityAccess[]>;
|
|
138
|
+
/**
|
|
139
|
+
* Grant visibility on this identity.
|
|
140
|
+
*
|
|
141
|
+
* @param viewerIdentityId - UUID of the viewer identity to grant, or
|
|
142
|
+
* `null` to reset this identity to the org-wide wildcard (every
|
|
143
|
+
* active identity in the org sees it).
|
|
144
|
+
*/
|
|
145
|
+
grantAccess(viewerIdentityId: string | null): Promise<IdentityAccess>;
|
|
146
|
+
/**
|
|
147
|
+
* Revoke one viewer's visibility on this identity.
|
|
148
|
+
*
|
|
149
|
+
* @param viewerIdentityId - UUID of the viewer identity to drop
|
|
150
|
+
* (the viewer identity's UUID, not an access-row id).
|
|
151
|
+
*/
|
|
152
|
+
revokeAccess(viewerIdentityId: string): Promise<void>;
|
|
132
153
|
/**
|
|
133
154
|
* Send an email from this identity's mailbox.
|
|
134
155
|
*
|
|
@@ -269,7 +290,7 @@ export declare class AgentIdentity {
|
|
|
269
290
|
*/
|
|
270
291
|
listTranscripts(callId: string): Promise<PhoneTranscript[]>;
|
|
271
292
|
/**
|
|
272
|
-
* Send an outbound SMS from this identity's phone number.
|
|
293
|
+
* Send an outbound SMS/MMS from this identity's phone number.
|
|
273
294
|
*
|
|
274
295
|
* The returned message is in `queued` state. The full outbound
|
|
275
296
|
* lifecycle (`text.sent` → `text.delivered` / `text.delivery_failed`
|
|
@@ -278,8 +299,12 @@ export declare class AgentIdentity {
|
|
|
278
299
|
* `TextWebhookEventType` and `TextWebhookPayload` for the typed
|
|
279
300
|
* receiver-side shapes.
|
|
280
301
|
*
|
|
281
|
-
* @param options.to - E.164 destination number
|
|
282
|
-
*
|
|
302
|
+
* @param options.to - E.164 destination number, or numbers for a group send.
|
|
303
|
+
* Mutually exclusive with `conversationId`.
|
|
304
|
+
* @param options.conversationId - Existing conversation UUID to reply into.
|
|
305
|
+
* The server resolves it to that conversation's participants.
|
|
306
|
+
* @param options.text - Message body.
|
|
307
|
+
* @param options.mediaUrls - MMS media URLs.
|
|
283
308
|
*
|
|
284
309
|
* @throws {InkboxError} when this identity has no phone number.
|
|
285
310
|
* @throws {RecipientBlockedError} when the destination is blocked by an
|
|
@@ -287,8 +312,10 @@ export declare class AgentIdentity {
|
|
|
287
312
|
* @throws {InkboxAPIError} for other send failures.
|
|
288
313
|
*/
|
|
289
314
|
sendText(options: {
|
|
290
|
-
to
|
|
291
|
-
|
|
315
|
+
to?: string | string[] | null;
|
|
316
|
+
conversationId?: string | null;
|
|
317
|
+
text?: string | null;
|
|
318
|
+
mediaUrls?: string[] | null;
|
|
292
319
|
}): Promise<TextMessage>;
|
|
293
320
|
/**
|
|
294
321
|
* List text messages for this identity's phone number.
|
|
@@ -315,7 +342,7 @@ export declare class AgentIdentity {
|
|
|
315
342
|
*/
|
|
316
343
|
getText(textId: string): Promise<TextMessage>;
|
|
317
344
|
/**
|
|
318
|
-
* List text conversations
|
|
345
|
+
* List text conversations.
|
|
319
346
|
*
|
|
320
347
|
* Identity-scoped credentials never see blocked rows in conversation
|
|
321
348
|
* summaries; admin/JWT can pass `isBlocked=false` to hide spam-only
|
|
@@ -326,20 +353,23 @@ export declare class AgentIdentity {
|
|
|
326
353
|
* @param options.offset - Pagination offset. Defaults to 0.
|
|
327
354
|
* @param options.isBlocked - Tri-state filter. `true` for only blocked,
|
|
328
355
|
* `false` for only non-blocked, omit for all.
|
|
356
|
+
* @param options.includeGroups - Include group conversations. Defaults to
|
|
357
|
+
* false so old clients continue to see one-to-one rows only.
|
|
329
358
|
*/
|
|
330
359
|
listTextConversations(options?: {
|
|
331
360
|
limit?: number;
|
|
332
361
|
offset?: number;
|
|
333
362
|
isBlocked?: boolean;
|
|
363
|
+
includeGroups?: boolean;
|
|
334
364
|
}): Promise<TextConversationSummary[]>;
|
|
335
365
|
/**
|
|
336
|
-
* Get all messages
|
|
366
|
+
* Get all messages in a conversation.
|
|
337
367
|
*
|
|
338
|
-
* @param
|
|
368
|
+
* @param conversationKey - E.164 one-to-one remote number, or conversation UUID.
|
|
339
369
|
* @param options.limit - Maximum number of results. Defaults to 50.
|
|
340
370
|
* @param options.offset - Pagination offset. Defaults to 0.
|
|
341
371
|
*/
|
|
342
|
-
getTextConversation(
|
|
372
|
+
getTextConversation(conversationKey: string, options?: {
|
|
343
373
|
limit?: number;
|
|
344
374
|
offset?: number;
|
|
345
375
|
}): Promise<TextMessage[]>;
|
|
@@ -352,14 +382,10 @@ export declare class AgentIdentity {
|
|
|
352
382
|
/**
|
|
353
383
|
* Mark all messages in a conversation as read.
|
|
354
384
|
*
|
|
355
|
-
* @param
|
|
356
|
-
* @returns Object with `remotePhoneNumber`, `isRead`, and `updatedCount`.
|
|
385
|
+
* @param conversationKey - E.164 one-to-one remote number, or conversation UUID.
|
|
386
|
+
* @returns Object with `conversationId`, `remotePhoneNumber`, `isRead`, and `updatedCount`.
|
|
357
387
|
*/
|
|
358
|
-
markTextConversationRead(
|
|
359
|
-
remotePhoneNumber: string;
|
|
360
|
-
isRead: boolean;
|
|
361
|
-
updatedCount: number;
|
|
362
|
-
}>;
|
|
388
|
+
markTextConversationRead(conversationKey: string): Promise<TextConversationUpdateResult>;
|
|
363
389
|
/**
|
|
364
390
|
* Update this identity's handle, display name, description, and/or status.
|
|
365
391
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent_identity.d.ts","sourceRoot":"","sources":["../src/agent_identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,KAAK,EACV,SAAS,EACT,sBAAsB,EACtB,eAAe,EACf,uBAAuB,EACvB,WAAW,EACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EACV,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,qBAAa,aAAa;IACxB,OAAO,CAAC,KAAK,CAAqB;IAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAyB;IACzC,OAAO,CAAC,YAAY,CAA6B;IACjD,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,YAAY,CAA4B;IAChD,OAAO,CAAC,oBAAoB,CAAuB;gBAEvC,IAAI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,CAAC,WAAW,CAAC;IAOxD;;;;;OAKG;IACG,wBAAwB,CAC5B,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,4BAA4B,CAAC;IAaxC;;;;;;;;;;;;OAYG;IACG,MAAM,CAAC,OAAO,EAAE;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAC5B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAC5B,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;KAC9B,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBjB;;;;;;;;OAQG;IACG,OAAO,IAAI,OAAO,CAAC,aAAa,CAAC;IAUvC;;;;;;OAMG;IACG,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ7B,OAAO,CAAC,qBAAqB;IAQ7B,OAAO,CAAC,eAAe;IAQvB,OAAO,CAAC,aAAa;CAQtB"}
|
package/dist/agent_identity.js
CHANGED
|
@@ -186,6 +186,36 @@ export class AgentIdentity {
|
|
|
186
186
|
this._phoneNumber = null;
|
|
187
187
|
}
|
|
188
188
|
// ------------------------------------------------------------------
|
|
189
|
+
// Identity access / visibility
|
|
190
|
+
// ------------------------------------------------------------------
|
|
191
|
+
/**
|
|
192
|
+
* List who can see this identity.
|
|
193
|
+
*
|
|
194
|
+
* See {@link IdentitiesResource.listAccess}.
|
|
195
|
+
*/
|
|
196
|
+
async listAccess() {
|
|
197
|
+
return this._inkbox._idsResource.listAccess(this.agentHandle);
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Grant visibility on this identity.
|
|
201
|
+
*
|
|
202
|
+
* @param viewerIdentityId - UUID of the viewer identity to grant, or
|
|
203
|
+
* `null` to reset this identity to the org-wide wildcard (every
|
|
204
|
+
* active identity in the org sees it).
|
|
205
|
+
*/
|
|
206
|
+
async grantAccess(viewerIdentityId) {
|
|
207
|
+
return this._inkbox._idsResource.grantAccess(this.agentHandle, viewerIdentityId);
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Revoke one viewer's visibility on this identity.
|
|
211
|
+
*
|
|
212
|
+
* @param viewerIdentityId - UUID of the viewer identity to drop
|
|
213
|
+
* (the viewer identity's UUID, not an access-row id).
|
|
214
|
+
*/
|
|
215
|
+
async revokeAccess(viewerIdentityId) {
|
|
216
|
+
await this._inkbox._idsResource.revokeAccess(this.agentHandle, viewerIdentityId);
|
|
217
|
+
}
|
|
218
|
+
// ------------------------------------------------------------------
|
|
189
219
|
// Mail helpers
|
|
190
220
|
// ------------------------------------------------------------------
|
|
191
221
|
/**
|
|
@@ -331,7 +361,7 @@ export class AgentIdentity {
|
|
|
331
361
|
// Text message helpers
|
|
332
362
|
// ------------------------------------------------------------------
|
|
333
363
|
/**
|
|
334
|
-
* Send an outbound SMS from this identity's phone number.
|
|
364
|
+
* Send an outbound SMS/MMS from this identity's phone number.
|
|
335
365
|
*
|
|
336
366
|
* The returned message is in `queued` state. The full outbound
|
|
337
367
|
* lifecycle (`text.sent` → `text.delivered` / `text.delivery_failed`
|
|
@@ -340,8 +370,12 @@ export class AgentIdentity {
|
|
|
340
370
|
* `TextWebhookEventType` and `TextWebhookPayload` for the typed
|
|
341
371
|
* receiver-side shapes.
|
|
342
372
|
*
|
|
343
|
-
* @param options.to - E.164 destination number
|
|
344
|
-
*
|
|
373
|
+
* @param options.to - E.164 destination number, or numbers for a group send.
|
|
374
|
+
* Mutually exclusive with `conversationId`.
|
|
375
|
+
* @param options.conversationId - Existing conversation UUID to reply into.
|
|
376
|
+
* The server resolves it to that conversation's participants.
|
|
377
|
+
* @param options.text - Message body.
|
|
378
|
+
* @param options.mediaUrls - MMS media URLs.
|
|
345
379
|
*
|
|
346
380
|
* @throws {InkboxError} when this identity has no phone number.
|
|
347
381
|
* @throws {RecipientBlockedError} when the destination is blocked by an
|
|
@@ -378,7 +412,7 @@ export class AgentIdentity {
|
|
|
378
412
|
return this._inkbox._texts.get(this._phoneNumber.id, textId);
|
|
379
413
|
}
|
|
380
414
|
/**
|
|
381
|
-
* List text conversations
|
|
415
|
+
* List text conversations.
|
|
382
416
|
*
|
|
383
417
|
* Identity-scoped credentials never see blocked rows in conversation
|
|
384
418
|
* summaries; admin/JWT can pass `isBlocked=false` to hide spam-only
|
|
@@ -389,21 +423,23 @@ export class AgentIdentity {
|
|
|
389
423
|
* @param options.offset - Pagination offset. Defaults to 0.
|
|
390
424
|
* @param options.isBlocked - Tri-state filter. `true` for only blocked,
|
|
391
425
|
* `false` for only non-blocked, omit for all.
|
|
426
|
+
* @param options.includeGroups - Include group conversations. Defaults to
|
|
427
|
+
* false so old clients continue to see one-to-one rows only.
|
|
392
428
|
*/
|
|
393
429
|
async listTextConversations(options) {
|
|
394
430
|
this._requirePhone();
|
|
395
431
|
return this._inkbox._texts.listConversations(this._phoneNumber.id, options);
|
|
396
432
|
}
|
|
397
433
|
/**
|
|
398
|
-
* Get all messages
|
|
434
|
+
* Get all messages in a conversation.
|
|
399
435
|
*
|
|
400
|
-
* @param
|
|
436
|
+
* @param conversationKey - E.164 one-to-one remote number, or conversation UUID.
|
|
401
437
|
* @param options.limit - Maximum number of results. Defaults to 50.
|
|
402
438
|
* @param options.offset - Pagination offset. Defaults to 0.
|
|
403
439
|
*/
|
|
404
|
-
async getTextConversation(
|
|
440
|
+
async getTextConversation(conversationKey, options) {
|
|
405
441
|
this._requirePhone();
|
|
406
|
-
return this._inkbox._texts.getConversation(this._phoneNumber.id,
|
|
442
|
+
return this._inkbox._texts.getConversation(this._phoneNumber.id, conversationKey, options);
|
|
407
443
|
}
|
|
408
444
|
/**
|
|
409
445
|
* Mark a single text message as read.
|
|
@@ -419,12 +455,12 @@ export class AgentIdentity {
|
|
|
419
455
|
/**
|
|
420
456
|
* Mark all messages in a conversation as read.
|
|
421
457
|
*
|
|
422
|
-
* @param
|
|
423
|
-
* @returns Object with `remotePhoneNumber`, `isRead`, and `updatedCount`.
|
|
458
|
+
* @param conversationKey - E.164 one-to-one remote number, or conversation UUID.
|
|
459
|
+
* @returns Object with `conversationId`, `remotePhoneNumber`, `isRead`, and `updatedCount`.
|
|
424
460
|
*/
|
|
425
|
-
async markTextConversationRead(
|
|
461
|
+
async markTextConversationRead(conversationKey) {
|
|
426
462
|
this._requirePhone();
|
|
427
|
-
return this._inkbox._texts.updateConversation(this._phoneNumber.id,
|
|
463
|
+
return this._inkbox._texts.updateConversation(this._phoneNumber.id, conversationKey, { isRead: true });
|
|
428
464
|
}
|
|
429
465
|
// ------------------------------------------------------------------
|
|
430
466
|
// Identity management
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent_identity.js","sourceRoot":"","sources":["../src/agent_identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAkB,WAAW,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"agent_identity.js","sourceRoot":"","sources":["../src/agent_identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAkB,WAAW,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAsB/C,MAAM,OAAO,aAAa;IAChB,KAAK,CAAqB;IACjB,OAAO,CAAS;IACzB,QAAQ,CAAyB;IACjC,YAAY,CAA6B;IACzC,OAAO,CAAgB;IACvB,YAAY,GAAuB,IAAI,CAAC;IACxC,oBAAoB,GAAkB,IAAI,CAAC,CAAC,yCAAyC;IAE7F,YAAY,IAAwB,EAAE,MAAc;QAClD,IAAI,CAAC,KAAK,GAAgB,IAAI,CAAC;QAC/B,IAAI,CAAC,OAAO,GAAc,MAAM,CAAC;QACjC,IAAI,CAAC,QAAQ,GAAa,IAAI,CAAC,OAAO,CAAC;QACvC,IAAI,CAAC,YAAY,GAAS,IAAI,CAAC,WAAW,CAAC;QAC3C,IAAI,CAAC,OAAO,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AC,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC3D,CAAC;IAED,qEAAqE;IACrE,kBAAkB;IAClB,qEAAqE;IAE7D,qBAAqB;QAC3B,IAAI,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,SAAS,KAAK,IAAI,EAAE,CAAC;YACnD,MAAM,IAAI,WAAW,CACnB,gGAAgG,CACjG,CAAC;QACJ,CAAC;IACH,CAAC;IAEO,eAAe;QACrB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,MAAM,IAAI,WAAW,CACnB,aAAa,IAAI,CAAC,WAAW,yEAAyE,CACvG,CAAC;QACJ,CAAC;IACH,CAAC;IAEO,aAAa;QACnB,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YACvB,MAAM,IAAI,WAAW,CACnB,aAAa,IAAI,CAAC,WAAW,sHAAsH,CACpJ,CAAC;QACJ,CAAC;IACH,CAAC;CAEF"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* or tunnel create / link surface.
|
|
8
8
|
*/
|
|
9
9
|
import { HttpTransport } from "../../_http.js";
|
|
10
|
-
import { AgentIdentitySummary, IdentityMailboxCreateOptions, IdentityPhoneNumberCreateOptions, IdentityTunnelCreateOptions, _AgentIdentityData } from "../types.js";
|
|
10
|
+
import { AgentIdentitySummary, IdentityAccess, IdentityMailboxCreateOptions, IdentityPhoneNumberCreateOptions, IdentityTunnelCreateOptions, _AgentIdentityData } from "../types.js";
|
|
11
11
|
export declare class IdentitiesResource {
|
|
12
12
|
private readonly http;
|
|
13
13
|
constructor(http: HttpTransport);
|
|
@@ -85,5 +85,46 @@ export declare class IdentitiesResource {
|
|
|
85
85
|
* @param agentHandle - Handle of the identity.
|
|
86
86
|
*/
|
|
87
87
|
releasePhoneNumber(agentHandle: string): Promise<void>;
|
|
88
|
+
/**
|
|
89
|
+
* List who can see this identity (agent visibility).
|
|
90
|
+
*
|
|
91
|
+
* Returns either a single wildcard row (`viewerIdentityId === null` —
|
|
92
|
+
* every active identity in the org sees it) or explicit per-viewer
|
|
93
|
+
* rows. An empty list means no scoped agent can see this identity
|
|
94
|
+
* (humans and admins always see it).
|
|
95
|
+
*
|
|
96
|
+
* Requires an admin-scoped API key; agent-scoped keys get a 403.
|
|
97
|
+
*
|
|
98
|
+
* @param agentHandle - Handle of the target identity.
|
|
99
|
+
*/
|
|
100
|
+
listAccess(agentHandle: string): Promise<IdentityAccess[]>;
|
|
101
|
+
/**
|
|
102
|
+
* Grant visibility on this identity.
|
|
103
|
+
*
|
|
104
|
+
* Requires an admin-scoped API key; agent-scoped keys get a 403.
|
|
105
|
+
*
|
|
106
|
+
* @param agentHandle - Handle of the target identity.
|
|
107
|
+
* @param viewerIdentityId - UUID of the viewer identity to grant, or
|
|
108
|
+
* `null` to reset the target to the org-wide wildcard (every active
|
|
109
|
+
* identity in the org sees it).
|
|
110
|
+
* @throws {RedundantContactAccessGrantError} 409 when granting a
|
|
111
|
+
* per-viewer UUID against a target that is already a wildcard.
|
|
112
|
+
* @throws {InkboxAPIError} 403 if the API key is not admin-scoped; 409
|
|
113
|
+
* if the viewer is already granted; 404 if the viewer identity does
|
|
114
|
+
* not exist; 422 if the viewer is the target itself.
|
|
115
|
+
*/
|
|
116
|
+
grantAccess(agentHandle: string, viewerIdentityId: string | null): Promise<IdentityAccess>;
|
|
117
|
+
/**
|
|
118
|
+
* Revoke one viewer's visibility on this identity.
|
|
119
|
+
*
|
|
120
|
+
* Requires an admin-scoped API key; agent-scoped keys get a 403.
|
|
121
|
+
*
|
|
122
|
+
* @param agentHandle - Handle of the target identity.
|
|
123
|
+
* @param viewerIdentityId - UUID of the viewer identity to drop. This
|
|
124
|
+
* is the viewer identity's UUID, not an access-row id.
|
|
125
|
+
* @throws {InkboxAPIError} 403 if the API key is not admin-scoped; 404
|
|
126
|
+
* when there is nothing to drop.
|
|
127
|
+
*/
|
|
128
|
+
revokeAccess(agentHandle: string, viewerIdentityId: string): Promise<void>;
|
|
88
129
|
}
|
|
89
130
|
//# sourceMappingURL=identities.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identities.d.ts","sourceRoot":"","sources":["../../../src/identities/resources/identities.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAAkB,MAAM,gBAAgB,CAAC;AAE/D,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC5B,gCAAgC,EAChC,2BAA2B,EAC3B,kBAAkB,
|
|
1
|
+
{"version":3,"file":"identities.d.ts","sourceRoot":"","sources":["../../../src/identities/resources/identities.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAAkB,MAAM,gBAAgB,CAAC;AAE/D,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,4BAA4B,EAC5B,gCAAgC,EAChC,2BAA2B,EAC3B,kBAAkB,EAWnB,MAAM,aAAa,CAAC;AAErB,qBAAa,kBAAkB;IACjB,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,aAAa;IAEhD;;;;;;;;;;;;;;;;;OAiBG;IACG,MAAM,CAAC,OAAO,EAAE;QACpB,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAC5B,OAAO,CAAC,EAAE,4BAA4B,CAAC;QACvC,MAAM,CAAC,EAAE,2BAA2B,CAAC;QACrC,WAAW,CAAC,EAAE,gCAAgC,CAAC;QAC/C,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,GAAG,GAAG,KAAK,CAAC;KAClD,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAiB/B,iDAAiD;IAC3C,IAAI,IAAI,OAAO,CAAC,oBAAoB,EAAE,CAAC;IAK7C;;;;OAIG;IACG,GAAG,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAK3D;;;;;;;;;;;;;OAaG;IACG,MAAM,CACV,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAC5B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAC5B,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;KAC9B,GACA,OAAO,CAAC,oBAAoB,CAAC;IAehC;;;;;;;;OAQG;IACG,MAAM,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIhD;;;;;;;OAOG;IACG,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI5D;;;;;;;;;;;OAWG;IACG,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAKhE;;;;;;;;;;;;;;OAcG;IACG,WAAW,CACf,WAAW,EAAE,MAAM,EACnB,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAC9B,OAAO,CAAC,cAAc,CAAC;IAc1B;;;;;;;;;;OAUG;IACG,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGjF"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { InkboxAPIError } from "../../_http.js";
|
|
10
10
|
import { mapIdentityConflictError } from "../exceptions.js";
|
|
11
|
-
import { identityMailboxCreateOptionsToWire, identityPhoneNumberCreateOptionsToWire, identityTunnelCreateOptionsToWire, parseAgentIdentitySummary, parseAgentIdentityData, vaultSecretIdsToWire, } from "../types.js";
|
|
11
|
+
import { identityMailboxCreateOptionsToWire, identityPhoneNumberCreateOptionsToWire, identityTunnelCreateOptionsToWire, parseAgentIdentitySummary, parseAgentIdentityData, parseIdentityAccess, vaultSecretIdsToWire, } from "../types.js";
|
|
12
12
|
export class IdentitiesResource {
|
|
13
13
|
http;
|
|
14
14
|
constructor(http) {
|
|
@@ -127,5 +127,60 @@ export class IdentitiesResource {
|
|
|
127
127
|
async releasePhoneNumber(agentHandle) {
|
|
128
128
|
await this.http.delete(`/${agentHandle}/phone_number`);
|
|
129
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* List who can see this identity (agent visibility).
|
|
132
|
+
*
|
|
133
|
+
* Returns either a single wildcard row (`viewerIdentityId === null` —
|
|
134
|
+
* every active identity in the org sees it) or explicit per-viewer
|
|
135
|
+
* rows. An empty list means no scoped agent can see this identity
|
|
136
|
+
* (humans and admins always see it).
|
|
137
|
+
*
|
|
138
|
+
* Requires an admin-scoped API key; agent-scoped keys get a 403.
|
|
139
|
+
*
|
|
140
|
+
* @param agentHandle - Handle of the target identity.
|
|
141
|
+
*/
|
|
142
|
+
async listAccess(agentHandle) {
|
|
143
|
+
const data = await this.http.get(`/${agentHandle}/access`);
|
|
144
|
+
return data.map(parseIdentityAccess);
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Grant visibility on this identity.
|
|
148
|
+
*
|
|
149
|
+
* Requires an admin-scoped API key; agent-scoped keys get a 403.
|
|
150
|
+
*
|
|
151
|
+
* @param agentHandle - Handle of the target identity.
|
|
152
|
+
* @param viewerIdentityId - UUID of the viewer identity to grant, or
|
|
153
|
+
* `null` to reset the target to the org-wide wildcard (every active
|
|
154
|
+
* identity in the org sees it).
|
|
155
|
+
* @throws {RedundantContactAccessGrantError} 409 when granting a
|
|
156
|
+
* per-viewer UUID against a target that is already a wildcard.
|
|
157
|
+
* @throws {InkboxAPIError} 403 if the API key is not admin-scoped; 409
|
|
158
|
+
* if the viewer is already granted; 404 if the viewer identity does
|
|
159
|
+
* not exist; 422 if the viewer is the target itself.
|
|
160
|
+
*/
|
|
161
|
+
async grantAccess(agentHandle, viewerIdentityId) {
|
|
162
|
+
// Deliberately NOT wrapped in mapIdentityConflictError (unlike
|
|
163
|
+
// create / update): that mapper blind-converts every 409 to
|
|
164
|
+
// HandleUnavailableError, which is only right when the sole
|
|
165
|
+
// possible 409 is a handle collision. This route's 409s are not
|
|
166
|
+
// collisions, and the wrapper would also downgrade the
|
|
167
|
+
// RedundantContactAccessGrantError the transport already raised.
|
|
168
|
+
const data = await this.http.post(`/${agentHandle}/access`, { viewer_identity_id: viewerIdentityId });
|
|
169
|
+
return parseIdentityAccess(data);
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Revoke one viewer's visibility on this identity.
|
|
173
|
+
*
|
|
174
|
+
* Requires an admin-scoped API key; agent-scoped keys get a 403.
|
|
175
|
+
*
|
|
176
|
+
* @param agentHandle - Handle of the target identity.
|
|
177
|
+
* @param viewerIdentityId - UUID of the viewer identity to drop. This
|
|
178
|
+
* is the viewer identity's UUID, not an access-row id.
|
|
179
|
+
* @throws {InkboxAPIError} 403 if the API key is not admin-scoped; 404
|
|
180
|
+
* when there is nothing to drop.
|
|
181
|
+
*/
|
|
182
|
+
async revokeAccess(agentHandle, viewerIdentityId) {
|
|
183
|
+
await this.http.delete(`/${agentHandle}/access/${viewerIdentityId}`);
|
|
184
|
+
}
|
|
130
185
|
}
|
|
131
186
|
//# sourceMappingURL=identities.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identities.js","sourceRoot":"","sources":["../../../src/identities/resources/identities.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAiB,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,
|
|
1
|
+
{"version":3,"file":"identities.js","sourceRoot":"","sources":["../../../src/identities/resources/identities.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAiB,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,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gBAAgB,EAAE,CAAC,CAAC;IACvE,CAAC;CACF"}
|
|
@@ -119,6 +119,21 @@ export interface _AgentIdentityData extends AgentIdentitySummary {
|
|
|
119
119
|
/** Tunnel assigned to this identity. Non-null for live identities (1:1 invariant); null only on deleted rows. */
|
|
120
120
|
tunnel: Tunnel | null;
|
|
121
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* A single identity-visibility grant on a target identity.
|
|
124
|
+
*
|
|
125
|
+
* `viewerIdentityId === null` is the wildcard sentinel — every active
|
|
126
|
+
* identity in the org can see the target. Otherwise it is a per-viewer
|
|
127
|
+
* grant naming exactly one viewer identity.
|
|
128
|
+
*/
|
|
129
|
+
export interface IdentityAccess {
|
|
130
|
+
id: string;
|
|
131
|
+
/** The identity whose visibility this grant controls. */
|
|
132
|
+
targetIdentityId: string;
|
|
133
|
+
/** Viewer identity granted access, or `null` for the org-wide wildcard. */
|
|
134
|
+
viewerIdentityId: string | null;
|
|
135
|
+
createdAt: Date;
|
|
136
|
+
}
|
|
122
137
|
export interface RawIdentityMailbox {
|
|
123
138
|
id: string;
|
|
124
139
|
email_address: string;
|
|
@@ -165,10 +180,17 @@ export interface RawAgentIdentityData extends RawAgentIdentitySummary {
|
|
|
165
180
|
phone_number: RawIdentityPhoneNumber | null;
|
|
166
181
|
tunnel: RawTunnel | null;
|
|
167
182
|
}
|
|
183
|
+
export interface RawIdentityAccess {
|
|
184
|
+
id: string;
|
|
185
|
+
target_identity_id: string;
|
|
186
|
+
viewer_identity_id: string | null;
|
|
187
|
+
created_at: string;
|
|
188
|
+
}
|
|
168
189
|
export declare function parseIdentityMailbox(r: RawIdentityMailbox): IdentityMailbox;
|
|
169
190
|
export declare function parseIdentityPhoneNumber(r: RawIdentityPhoneNumber): IdentityPhoneNumber;
|
|
170
191
|
export declare function parseAgentIdentitySummary(r: RawAgentIdentitySummary): AgentIdentitySummary;
|
|
171
192
|
export declare function parseAgentIdentityData(r: RawAgentIdentityData): _AgentIdentityData;
|
|
193
|
+
export declare function parseIdentityAccess(r: RawIdentityAccess): IdentityAccess;
|
|
172
194
|
export declare function identityMailboxCreateOptionsToWire(options: IdentityMailboxCreateOptions): Record<string, unknown>;
|
|
173
195
|
export declare function identityTunnelCreateOptionsToWire(options: IdentityTunnelCreateOptions): Record<string, unknown>;
|
|
174
196
|
export declare function identityPhoneNumberCreateOptionsToWire(options: IdentityPhoneNumberCreateOptions): Record<string, unknown>;
|