From e19610296dd121702381ebe3e149799ad0cd3a31 Mon Sep 17 00:00:00 2001 From: Edoardo Gallo Date: Thu, 9 Sep 2021 19:25:25 +0200 Subject: [PATCH] Release JS package 3.2.0 (#270) * fix getRecordings method * add spec for getRecordings * remove url from the Recording interface * generate versions --- .changeset/brave-toys-jog.md | 5 --- .changeset/clean-rockets-teach.md | 5 --- .changeset/friendly-zoos-eat.md | 5 --- .changeset/honest-waves-hug.md | 5 --- .changeset/loud-brooms-juggle.md | 5 --- .changeset/olive-pumpkins-deny.md | 5 --- .changeset/rude-crabs-type.md | 5 --- .changeset/ten-bees-develop.md | 5 --- .changeset/ten-candles-hang.md | 6 ---- .changeset/tender-lobsters-tie.md | 5 --- .changeset/unlucky-olives-compete.md | 6 ---- .changeset/wise-starfishes-cover.md | 5 --- .changeset/yellow-foxes-raise.md | 5 --- packages/core/CHANGELOG.md | 14 ++++++++ packages/core/package.json | 2 +- .../core/src/rooms/RoomSessionRecording.ts | 1 - packages/core/src/rooms/methods.ts | 6 ++-- packages/core/src/types/videoRecording.ts | 1 - packages/js/CHANGELOG.md | 14 ++++++++ packages/js/package.json | 6 ++-- packages/js/src/Room.test.ts | 34 +++++++++++++++++++ packages/js/src/testUtils.ts | 1 + packages/react-native/package.json | 4 +-- packages/realtime-api/CHANGELOG.md | 10 ++++++ packages/realtime-api/package.json | 2 +- packages/web-api/package.json | 2 +- packages/webrtc/CHANGELOG.md | 17 ++++++++-- packages/webrtc/package.json | 4 +-- 28 files changed, 101 insertions(+), 84 deletions(-) delete mode 100644 .changeset/brave-toys-jog.md delete mode 100644 .changeset/clean-rockets-teach.md delete mode 100644 .changeset/friendly-zoos-eat.md delete mode 100644 .changeset/honest-waves-hug.md delete mode 100644 .changeset/loud-brooms-juggle.md delete mode 100644 .changeset/olive-pumpkins-deny.md delete mode 100644 .changeset/rude-crabs-type.md delete mode 100644 .changeset/ten-bees-develop.md delete mode 100644 .changeset/ten-candles-hang.md delete mode 100644 .changeset/tender-lobsters-tie.md delete mode 100644 .changeset/unlucky-olives-compete.md delete mode 100644 .changeset/wise-starfishes-cover.md delete mode 100644 .changeset/yellow-foxes-raise.md diff --git a/.changeset/brave-toys-jog.md b/.changeset/brave-toys-jog.md deleted file mode 100644 index df9d31848..000000000 --- a/.changeset/brave-toys-jog.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@signalwire/realtime-api': patch ---- - -Rename `createWebSocketClient` to `createClient` diff --git a/.changeset/clean-rockets-teach.md b/.changeset/clean-rockets-teach.md deleted file mode 100644 index 1ae6840e8..000000000 --- a/.changeset/clean-rockets-teach.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@signalwire/core': patch ---- - -Add cleanup logic for event handler transforms diff --git a/.changeset/friendly-zoos-eat.md b/.changeset/friendly-zoos-eat.md deleted file mode 100644 index 2d58904db..000000000 --- a/.changeset/friendly-zoos-eat.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@signalwire/core': patch ---- - -Rename getParam to getStateProperty and make BaseComponent a generic diff --git a/.changeset/honest-waves-hug.md b/.changeset/honest-waves-hug.md deleted file mode 100644 index 1071b9819..000000000 --- a/.changeset/honest-waves-hug.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@signalwire/core': patch ---- - -Update usage of BaseConsumer so it's always stateless, change way of attaching listeners to BaseComponent diff --git a/.changeset/loud-brooms-juggle.md b/.changeset/loud-brooms-juggle.md deleted file mode 100644 index 51da63d53..000000000 --- a/.changeset/loud-brooms-juggle.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@signalwire/webrtc': patch ---- - -Include all the `video.recording` events for the BaseConnection subscribe. diff --git a/.changeset/olive-pumpkins-deny.md b/.changeset/olive-pumpkins-deny.md deleted file mode 100644 index 771207b1f..000000000 --- a/.changeset/olive-pumpkins-deny.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@signalwire/core': patch ---- - -Bugfix on the internal EventEmitter where, in a specific case, the `.off()` method did not remove the listener. Improved test coverage. diff --git a/.changeset/rude-crabs-type.md b/.changeset/rude-crabs-type.md deleted file mode 100644 index 3984e58d4..000000000 --- a/.changeset/rude-crabs-type.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@signalwire/core': patch ---- - -Add classes and typings to support the Recording APIs. diff --git a/.changeset/ten-bees-develop.md b/.changeset/ten-bees-develop.md deleted file mode 100644 index 63c90a3f9..000000000 --- a/.changeset/ten-bees-develop.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@signalwire/realtime-api': patch ---- - -Update event handlers for `room.updated` and `layout.changed` events and add new `member.talking.started`/`member.talking.ended` events. diff --git a/.changeset/ten-candles-hang.md b/.changeset/ten-candles-hang.md deleted file mode 100644 index a18521bbb..000000000 --- a/.changeset/ten-candles-hang.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@signalwire/core': patch -'@signalwire/js': patch ---- - -Added `member.talking.started`, `member.talking.ended` and deprecated `member.talking.start` and `member.talking.stop` for consistency. diff --git a/.changeset/tender-lobsters-tie.md b/.changeset/tender-lobsters-tie.md deleted file mode 100644 index 1ed0ad102..000000000 --- a/.changeset/tender-lobsters-tie.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@signalwire/core': patch ---- - -Fix `validateEventsToSubscribe` method to check the prefixed-event. diff --git a/.changeset/unlucky-olives-compete.md b/.changeset/unlucky-olives-compete.md deleted file mode 100644 index 92315b835..000000000 --- a/.changeset/unlucky-olives-compete.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@signalwire/js': patch -'@signalwire/webrtc': patch ---- - -Added documentation for the exposed WebRTC methods [docs] diff --git a/.changeset/wise-starfishes-cover.md b/.changeset/wise-starfishes-cover.md deleted file mode 100644 index aac23dcbc..000000000 --- a/.changeset/wise-starfishes-cover.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@signalwire/js': minor ---- - -Expose `startRecording()` method to recording a RoomSession. It returns a RoomSessionRecording object so it can be paused, resumed and stopped. diff --git a/.changeset/yellow-foxes-raise.md b/.changeset/yellow-foxes-raise.md deleted file mode 100644 index 22116eb4a..000000000 --- a/.changeset/yellow-foxes-raise.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@signalwire/realtime-api': patch ---- - -Update instance type being passed to event handlers to better reflect purpose. diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index f21c7883c..dc033404d 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -4,6 +4,20 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.1.2] - 2021-09-09 + +### Added + +- [#261](https://github.com/signalwire/signalwire-js/pull/261) [`9dd7dbb`](https://github.com/signalwire/signalwire-js/commit/9dd7dbb890b92b5f69c3c9bb615083367d8113bb) - Add classes and typings to support the Recording APIs. + +* [#273](https://github.com/signalwire/signalwire-js/pull/273) [`249facf`](https://github.com/signalwire/signalwire-js/commit/249facf92698be19f9567caea0283535b51a3ae7) - Added `member.talking.started`, `member.talking.ended` and deprecated `member.talking.start` and `member.talking.stop` for consistency. + +### Fixed + +- [#271](https://github.com/signalwire/signalwire-js/pull/271) [`e6233cc`](https://github.com/signalwire/signalwire-js/commit/e6233cc74fb3ad5fc3e042ac36f717be5e6988b8) - Bugfix on the internal EventEmitter where, in a specific case, the `.off()` method did not remove the listener. Improved test coverage. + +- [#277](https://github.com/signalwire/signalwire-js/pull/277) [`5b4e57d`](https://github.com/signalwire/signalwire-js/commit/5b4e57d12fed829b15cf28a77ba0082f582e35f3) - Fix `validateEventsToSubscribe` method to check the prefixed-event. + ## [3.1.1] - 2021-08-27 ### Changed diff --git a/packages/core/package.json b/packages/core/package.json index 77fb89289..d258b7cc5 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -3,7 +3,7 @@ "description": "Shared code for the SignalWire JS SDK", "author": "SignalWire Team ", "license": "MIT", - "version": "3.1.1", + "version": "3.1.2", "main": "dist/index.node.js", "module": "dist/index.esm.js", "files": [ diff --git a/packages/core/src/rooms/RoomSessionRecording.ts b/packages/core/src/rooms/RoomSessionRecording.ts index 88eb05c8c..7f35248fa 100644 --- a/packages/core/src/rooms/RoomSessionRecording.ts +++ b/packages/core/src/rooms/RoomSessionRecording.ts @@ -7,7 +7,6 @@ export interface RoomSessionRecording { id: string roomSessionId: string state: string - url: string duration: string pause(): Promise diff --git a/packages/core/src/rooms/methods.ts b/packages/core/src/rooms/methods.ts index af6ddfcbc..ec5998911 100644 --- a/packages/core/src/rooms/methods.ts +++ b/packages/core/src/rooms/methods.ts @@ -1,5 +1,5 @@ import { BaseRoomInterface } from '.' -import { VideoMember } from '../types' +import { VideoMember, VideoRecording } from '../types' import { ExecuteExtendedOptions, RoomMethod } from '../utils/interfaces' interface RoomMethodPropertyDescriptor extends PropertyDescriptor { @@ -102,10 +102,10 @@ export const showVideoMuted = createRoomMethod( transformResolve: baseCodeTransform, } ) -export const getRecordings = createRoomMethod( +export const getRecordings = createRoomMethod<{ recordings: VideoRecording[] }>( 'video.recording.list', { - transformResolve: baseCodeTransform, + transformResolve: (payload) => ({ recordings: payload.recordings }), } ) export const startRecording: RoomMethodDescriptor = { diff --git a/packages/core/src/types/videoRecording.ts b/packages/core/src/types/videoRecording.ts index ee84e3bfd..a60326509 100644 --- a/packages/core/src/types/videoRecording.ts +++ b/packages/core/src/types/videoRecording.ts @@ -29,7 +29,6 @@ export type InternalVideoRecordingEventNames = export interface VideoRecording { id: string state: 'recording' | 'paused' | 'completed' - url?: string duration?: number startedAt?: number endedAt?: number diff --git a/packages/js/CHANGELOG.md b/packages/js/CHANGELOG.md index eaed8e640..59a09c051 100644 --- a/packages/js/CHANGELOG.md +++ b/packages/js/CHANGELOG.md @@ -4,6 +4,20 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.2.0] - 2021-09-09 + +### Added + +- [#261](https://github.com/signalwire/signalwire-js/pull/261) [`9dd7dbb`](https://github.com/signalwire/signalwire-js/commit/9dd7dbb890b92b5f69c3c9bb615083367d8113bb) - Expose `startRecording()` method to recording a RoomSession. It returns a RoomSessionRecording object so it can be paused, resumed and stopped. + +- [#273](https://github.com/signalwire/signalwire-js/pull/273) [`249facf`](https://github.com/signalwire/signalwire-js/commit/249facf92698be19f9567caea0283535b51a3ae7) - Added `member.talking.started`, `member.talking.ended` events and deprecated `member.talking.start` and `member.talking.stop` for consistency with other event names. + +### Dependencies + +- Updated dependencies [[`a0f2ac7`](https://github.com/signalwire/signalwire-js/commit/a0f2ac706667c8909e89e8b2bd9429db1d11dc9d), [`6f58367`](https://github.com/signalwire/signalwire-js/commit/6f5836793764d7153850be8de05792664c2859e2), [`f37333a`](https://github.com/signalwire/signalwire-js/commit/f37333a5464d7555822e70668a91221e6489de08), [`9dd7dbb`](https://github.com/signalwire/signalwire-js/commit/9dd7dbb890b92b5f69c3c9bb615083367d8113bb), [`e6233cc`](https://github.com/signalwire/signalwire-js/commit/e6233cc74fb3ad5fc3e042ac36f717be5e6988b8), [`9dd7dbb`](https://github.com/signalwire/signalwire-js/commit/9dd7dbb890b92b5f69c3c9bb615083367d8113bb), [`249facf`](https://github.com/signalwire/signalwire-js/commit/249facf92698be19f9567caea0283535b51a3ae7), [`5b4e57d`](https://github.com/signalwire/signalwire-js/commit/5b4e57d12fed829b15cf28a77ba0082f582e35f3), [`7380582`](https://github.com/signalwire/signalwire-js/commit/73805829683a8f4e2389dede2eaef25db4a5ffb7)]: + - @signalwire/core@3.1.2 + - @signalwire/webrtc@3.1.2 + ## [3.1.1] - 2021-08-27 ### Changed diff --git a/packages/js/package.json b/packages/js/package.json index 431811a24..d9372c118 100644 --- a/packages/js/package.json +++ b/packages/js/package.json @@ -3,7 +3,7 @@ "description": "SignalWire JS SDK", "author": "SignalWire Team ", "license": "MIT", - "version": "3.1.1", + "version": "3.2.0", "main": "dist/index.js", "module": "dist/index.esm.js", "unpkg": "dist/index.umd.js", @@ -43,8 +43,8 @@ "prepublishOnly": "npm run build" }, "dependencies": { - "@signalwire/core": "3.1.1", - "@signalwire/webrtc": "3.1.1" + "@signalwire/core": "3.1.2", + "@signalwire/webrtc": "3.1.2" }, "types": "dist/js/src/index.d.ts" } diff --git a/packages/js/src/Room.test.ts b/packages/js/src/Room.test.ts index bcf92fd93..878ec0b84 100644 --- a/packages/js/src/Room.test.ts +++ b/packages/js/src/Room.test.ts @@ -48,6 +48,40 @@ describe('Room Object', () => { expect(room.startRecording).toBeDefined() }) + describe('getRecordings', () => { + it('should return an array of recordings', async () => { + const { store, session, emitter } = configureFullStack() + const recordingList = [{ id: 'recordingOne' }, { id: 'recordingTwo' }] + + session.execute = jest.fn().mockResolvedValue({ + code: '200', + message: 'OK', + recordings: recordingList, + }) + + room = connect({ + store, + Component: Room, + componentListeners: ROOM_COMPONENT_LISTENERS, + })({ + store, + emitter, + }) + // mock a room.subscribed event + room.onRoomSubscribed({ + nodeId: 'node-id', + roomId: '6e83849b-5cc2-4fc6-80ed-448113c8a426', + roomSessionId: '8e03ac25-8622-411a-95fc-f897b34ac9e7', + memberId: 'member-id', + }) + + const result = await room.getRecordings() + expect(result).toStrictEqual({ + recordings: recordingList, + }) + }) + }) + describe('startRecording', () => { it('should return an interactive object', async () => { ;(room.execute as jest.Mock).mockResolvedValueOnce({ diff --git a/packages/js/src/testUtils.ts b/packages/js/src/testUtils.ts index 379324716..b28549357 100644 --- a/packages/js/src/testUtils.ts +++ b/packages/js/src/testUtils.ts @@ -33,6 +33,7 @@ export const configureFullStack = () => { const session = { dispatch: console.log, connect: jest.fn(), + execute: jest.fn(), } const emitter = new EventEmitter() const store = configureStore({ diff --git a/packages/react-native/package.json b/packages/react-native/package.json index 2ba8f0591..a0d75a689 100644 --- a/packages/react-native/package.json +++ b/packages/react-native/package.json @@ -21,7 +21,7 @@ "prepublishOnly": "npm run build" }, "dependencies": { - "@signalwire/core": "3.1.1", - "@signalwire/webrtc": "3.1.1" + "@signalwire/core": "3.1.2", + "@signalwire/webrtc": "3.1.2" } } diff --git a/packages/realtime-api/CHANGELOG.md b/packages/realtime-api/CHANGELOG.md index 55fffd8ef..47d2610cd 100644 --- a/packages/realtime-api/CHANGELOG.md +++ b/packages/realtime-api/CHANGELOG.md @@ -2,6 +2,16 @@ ## [Unreleased] +- [#276](https://github.com/signalwire/signalwire-js/pull/276) [`ca34859`](https://github.com/signalwire/signalwire-js/commit/ca34859f42fa7fd0abdf7842a1018896908ad45b) - Rename `createWebSocketClient` to `createClient` + +* [#277](https://github.com/signalwire/signalwire-js/pull/277) [`5b4e57d`](https://github.com/signalwire/signalwire-js/commit/5b4e57d12fed829b15cf28a77ba0082f582e35f3) - Update event handlers for `room.updated` and `layout.changed` events and add new `member.talking.started`/`member.talking.ended` events. + +- [#266](https://github.com/signalwire/signalwire-js/pull/266) [`f37333a`](https://github.com/signalwire/signalwire-js/commit/f37333a5464d7555822e70668a91221e6489de08) - Update instance type being passed to event handlers to better reflect purpose. + +- Updated dependencies [[`a0f2ac7`](https://github.com/signalwire/signalwire-js/commit/a0f2ac706667c8909e89e8b2bd9429db1d11dc9d), [`6f58367`](https://github.com/signalwire/signalwire-js/commit/6f5836793764d7153850be8de05792664c2859e2), [`f37333a`](https://github.com/signalwire/signalwire-js/commit/f37333a5464d7555822e70668a91221e6489de08), [`e6233cc`](https://github.com/signalwire/signalwire-js/commit/e6233cc74fb3ad5fc3e042ac36f717be5e6988b8), [`9dd7dbb`](https://github.com/signalwire/signalwire-js/commit/9dd7dbb890b92b5f69c3c9bb615083367d8113bb), [`249facf`](https://github.com/signalwire/signalwire-js/commit/249facf92698be19f9567caea0283535b51a3ae7), [`5b4e57d`](https://github.com/signalwire/signalwire-js/commit/5b4e57d12fed829b15cf28a77ba0082f582e35f3)]: + + - @signalwire/core@3.1.2 + - [#246](https://github.com/signalwire/signalwire-js/pull/246) [`97dacbb`](https://github.com/signalwire/signalwire-js/commit/97dacbb3aaf9029a6781ac2356591f928ae40580) - Add typings for the RealTime video and room event listeners. * [#222](https://github.com/signalwire/signalwire-js/pull/222) [`1ca7c2a`](https://github.com/signalwire/signalwire-js/commit/1ca7c2ac56d6d829192549ecb4e4fd29038ab0ce) - Initial implementation of the Real-Time Node.js SDK. diff --git a/packages/realtime-api/package.json b/packages/realtime-api/package.json index d4d4f409c..c9dc7b732 100644 --- a/packages/realtime-api/package.json +++ b/packages/realtime-api/package.json @@ -40,7 +40,7 @@ "docs:watch": "npm run docs -- --watch" }, "dependencies": { - "@signalwire/core": "3.1.1", + "@signalwire/core": "3.1.2", "ws": "^7.4.6" }, "devDependencies": { diff --git a/packages/web-api/package.json b/packages/web-api/package.json index 6057c1022..b2300bc7e 100644 --- a/packages/web-api/package.json +++ b/packages/web-api/package.json @@ -40,7 +40,7 @@ "docs:watch": "npm run docs -- --watch" }, "dependencies": { - "@signalwire/core": "3.1.1", + "@signalwire/core": "3.1.2", "node-abort-controller": "^2.0.0", "node-fetch": "^2.6.1" }, diff --git a/packages/webrtc/CHANGELOG.md b/packages/webrtc/CHANGELOG.md index 7c3d46d60..d35c3371a 100644 --- a/packages/webrtc/CHANGELOG.md +++ b/packages/webrtc/CHANGELOG.md @@ -4,9 +4,22 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.1.2] - 2021-09-09 + +### Added + +- [#261](https://github.com/signalwire/signalwire-js/pull/261) [`9dd7dbb`](https://github.com/signalwire/signalwire-js/commit/9dd7dbb890b92b5f69c3c9bb615083367d8113bb) - Include all the `video.recording` events for the BaseConnection subscribe. + +* [#257](https://github.com/signalwire/signalwire-js/pull/257) [`7380582`](https://github.com/signalwire/signalwire-js/commit/73805829683a8f4e2389dede2eaef25db4a5ffb7) - Added documentation for the exposed WebRTC methods. + +### Dependencies + +- Updated dependencies [[`a0f2ac7`](https://github.com/signalwire/signalwire-js/commit/a0f2ac706667c8909e89e8b2bd9429db1d11dc9d), [`6f58367`](https://github.com/signalwire/signalwire-js/commit/6f5836793764d7153850be8de05792664c2859e2), [`f37333a`](https://github.com/signalwire/signalwire-js/commit/f37333a5464d7555822e70668a91221e6489de08), [`e6233cc`](https://github.com/signalwire/signalwire-js/commit/e6233cc74fb3ad5fc3e042ac36f717be5e6988b8), [`9dd7dbb`](https://github.com/signalwire/signalwire-js/commit/9dd7dbb890b92b5f69c3c9bb615083367d8113bb), [`249facf`](https://github.com/signalwire/signalwire-js/commit/249facf92698be19f9567caea0283535b51a3ae7), [`5b4e57d`](https://github.com/signalwire/signalwire-js/commit/5b4e57d12fed829b15cf28a77ba0082f582e35f3)]: + - @signalwire/core@3.1.2 + ## [3.1.1] - 2021-08-27 -### Patch Changes +### Fixed - [#244](https://github.com/signalwire/signalwire-js/pull/244) [`c270247`](https://github.com/signalwire/signalwire-js/commit/c270247769c6ae2584f0372bbb1426c6c994732a) - Validate `targets` passed to the `createDeviceWatcher()` WebRTC helper method. @@ -17,7 +30,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ## [3.1.0] - 2021-08-13 -### Minor Changes +### Added - [#236](https://github.com/signalwire/signalwire-js/pull/236) [`b967c89`](https://github.com/signalwire/signalwire-js/commit/b967c892d99ad7fa96ebc5a31a871bde1eecb0d0) - Apply `audio` and `video` constraints sent from the backend consuming the `mediaParams` event. diff --git a/packages/webrtc/package.json b/packages/webrtc/package.json index 583ce5981..03f478e5f 100644 --- a/packages/webrtc/package.json +++ b/packages/webrtc/package.json @@ -3,7 +3,7 @@ "description": "SignalWire WebRTC library", "author": "SignalWire Team ", "license": "MIT", - "version": "3.1.1", + "version": "3.1.2", "main": "dist/cjs/webrtc/src/index.js", "module": "dist/mjs/webrtc/src/index.js", "files": [ @@ -39,7 +39,7 @@ "docs:watch": "npm run docs -- --watch" }, "dependencies": { - "@signalwire/core": "3.1.1" + "@signalwire/core": "3.1.2" }, "types": "dist/cjs/webrtc/src/index.d.ts" }