1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

unstable -> stable

This commit is contained in:
Travis Ralston
2019-07-10 13:11:46 -06:00
parent 88fdeca2bf
commit 07629bfb9a
4 changed files with 21 additions and 56 deletions

View File

@@ -396,7 +396,7 @@ describe("MatrixClient", function() {
const auth = {a: 1}; const auth = {a: 1};
it("should pass through an auth dict", function(done) { it("should pass through an auth dict", function(done) {
httpBackend.when( httpBackend.when(
"DELETE", "/_matrix/client/unstable/devices/my_device", "DELETE", "/_matrix/client/r0/devices/my_device",
).check(function(req) { ).check(function(req) {
expect(req.data).toEqual({auth: auth}); expect(req.data).toEqual({auth: auth});
}).respond(200); }).respond(200);

View File

@@ -391,9 +391,8 @@ MatrixBaseApis.prototype.deactivateAccount = function(auth, erase) {
body.erase = erase; body.erase = erase;
} }
return this._http.authedRequestWithPrefix( return this._http.authedRequest(
undefined, "POST", '/account/deactivate', undefined, body, undefined, "POST", '/account/deactivate', undefined, body,
httpApi.PREFIX_R0,
); );
}; };
@@ -1329,9 +1328,7 @@ MatrixBaseApis.prototype.deleteThreePid = function(medium, address) {
'medium': medium, 'medium': medium,
'address': address, 'address': address,
}; };
return this._http.authedRequestWithPrefix( return this._http.authedRequest(undefined, "POST", path, null, data);
undefined, "POST", path, null, data, httpApi.PREFIX_UNSTABLE,
);
}; };
/** /**
@@ -1365,10 +1362,7 @@ MatrixBaseApis.prototype.setPassword = function(authDict, newPassword, callback)
*/ */
MatrixBaseApis.prototype.getDevices = function() { MatrixBaseApis.prototype.getDevices = function() {
const path = "/devices"; const path = "/devices";
return this._http.authedRequestWithPrefix( return this._http.authedRequest(undefined, path, undefined, undefined);
undefined, "GET", path, undefined, undefined,
httpApi.PREFIX_UNSTABLE,
);
}; };
/** /**
@@ -1384,11 +1378,7 @@ MatrixBaseApis.prototype.setDeviceDetails = function(device_id, body) {
$device_id: device_id, $device_id: device_id,
}); });
return this._http.authedRequest(undefined, "PUT", path, undefined, body);
return this._http.authedRequestWithPrefix(
undefined, "PUT", path, undefined, body,
httpApi.PREFIX_UNSTABLE,
);
}; };
/** /**
@@ -1410,10 +1400,7 @@ MatrixBaseApis.prototype.deleteDevice = function(device_id, auth) {
body.auth = auth; body.auth = auth;
} }
return this._http.authedRequestWithPrefix( return this._http.authedRequest(undefined, "DELETE", path, undefined, body);
undefined, "DELETE", path, undefined, body,
httpApi.PREFIX_UNSTABLE,
);
}; };
/** /**
@@ -1431,10 +1418,8 @@ MatrixBaseApis.prototype.deleteMultipleDevices = function(devices, auth) {
body.auth = auth; body.auth = auth;
} }
return this._http.authedRequestWithPrefix( const path = "/delete_devices";
undefined, "POST", "/delete_devices", undefined, body, return this._http.authedRequest(undefined, "POST", path, undefined, body);
httpApi.PREFIX_UNSTABLE,
);
}; };
@@ -1610,9 +1595,7 @@ MatrixBaseApis.prototype.uploadKeysRequest = function(content, opts, callback) {
} else { } else {
path = "/keys/upload"; path = "/keys/upload";
} }
return this._http.authedRequestWithPrefix( return this._http.authedRequest(callback, "POST", path, undefined, content);
callback, "POST", path, undefined, content, httpApi.PREFIX_UNSTABLE,
);
}; };
/** /**
@@ -1647,10 +1630,7 @@ MatrixBaseApis.prototype.downloadKeysForUsers = function(userIds, opts) {
content.device_keys[u] = {}; content.device_keys[u] = {};
}); });
return this._http.authedRequestWithPrefix( return this._http.authedRequest(undefined, "POST", "/keys/query", undefined, content);
undefined, "POST", "/keys/query", undefined, content,
httpApi.PREFIX_UNSTABLE,
);
}; };
/** /**
@@ -1678,10 +1658,8 @@ MatrixBaseApis.prototype.claimOneTimeKeys = function(devices, key_algorithm) {
query[deviceId] = key_algorithm; query[deviceId] = key_algorithm;
} }
const content = {one_time_keys: queries}; const content = {one_time_keys: queries};
return this._http.authedRequestWithPrefix( const path = "/keys/claim";
undefined, "POST", "/keys/claim", undefined, content, return this._http.authedRequest(undefined, "POST", path, undefined, content);
httpApi.PREFIX_UNSTABLE,
);
}; };
/** /**
@@ -1700,10 +1678,8 @@ MatrixBaseApis.prototype.getKeyChanges = function(oldToken, newToken) {
to: newToken, to: newToken,
}; };
return this._http.authedRequestWithPrefix( const path = "/keys/changes";
undefined, "GET", "/keys/changes", qps, undefined, return this._http.authedRequest(undefined, "GET", path, qps, undefined);
httpApi.PREFIX_UNSTABLE,
);
}; };
@@ -1821,10 +1797,7 @@ MatrixBaseApis.prototype.sendToDevice = function(
messages: contentMap, messages: contentMap,
}; };
return this._http.authedRequestWithPrefix( return this._http.authedRequest(undefined, "PUT", path, undefined, body);
undefined, "PUT", path, undefined, body,
httpApi.PREFIX_UNSTABLE,
);
}; };
// Third party Lookup API // Third party Lookup API
@@ -1836,9 +1809,8 @@ MatrixBaseApis.prototype.sendToDevice = function(
* @return {module:client.Promise} Resolves to the result object * @return {module:client.Promise} Resolves to the result object
*/ */
MatrixBaseApis.prototype.getThirdpartyProtocols = function() { MatrixBaseApis.prototype.getThirdpartyProtocols = function() {
return this._http.authedRequestWithPrefix( return this._http.authedRequest(
undefined, "GET", "/thirdparty/protocols", undefined, undefined, undefined, "GET", "/thirdparty/protocols", undefined, undefined,
httpApi.PREFIX_UNSTABLE,
).then((response) => { ).then((response) => {
// sanity check // sanity check
if (!response || typeof(response) !== 'object') { if (!response || typeof(response) !== 'object') {
@@ -1863,10 +1835,7 @@ MatrixBaseApis.prototype.getThirdpartyLocation = function(protocol, params) {
$protocol: protocol, $protocol: protocol,
}); });
return this._http.authedRequestWithPrefix( return this._http.authedRequest(undefined, "GET", path, params, undefined);
undefined, "GET", path, params, undefined,
httpApi.PREFIX_UNSTABLE,
);
}; };
/** /**
@@ -1882,10 +1851,7 @@ MatrixBaseApis.prototype.getThirdpartyUser = function(protocol, params) {
$protocol: protocol, $protocol: protocol,
}); });
return this._http.authedRequestWithPrefix( return this._http.authedRequest(undefined, "GET", path, params, undefined);
undefined, "GET", path, params, undefined,
httpApi.PREFIX_UNSTABLE,
);
}; };
/** /**

View File

@@ -3065,9 +3065,8 @@ MatrixClient.prototype.paginateEventTimeline = function(eventTimeline, opts) {
params.from = token; params.from = token;
} }
promise = promise = this._http.authedRequest(
this._http.authedRequestWithPrefix(undefined, "GET", path, params, undefined, "GET", path, params, undefined,
undefined, httpApi.PREFIX_UNSTABLE,
).then(function(res) { ).then(function(res) {
const token = res.next_token; const token = res.next_token;
const matrixEvents = []; const matrixEvents = [];

View File

@@ -1053,7 +1053,7 @@ utils.extend(module.exports.MatrixEvent.prototype, {
/* _REDACT_KEEP_KEY_MAP gives the keys we keep when an event is redacted /* _REDACT_KEEP_KEY_MAP gives the keys we keep when an event is redacted
* *
* This is specified here: * This is specified here:
* http://matrix.org/speculator/spec/HEAD/client_server/unstable.html#redactions * http://matrix.org/speculator/spec/HEAD/client_server/latest.html#redactions
* *
* Also: * Also:
* - We keep 'unsigned' since that is created by the local server * - We keep 'unsigned' since that is created by the local server