@droponair/sdk-js 0.13.0 → 0.13.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 +8 -0
- package/README.md +13 -2
- package/dist/core/messaging-client.d.ts +1 -1
- package/dist/core/messaging-client.js +10 -2
- package/dist/core/types.d.ts +8 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,14 @@ This project follows [Semantic Versioning](https://semver.org/).
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
+
## [0.13.1], 2026-05-21
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- **`revokeAttachment` accepts an `AttachmentRef`.** Calling `revokeAttachment(ref)` now also revokes the linked preview thumbnail (`ref.thumbnailAttachmentId`) in the same call. `revokeAttachment(attachmentId)` with a plain id string is unchanged and revokes only that one attachment. Additive — no breaking change.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
9
17
|
## [0.13.0], 2026-05-21
|
|
10
18
|
|
|
11
19
|
### Added
|
package/README.md
CHANGED
|
@@ -121,6 +121,16 @@ client.onReadReceipt(e => {
|
|
|
121
121
|
});
|
|
122
122
|
```
|
|
123
123
|
|
|
124
|
+
**Group read receipts.** Since SDK `0.13.0`, a group can opt into sharing read receipts with every member. Call `updateGroup(groupId, { readReceiptsVisibleToGroup: true })` (owner/admin); after that, a member's `markRead()` on a group message is broadcast to every other member, and `onReadReceipt` fires with `e.fromUserId` set to the member who read it. It is **opt-in per group** — the platform never enables it for you, and it has no effect unless read receipts are also enabled for your app.
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
await client.updateGroup(groupId, { readReceiptsVisibleToGroup: true });
|
|
128
|
+
|
|
129
|
+
client.onReadReceipt(e => {
|
|
130
|
+
// e.fromUserId is the group member who read e.messageId
|
|
131
|
+
});
|
|
132
|
+
```
|
|
133
|
+
|
|
124
134
|
### Notification clear & draft sync
|
|
125
135
|
|
|
126
136
|
Available since SDK `0.12.0`, both own-device only. `clearNotification()` tells your user's other devices a conversation's notifications were dismissed — always available. `syncDraft()` pushes a draft so the user can keep typing on another device — **opt-in** (the app owner enables it in the dashboard) and the draft text crosses the relay in cleartext.
|
|
@@ -231,11 +241,11 @@ client.onMessage(async (msg) => {
|
|
|
231
241
|
| `createUploadSession(options)` | `Promise<UploadSession>` | Low-level: presigned PUT URL only |
|
|
232
242
|
| `finalizeAttachment(attachmentId, sha256)` | `Promise<void>` | Low-level: commit integrity hash |
|
|
233
243
|
| `downloadAttachment(ref)` | `Promise<DownloadedAttachment>` | Get presigned URL + download + decrypt |
|
|
234
|
-
| `revokeAttachment(attachmentId)` | `Promise<void>` | Revoke an attachment you sent; recipients get `ATTACHMENT_REVOKED` |
|
|
244
|
+
| `revokeAttachment(attachmentId \| ref)` | `Promise<void>` | Revoke an attachment you sent; recipients get `ATTACHMENT_REVOKED` |
|
|
235
245
|
| `sendMessage(toUserId, text, { attachments })` | `Promise<{ messageId }>` | Send with attachments |
|
|
236
246
|
|
|
237
247
|
- **Preview thumbnails (optional).** Pass `thumbnail` (bytes) in `prepareAttachmentAndUpload` options and the SDK uploads it as a separate encrypted attachment, linked via `AttachmentRef.thumbnailAttachmentId`. Purely the developer's choice; omit it and there is no thumbnail. Download the thumbnail like any attachment.
|
|
238
|
-
- **Revoke.** `revokeAttachment()` stops the platform issuing new download URLs and notifies recipients. Bytes a recipient already downloaded cannot be recalled. For GROUP attachments, download is authorized against *current* group membership, so a removed member loses access.
|
|
248
|
+
- **Revoke.** `revokeAttachment()` stops the platform issuing new download URLs and notifies recipients. Bytes a recipient already downloaded cannot be recalled. For GROUP attachments, download is authorized against *current* group membership, so a removed member loses access. Pass an `AttachmentRef` instead of an id (`revokeAttachment(ref)`, since 0.13.1) to revoke the linked preview thumbnail in the same call; a thumbnail is a separate attachment, so revoking a bare id leaves its thumbnail untouched.
|
|
239
249
|
|
|
240
250
|
- E2EE: a random AES-256-GCM file key encrypts the bytes; the file key is wrapped per recipient device using X25519 + HKDF (same model as message payloads). Server never sees the unwrapped file key.
|
|
241
251
|
- Availability and per-file / per-month limits depend on your plan and are enforced server-side before the presigned URL is issued. See the [pricing page](https://www.droponair.com/pricing) and your dashboard Subscription page for what's enabled on your app.
|
|
@@ -259,6 +269,7 @@ client.onMessage(async (msg) => {
|
|
|
259
269
|
| `getGroup(groupId)` | `Promise<GroupInfo>` | Get group details |
|
|
260
270
|
| `addGroupMembers(groupId, userIds)` | `Promise<GroupInfo>` | Add members (owner/admin) |
|
|
261
271
|
| `removeGroupMember(groupId, userId)` | `Promise<GroupInfo>` | Remove a member (owner/admin) |
|
|
272
|
+
| `updateGroup(groupId, { name?, readReceiptsVisibleToGroup? })` | `Promise<GroupInfo>` | Update group settings (owner/admin) |
|
|
262
273
|
| `deleteGroup(groupId)` | `Promise<void>` | Delete a group (owner only) |
|
|
263
274
|
| `sendGroupMessage(groupId, plaintext, memberUserIds, options?)` | `Promise<{ messageId }>` | Send an end-to-end encrypted group message (sender-side per-recipient fan-out). `options.attachments` for E2EE group attachments. |
|
|
264
275
|
| `sendCleartextGroupMessage(groupId, plaintext)` | `Promise<{ messageId }>` | Send a plaintext (non-encrypted) group message; server fans out to every other member. |
|
|
@@ -93,7 +93,7 @@ export declare class MessagingClient implements DropOnAirClient {
|
|
|
93
93
|
createUploadSession(options: CreateUploadSessionOptions): Promise<UploadSession>;
|
|
94
94
|
finalizeAttachment(attachmentId: string, sha256: string): Promise<void>;
|
|
95
95
|
downloadAttachment(ref: AttachmentRef): Promise<DownloadedAttachment>;
|
|
96
|
-
revokeAttachment(
|
|
96
|
+
revokeAttachment(attachment: string | AttachmentRef): Promise<void>;
|
|
97
97
|
connect(): Promise<void>;
|
|
98
98
|
disconnect(): void;
|
|
99
99
|
sendMessage(toUserId: string, plaintextMessage: string, options?: {
|
|
@@ -270,8 +270,16 @@ class MessagingClient {
|
|
|
270
270
|
async downloadAttachment(ref) {
|
|
271
271
|
return this.attachmentClient.downloadAttachment(ref);
|
|
272
272
|
}
|
|
273
|
-
async revokeAttachment(
|
|
274
|
-
|
|
273
|
+
async revokeAttachment(attachment) {
|
|
274
|
+
if (typeof attachment === 'string') {
|
|
275
|
+
return this.attachmentClient.revokeAttachment(attachment);
|
|
276
|
+
}
|
|
277
|
+
// Revoke the main attachment first so the primary intent always lands,
|
|
278
|
+
// then cascade to the linked preview thumbnail if there is one.
|
|
279
|
+
await this.attachmentClient.revokeAttachment(attachment.attachmentId);
|
|
280
|
+
if (attachment.thumbnailAttachmentId) {
|
|
281
|
+
await this.attachmentClient.revokeAttachment(attachment.thumbnailAttachmentId);
|
|
282
|
+
}
|
|
275
283
|
}
|
|
276
284
|
async connect() {
|
|
277
285
|
this.log('connect_start');
|
package/dist/core/types.d.ts
CHANGED
|
@@ -286,11 +286,15 @@ export interface DropOnAirClient {
|
|
|
286
286
|
/** Download (and for E2EE decrypt) an attachment referenced inside a received message. */
|
|
287
287
|
downloadAttachment(ref: import('../attachment/attachment-types').AttachmentRef): Promise<import('../attachment/attachment-types').DownloadedAttachment>;
|
|
288
288
|
/**
|
|
289
|
-
* Revoke an attachment you sent
|
|
290
|
-
*
|
|
291
|
-
*
|
|
289
|
+
* Revoke an attachment you sent. The platform stops issuing download URLs
|
|
290
|
+
* for it and notifies recipients; bytes already downloaded cannot be
|
|
291
|
+
* recalled.
|
|
292
|
+
*
|
|
293
|
+
* Pass an attachment id to revoke that single attachment. Pass an
|
|
294
|
+
* `AttachmentRef` to also revoke its linked preview thumbnail
|
|
295
|
+
* (`thumbnailAttachmentId`) in the same call, if it has one.
|
|
292
296
|
*/
|
|
293
|
-
revokeAttachment(
|
|
297
|
+
revokeAttachment(attachment: string | import('../attachment/attachment-types').AttachmentRef): Promise<void>;
|
|
294
298
|
/** Send a cleartext message to a user (no encryption). */
|
|
295
299
|
sendCleartextMessage(toUserId: string, plaintext: string): Promise<{
|
|
296
300
|
messageId: string;
|
package/dist/version.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* MINOR, additive feature (e.g. multi-device payloads, new call event type)
|
|
8
8
|
* PATCH, bug-fix / perf improvement with no wire or API change
|
|
9
9
|
*/
|
|
10
|
-
export declare const SDK_VERSION = "0.13.
|
|
10
|
+
export declare const SDK_VERSION = "0.13.1";
|
|
11
11
|
/**
|
|
12
12
|
* Binary encrypted-payload format version.
|
|
13
13
|
* Included as the first byte of every encrypted payload so receivers can
|
package/dist/version.js
CHANGED
|
@@ -10,7 +10,7 @@ exports.PROTOCOL_VERSION = exports.PAYLOAD_FORMAT_VERSION = exports.SDK_VERSION
|
|
|
10
10
|
* MINOR, additive feature (e.g. multi-device payloads, new call event type)
|
|
11
11
|
* PATCH, bug-fix / perf improvement with no wire or API change
|
|
12
12
|
*/
|
|
13
|
-
exports.SDK_VERSION = '0.13.
|
|
13
|
+
exports.SDK_VERSION = '0.13.1';
|
|
14
14
|
/**
|
|
15
15
|
* Binary encrypted-payload format version.
|
|
16
16
|
* Included as the first byte of every encrypted payload so receivers can
|