diff --git a/README.md b/README.md index e071f160..3418603b 100644 --- a/README.md +++ b/README.md @@ -2038,6 +2038,8 @@ EXAMPLES $ ably channels presence update my-channel --data '{"status":"busy"}' --json + $ ably channels presence update my-channel --data '{"status":"busy"}' --pretty-json + $ ably channels presence update my-channel --data '{"status":"online"}' --duration 60 ``` diff --git a/package.json b/package.json index 0b9cff87..0e398e46 100644 --- a/package.json +++ b/package.json @@ -110,7 +110,7 @@ } }, "dependencies": { - "@ably/chat": "^1.0.0", + "@ably/chat": "^1.3.1", "@ably/spaces": "^0.4.0", "@inquirer/prompts": "^5.1.3", "@oclif/core": "^4.2.10", @@ -125,7 +125,7 @@ "color-json": "^3.0.5", "fast-levenshtein": "^3.0.0", "inquirer": "^9.2.16", - "jsonwebtoken": "^9.0.2", + "jsonwebtoken": "^9.0.3", "node-fetch": "^3.3.2", "open": "^10.1.0", "ora": "^8.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 369d4018..7a859e0b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,8 +14,8 @@ importers: .: dependencies: '@ably/chat': - specifier: ^1.0.0 - version: 1.0.0(ably@2.19.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: ^1.3.1 + version: 1.3.1(ably@2.19.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@ably/spaces': specifier: ^0.4.0 version: 0.4.0(ably@2.19.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -59,8 +59,8 @@ importers: specifier: ^9.2.16 version: 9.3.7 jsonwebtoken: - specifier: ^9.0.2 - version: 9.0.2 + specifier: ^9.0.3 + version: 9.0.3 node-fetch: specifier: ^3.3.2 version: 3.3.2 @@ -352,11 +352,11 @@ importers: packages: - '@ably/chat@1.0.0': - resolution: {integrity: sha512-001+DfhCFWTAD6CAZSltdIR9TMaznWsHOMyDN23vhPoFVGmM1nlXl9uTh3OE695pHfOrTuD/AqGC5J4qWYrrmA==} + '@ably/chat@1.3.1': + resolution: {integrity: sha512-dbhsIz9g2cDzAWv7TvTpEZlKD+xGh+SedZw74QwhmaNjZA/ieB4401ScN/poWLAaGahkXzB2hP2DzeSl4qkDOA==} engines: {node: '>=20.0.0'} peerDependencies: - ably: ^2.14.0 + ably: ^2.19.0 react: ^18.0.0 || ^19.0.0 react-dom: ^18.0.0 || ^19.0.0 peerDependenciesMeta: @@ -4563,19 +4563,19 @@ packages: jsonfile@6.1.0: resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==} - jsonwebtoken@9.0.2: - resolution: {integrity: sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==} + jsonwebtoken@9.0.3: + resolution: {integrity: sha512-MT/xP0CrubFRNLNKvxJ2BYfy53Zkm++5bX9dtuPbqAeQpTVe0MQTFhao8+Cp//EmJp244xt6Drw/GVEGCUj40g==} engines: {node: '>=12', npm: '>=6'} jsx-ast-utils@3.3.5: resolution: {integrity: sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==} engines: {node: '>=4.0'} - jwa@1.4.1: - resolution: {integrity: sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==} + jwa@2.0.1: + resolution: {integrity: sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg==} - jws@3.2.2: - resolution: {integrity: sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==} + jws@4.0.1: + resolution: {integrity: sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA==} keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} @@ -6348,7 +6348,7 @@ packages: snapshots: - '@ably/chat@1.0.0(ably@2.19.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@ably/chat@1.3.1(ably@2.19.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: ably: 2.19.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) async-mutex: 0.5.0 @@ -9047,7 +9047,7 @@ snapshots: sirv: 3.0.2 tinyglobby: 0.2.15 tinyrainbow: 3.0.3 - vitest: 4.0.14(@edge-runtime/vm@3.2.0)(@types/node@20.17.30)(@vitest/ui@4.0.14)(jiti@2.4.2)(jsdom@26.1.0)(lightningcss@1.29.2)(tsx@4.19.4) + vitest: 4.0.14(@edge-runtime/vm@3.2.0)(@types/node@22.14.1)(@vitest/ui@4.0.14)(jiti@2.4.2)(jsdom@26.1.0)(lightningcss@1.29.2)(tsx@4.19.4) '@vitest/utils@4.0.14': dependencies: @@ -11258,9 +11258,9 @@ snapshots: optionalDependencies: graceful-fs: 4.2.11 - jsonwebtoken@9.0.2: + jsonwebtoken@9.0.3: dependencies: - jws: 3.2.2 + jws: 4.0.1 lodash.includes: 4.3.0 lodash.isboolean: 3.0.3 lodash.isinteger: 4.0.4 @@ -11269,7 +11269,7 @@ snapshots: lodash.isstring: 4.0.1 lodash.once: 4.1.1 ms: 2.1.3 - semver: 7.7.1 + semver: 7.7.2 jsx-ast-utils@3.3.5: dependencies: @@ -11278,15 +11278,15 @@ snapshots: object.assign: 4.1.7 object.values: 1.2.1 - jwa@1.4.1: + jwa@2.0.1: dependencies: buffer-equal-constant-time: 1.0.1 ecdsa-sig-formatter: 1.0.11 safe-buffer: 5.2.1 - jws@3.2.2: + jws@4.0.1: dependencies: - jwa: 1.4.1 + jwa: 2.0.1 safe-buffer: 5.2.1 keyv@4.5.4: diff --git a/src/chat-base-command.ts b/src/chat-base-command.ts index 0fb13404..5db8c9a2 100644 --- a/src/chat-base-command.ts +++ b/src/chat-base-command.ts @@ -1,4 +1,3 @@ -import type * as Ably from "ably"; import { ChatClient, Room, RoomStatus } from "@ably/chat"; import { AblyBaseCommand } from "./base-command.js"; @@ -17,17 +16,6 @@ export abstract class ChatBaseCommand extends AblyBaseCommand { private _chatClient: ChatClient | null = null; private _cleanupTimeout: NodeJS.Timeout | undefined; - /** - * Override getClientOptions to disable binary protocol for Chat commands. - * The Chat API uses realtime.request() for REST calls, and binary (MsgPack) - * encoding is not supported by the Chat API endpoints. - */ - protected override getClientOptions(flags: BaseFlags): Ably.ClientOptions { - const options = super.getClientOptions(flags); - options.useBinaryProtocol = false; - return options; - } - /** * finally disposes of the chat client, if there is one, which includes cleaning up any subscriptions. *