From c7f9d56df27cd1b0c8a42d2e9465e79fdb3ca88a Mon Sep 17 00:00:00 2001 From: Skylar Sadlier Date: Tue, 6 Dec 2022 18:47:41 -0700 Subject: [PATCH] - Updated code for new authedRequest argument format - matrix-js-sdk updated to 22.0.0 - fs-extra updated to 11.1.0 - minimum version set to 14.14 --- package-lock.json | 30 +++++++++++++------------- package.json | 4 ++-- src/matrix-synapse-create-edit-user.js | 15 ++++++------- src/matrix-synapse-deactivate-user.js | 1 - src/matrix-synapse-join-room.js | 1 - src/matrix-synapse-users.js | 1 - src/matrix-whois-user.js | 1 - 7 files changed, 24 insertions(+), 29 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5a9554c..a74b09c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,10 +10,10 @@ "license": "SEE LICENSE FILE", "dependencies": { "abort-controller": "^3.0.0", - "fs-extra": "^10.0.1", + "fs-extra": "^11.1.0", "got": "^12.0.2", "isomorphic-webcrypto": "^2.3.8", - "matrix-js-sdk": "^21.2.0", + "matrix-js-sdk": "^22.0.0", "node-fetch": "^3.3.0", "node-localstorage": "^2.2.1", "olm": "https://gitlab.matrix.org/matrix-org/olm/-/package_files/472/download", @@ -7100,16 +7100,16 @@ } }, "node_modules/fs-extra": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", - "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.0.tgz", + "integrity": "sha512-0rcTq621PD5jM/e0a3EJoGC/1TC5ZBCERW82LQuwfGnCa1V8w7dpYH1yNu+SLb6E5dkeCBzKEyLGlFrnr+dUyw==", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" }, "engines": { - "node": ">=12" + "node": ">=14.14" } }, "node_modules/fs-minipass": { @@ -8895,9 +8895,9 @@ "integrity": "sha512-1QEOsXO+bhyCroIe2/A5OwaxHvBm7EsSQ46DEDn8RBIfQwN5HWBpFvyWWR4QY0KHPPnnJdI99wgRiAl7Ad5qaA==" }, "node_modules/matrix-js-sdk": { - "version": "21.2.0", - "resolved": "https://registry.npmjs.org/matrix-js-sdk/-/matrix-js-sdk-21.2.0.tgz", - "integrity": "sha512-5aHWkWve+/5dmRJGIAzwe2hFNHX/2LBFWVqHh6YOTSViWlAbBxQsylBIhsNppgmHUN1YjBhvBlW206UnYCk6zg==", + "version": "22.0.0", + "resolved": "https://registry.npmjs.org/matrix-js-sdk/-/matrix-js-sdk-22.0.0.tgz", + "integrity": "sha512-mpKqeD3nCobjGiUiATUyEoP44n+AzDW5cSeBTIBY5fPhj0AkzLJhblHt40vzSOJazj8tT0PhsSzhEIR9hGzYGA==", "dependencies": { "@babel/runtime": "^7.12.5", "@types/sdp-transform": "^2.4.5", @@ -19554,9 +19554,9 @@ "peer": true }, "fs-extra": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", - "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.0.tgz", + "integrity": "sha512-0rcTq621PD5jM/e0a3EJoGC/1TC5ZBCERW82LQuwfGnCa1V8w7dpYH1yNu+SLb6E5dkeCBzKEyLGlFrnr+dUyw==", "requires": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -20974,9 +20974,9 @@ "integrity": "sha512-1QEOsXO+bhyCroIe2/A5OwaxHvBm7EsSQ46DEDn8RBIfQwN5HWBpFvyWWR4QY0KHPPnnJdI99wgRiAl7Ad5qaA==" }, "matrix-js-sdk": { - "version": "21.2.0", - "resolved": "https://registry.npmjs.org/matrix-js-sdk/-/matrix-js-sdk-21.2.0.tgz", - "integrity": "sha512-5aHWkWve+/5dmRJGIAzwe2hFNHX/2LBFWVqHh6YOTSViWlAbBxQsylBIhsNppgmHUN1YjBhvBlW206UnYCk6zg==", + "version": "22.0.0", + "resolved": "https://registry.npmjs.org/matrix-js-sdk/-/matrix-js-sdk-22.0.0.tgz", + "integrity": "sha512-mpKqeD3nCobjGiUiATUyEoP44n+AzDW5cSeBTIBY5fPhj0AkzLJhblHt40vzSOJazj8tT0PhsSzhEIR9hGzYGA==", "requires": { "@babel/runtime": "^7.12.5", "@types/sdp-transform": "^2.4.5", diff --git a/package.json b/package.json index 789f9a5..820cbce 100644 --- a/package.json +++ b/package.json @@ -4,10 +4,10 @@ "description": "Matrix chat server client for Node-RED", "dependencies": { "abort-controller": "^3.0.0", - "fs-extra": "^10.0.1", + "fs-extra": "^11.1.0", "got": "^12.0.2", "isomorphic-webcrypto": "^2.3.8", - "matrix-js-sdk": "^21.2.0", + "matrix-js-sdk": "^22.0.0", "node-fetch": "^3.3.0", "node-localstorage": "^2.2.1", "olm": "https://gitlab.matrix.org/matrix-org/olm/-/package_files/472/download", diff --git a/src/matrix-synapse-create-edit-user.js b/src/matrix-synapse-create-edit-user.js index 0c6e154..67dca0d 100644 --- a/src/matrix-synapse-create-edit-user.js +++ b/src/matrix-synapse-create-edit-user.js @@ -52,7 +52,6 @@ module.exports = function(RED) { node.server.matrixClient.http .authedRequest( - undefined, 'PUT', node.encodeUri( "/_synapse/admin/v2/users/$userId", @@ -62,13 +61,13 @@ module.exports = function(RED) { msg.payload, { prefix: '' } ).then(function(e){ - msg.payload = e; - node.send([msg, null]); - }).catch(function(e){ - node.warn("Error creating/editing user " + e); - msg.error = e; - node.send([null, msg]); - }); + msg.payload = e; + node.send([msg, null]); + }).catch(function(e){ + node.warn("Error creating/editing user " + e); + msg.error = e; + node.send([null, msg]); + }); }); } RED.nodes.registerType("matrix-synapse-create-edit-user", MatrixSynapseCreateEditUser); diff --git a/src/matrix-synapse-deactivate-user.js b/src/matrix-synapse-deactivate-user.js index 76f023f..939692b 100644 --- a/src/matrix-synapse-deactivate-user.js +++ b/src/matrix-synapse-deactivate-user.js @@ -56,7 +56,6 @@ module.exports = function(RED) { ); node.server.matrixClient.http .authedRequest( - undefined, 'POST', path, undefined, diff --git a/src/matrix-synapse-join-room.js b/src/matrix-synapse-join-room.js index 3a8b3bf..d08d794 100644 --- a/src/matrix-synapse-join-room.js +++ b/src/matrix-synapse-join-room.js @@ -60,7 +60,6 @@ module.exports = function(RED) { // we need the status code, so set onlydata to false for this request node.server.matrixClient.http .authedRequest( - undefined, 'POST', node.encodeUri( "/_synapse/admin/v1/join/$room_id_or_alias", diff --git a/src/matrix-synapse-users.js b/src/matrix-synapse-users.js index 9247d61..9beb1b1 100644 --- a/src/matrix-synapse-users.js +++ b/src/matrix-synapse-users.js @@ -48,7 +48,6 @@ module.exports = function(RED) { node.server.matrixClient.http .authedRequest( - undefined, 'GET', "/_synapse/admin/v2/users", queryParams, diff --git a/src/matrix-whois-user.js b/src/matrix-whois-user.js index b3d92c2..3a22feb 100644 --- a/src/matrix-whois-user.js +++ b/src/matrix-whois-user.js @@ -53,7 +53,6 @@ module.exports = function(RED) { // we need the status code, so set onlydata to false for this request node.server.matrixClient.http .authedRequest( - undefined, 'GET', node.encodeUri( "/_matrix/client/r0/admin/whois/$userId",