diff --git a/CHANGELOG.md b/CHANGELOG.md index 8301ef64ac..d114510439 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ This contains only the most important and/or user-facing changes; for a full changelog, see the commit history. +## [2.7.0](https://github.com/ably/ably-js/tree/2.7.0) (2025-04-17) + +- Adds `ANNOTATION_PUBLISH` and `ANNOTATION_SUBSCRIBE` channel modes [\#1953](https://github.com/ably/ably-js/pull/1953) +- Adds support for message annotations via `channel.annotations` [\#1953](https://github.com/ably/ably-js/pull/1953) +- The message action `meta.occupancy` is now renamed to `meta`. Similarly, `MessageActions.META` is now `MessageActions.META` [\#1953](https://github.com/ably/ably-js/pull/1953) +- Fixes a bug where `deactivate` would not use device auth, meaning clients would only be able to use it with the `push-admin` capability [\#2000](https://github.com/ably/ably-js/pull/2000) +- The push `deactivate` method's callback type is now optional when using TypeScript [\#2000](https://github.com/ably/ably-js/pull/2000) + ## [2.6.5](https://github.com/ably/ably-js/tree/2.6.5) (2025-03-24) - Fixed type issue in `PublishOptions` [\#1988](https://github.com/ably/ably-js/pull/1988) diff --git a/ably.d.ts b/ably.d.ts index 7778615ac2..3ad725ca63 100644 --- a/ably.d.ts +++ b/ably.d.ts @@ -917,7 +917,7 @@ declare namespace ResolvedChannelModes { */ type PUBLISH = 'publish'; /** - * The client can subscribe to messages. + * The client will receive messages. */ type SUBSCRIBE = 'subscribe'; /** @@ -925,7 +925,7 @@ declare namespace ResolvedChannelModes { */ type PRESENCE = 'presence'; /** - * The client can receive presence messages. + * The client will receive presence messages. */ type PRESENCE_SUBSCRIBE = 'presence_subscribe'; /** @@ -936,6 +936,14 @@ declare namespace ResolvedChannelModes { * The client can receive object messages. */ type OBJECT_SUBSCRIBE = 'object_subscribe'; + /** + * The client can publish annotations + */ + type ANNOTATION_PUBLISH = 'annotation_publish'; + /** + * The client will receive annotations + */ + type ANNOTATION_SUBSCRIBE = 'annotation_subscribe'; } /** @@ -951,7 +959,9 @@ export type ResolvedChannelMode = | ResolvedChannelModes.PRESENCE | ResolvedChannelModes.PRESENCE_SUBSCRIBE | ResolvedChannelModes.OBJECT_PUBLISH - | ResolvedChannelModes.OBJECT_SUBSCRIBE; + | ResolvedChannelModes.OBJECT_SUBSCRIBE + | ResolvedChannelModes.ANNOTATION_PUBLISH + | ResolvedChannelModes.ANNOTATION_SUBSCRIBE; /** * Passes additional properties to a {@link Channel} or {@link RealtimeChannel} object, such as encryption, {@link ChannelMode} and channel parameters. @@ -2106,7 +2116,7 @@ export declare interface RealtimeAnnotations { * @param listener - An event listener function. * @returns A promise which resolves upon success of the channel {@link RealtimeChannel.attach | `attach()`} operation and rejects with an {@link ErrorInfo} object upon its failure. */ - subscribe(type: string | Array, listener?: messageCallback): Promise; + subscribe(type: string | Array, listener?: messageCallback): Promise; /** * Registers a listener that is called each time an {@link Annotation} is received on the channel. * Note that if you want to receive individual realtime annotations (instead of just the rolled-up summaries), you will need to request the annotation_subscribe ChannelMode in ChannelOptions, since they are not delivered by default. In general, most clients will not bother with subscribing to individual annotations, and will instead just look at the summary updates. diff --git a/package-lock.json b/package-lock.json index d09be29865..229e74e967 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ably", - "version": "2.6.5", + "version": "2.7.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ably", - "version": "2.6.5", + "version": "2.7.0", "license": "Apache-2.0", "dependencies": { "@ably/msgpack-js": "^0.4.0", diff --git a/package.json b/package.json index b4cc4ebb02..40815677e9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ably", "description": "Realtime client library for Ably, the realtime messaging service", - "version": "2.6.5", + "version": "2.7.0", "license": "Apache-2.0", "bugs": { "url": "https://github.com/ably/ably-js/issues", diff --git a/src/common/lib/types/annotation.ts b/src/common/lib/types/annotation.ts index a01ad8262c..1429f73ec8 100644 --- a/src/common/lib/types/annotation.ts +++ b/src/common/lib/types/annotation.ts @@ -59,6 +59,8 @@ class Annotation extends BaseMessage { serial?: string; messageSerial?: string; type?: string; + name?: string; + count?: number; async encode(): Promise { const res = Object.assign(new WireAnnotation(), this, { @@ -87,6 +89,8 @@ export class WireAnnotation extends BaseMessage { serial?: string; messageSerial?: string; type?: string; + name?: string; + count?: number; toJSON(...args: any[]) { return wireToJSON.call(this, ...args); diff --git a/src/platform/react-hooks/src/AblyReactHooks.ts b/src/platform/react-hooks/src/AblyReactHooks.ts index fe0f8266df..49c6d23fa2 100644 --- a/src/platform/react-hooks/src/AblyReactHooks.ts +++ b/src/platform/react-hooks/src/AblyReactHooks.ts @@ -12,7 +12,7 @@ export type ChannelNameAndOptions = { export type ChannelNameAndAblyId = Pick; export type ChannelParameters = string | ChannelNameAndOptions; -export const version = '2.6.5'; +export const version = '2.7.0'; /** * channel options for react-hooks