Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix redundant bullet text.
The second half of this bullet reads "MessageActions.META is now MessageActions.META", which is tautological. It likely should state that MessageActions.META_OCCUPANCY has been renamed to MessageActions.META. Please correct this.

- 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)
Expand Down
18 changes: 14 additions & 4 deletions ably.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -917,15 +917,15 @@ declare namespace ResolvedChannelModes {
*/
type PUBLISH = 'publish';
/**
* The client can subscribe to messages.
* The client will receive messages.
*/
type SUBSCRIBE = 'subscribe';
/**
* The client can enter the presence set.
*/
type PRESENCE = 'presence';
/**
* The client can receive presence messages.
* The client will receive presence messages.
*/
type PRESENCE_SUBSCRIBE = 'presence_subscribe';
/**
Expand All @@ -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';
}

/**
Expand All @@ -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.
Expand Down Expand Up @@ -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<string>, listener?: messageCallback<PresenceMessage>): Promise<void>;
subscribe(type: string | Array<string>, listener?: messageCallback<Annotation>): Promise<void>;
/**
* 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.
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 4 additions & 0 deletions src/common/lib/types/annotation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ class Annotation extends BaseMessage {
serial?: string;
messageSerial?: string;
type?: string;
name?: string;
count?: number;

async encode(): Promise<WireAnnotation> {
const res = Object.assign(new WireAnnotation(), this, {
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/platform/react-hooks/src/AblyReactHooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export type ChannelNameAndOptions = {
export type ChannelNameAndAblyId = Pick<ChannelNameAndOptions, 'channelName' | 'ablyId'>;
export type ChannelParameters = string | ChannelNameAndOptions;

export const version = '2.6.5';
export const version = '2.7.0';

/**
* channel options for react-hooks
Expand Down
Loading