From 3905e56e1f4a30463574cfa5eab0e41fb9a3ee19 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Tue, 28 Jul 2015 11:45:46 +0100 Subject: [PATCH] Bump to 0.2.0 - Add missing jsdoc, update CHANGELOG. --- CHANGELOG.md | 50 ++++++++++++++++++++++++++++++++++++++++---- lib/client.js | 24 ++++++++++++++------- lib/pushprocessor.js | 11 ++++++++++ package.json | 2 +- 4 files changed, 75 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 785462239..348cc8404 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -Changes in 0.1.2 +Changes in 0.2.0 ================ Breaking changes: @@ -8,17 +8,59 @@ Breaking changes: New features: * Added `EventStatus.QUEUED` which is set on an event when it is waiting to be sent by the scheduler and there are other events in front. + * Added support for processing push rules on an event. This can be obtained by + calling `MatrixClient.getPushActionsForEvent(event)`. + * Added WebRTC support. Outbound calls can be made via + `call = global.createNewMatrixCall(MatrixClient, roomId)` followed by + `call.placeVoiceCall()` or `call.placeVideoCall(remoteEle, localEle)`. + Inbound calls will be received via the event `"Call.incoming"` which provides + a call object which can be followed with `call.answer()` or `call.hangup()`. + * Added the ability to upload files to the media repository. + * Added the ability to change the client's password. + * Added the ability to register with an email via an identity server. + * Handle presence events by updating the associated `User` object. + * Handle redaction events. + * Added infrastructure for supporting End-to-End encryption. E2E is *NOT* + available in this version. New methods: + * `MatrixClient.getUser(userId)` + * `MatrixClient.getPushActionsForEvent(event)` + * `MatrixClient.setPassword(auth, newPassword)` + * `MatrixClient.loginWithSAML2(relayState, callback)` + * `MatrixClient.getAvatarUrlForMember(member, w, h, method)` + * `MatrixClient.mxcUrlToHttp(url, w, h, method)` + * `MatrixClient.getAvatarUrlForRoom(room, w, h, method)` + * `MatrixClient.uploadContent(file, callback)` + * `Room.getMembersWithMemership(membership)` * `MatrixScheduler.getQueueForEvent(event)` * `MatrixScheduler.removeEventFromQueue(event)` - * `RoomMember.getAvatarUrl()` * `$DATA_STORE.setSyncToken(token)` * `$DATA_STORE.getSyncToken()` +Crypto infrastructure (crypto is *NOT* available in this version): + * `global.CRYPTO_ENABLED` + * `MatrixClient.isCryptoEnabled()` + * `MatrixClient.uploadKeys(maxKeys)` + * `MatrixClient.downloadKeys(userIds, forceDownload)` + * `MatrixClient.listDeviceKeys(userId)` + * `MatrixClient.setRoomEncryption(roomId, config)` + * `MatrixClient.isRoomEncrypted(roomId)` + +New classes: + * `MatrixCall` + Bug fixes: - * Fixed an issue which prevented RoomMember.name being disambiguated if there - was exactly 1 other person with the same display name. + * Member name bugfix: Fixed an issue which prevented RoomMember.name being + disambiguated if there was exactly 1 other person with the same display name. + * Member name bugfix: Disambiguate both clashing display names with user IDs in + the event of a clash. + * Room state bugfix: Fixed a bug which incorrectly overwrote power levels + locally for a room. + * Room name bugfix: Ignore users who have left the room when determining a room + name. + * Events bugfix: Fixed a bug which prevented the `sender` and `target` + properties from being set. Changes in 0.1.1 ================ diff --git a/lib/client.js b/lib/client.js index f670ef65e..fc080284d 100644 --- a/lib/client.js +++ b/lib/client.js @@ -43,6 +43,8 @@ var OLM_ALGORITHM = "m.olm.v1.curve25519-aes-sha2"; * @param {Object} opts The configuration options for this client. * @param {string} opts.baseUrl Required. The base URL to the client-server * HTTP API. + * @param {string} opts.idBaseUrl Optional. The base identity server URL for + * identity server requests. * @param {Function} opts.request Required. The function to invoke for HTTP * requests. The value of this property is typically require("request") * as it returns a function which meets the required interface. See @@ -1053,6 +1055,7 @@ MatrixClient.prototype.sendHtmlMessage = function(roomId, body, htmlBody, callba }; /** + * Upload a file to the media repository on the home server. * @param {File} file object * @param {module:client.callback} callback Optional. * @return {module:client.Promise} Resolves: TODO @@ -1218,8 +1221,10 @@ function _membershipChange(client, roomId, userId, membership, reason, callback) } /** - * @param {MatrixEvent} event - * @return {module:http-api.MatrixError} Rejects: with an error response. + * Obtain a dict of actions which should be performed for this event according + * to the push rules for this user. + * @param {MatrixEvent} event The event to get push actions for. + * @return {module:pushprocessor~PushAction} A dict of actions to perform. */ MatrixClient.prototype.getPushActionsForEvent = function(event) { if (event._pushActions === undefined) { @@ -1293,7 +1298,8 @@ MatrixClient.prototype.setAvatarUrl = function(url, callback) { }; /** - * Get the avatar URL for a room member. + * Get the avatar URL for a room member. This method is experimental and + * may change. * @param {module:room-member.RoomMember} member * @param {Number} width The desired width of the thumbnail. * @param {Number} height The desired height of the thumbnail. @@ -1316,7 +1322,8 @@ MatrixClient.prototype.getAvatarUrlForMember = }; /** - * Get the avatar URL for a room. + * Get the avatar URL for a room. This method is experimental and + * may change. * @param {module:room.Room} room * @param {Number} width The desired width of the thumbnail. * @param {Number} height The desired height of the thumbnail. @@ -1343,7 +1350,8 @@ MatrixClient.prototype.getAvatarUrlForRoom = }; /** - * Turn an MXC URL into an HTTP one + * Turn an MXC URL into an HTTP one. This method is experimental and + * may change. * @param {string} mxcUrl The MXC URL * @param {Number} width The desired width of the thumbnail. * @param {Number} height The desired height of the thumbnail. @@ -1387,8 +1395,9 @@ MatrixClient.prototype.addThreePid = function(creds, bind, callback) { }; /** + * Make a request to change your password. * @param {Object} authDict - * @param {string} newPassword + * @param {string} newPassword The new desired password. * @param {module:client.callback} callback Optional. * @return {module:client.Promise} Resolves: TODO * @return {module:http-api.MatrixError} Rejects: with an error response. @@ -2280,7 +2289,8 @@ MatrixClient.prototype.requestEmailToken = function(email, clientSecret, }; /** - * Generates a random string suitable for use as a client secret + * Generates a random string suitable for use as a client secret. This + * method is experimental and may change. * @return {string} A new client secret */ MatrixClient.prototype.generateClientSecret = function() { diff --git a/lib/pushprocessor.js b/lib/pushprocessor.js index fca1e5040..3895c8dfb 100644 --- a/lib/pushprocessor.js +++ b/lib/pushprocessor.js @@ -243,5 +243,16 @@ function PushProcessor(client) { }; } +/** + * @typedef PushAction + * @type {Object} + * @property {boolean} notify Whether this event should notify the user or not. + * @property {Object} tweaks How this event should be notified. + * @property {boolean} tweaks.highlight Whether this event should be highlighted + * on the UI. + * @property {boolean} tweaks.sound Whether this notification should produce a + * noise. + */ + /** The PushProcessor class. */ module.exports = PushProcessor; diff --git a/package.json b/package.json index a3c998748..5ff24cd3e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-js-sdk", - "version": "0.1.1", + "version": "0.2.0", "description": "Matrix Client-Server SDK for Javascript", "main": "index.js", "scripts": {