1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-28 05:03:59 +03:00

Use /r0 or /unstable for all requests

This commit is contained in:
Daniel Wagner-Hall
2016-02-08 11:15:30 +00:00
parent 5ca4bc6b85
commit 02196416e4
3 changed files with 40 additions and 49 deletions

View File

@@ -28,26 +28,20 @@ TODO:
*/
/**
* A constant representing the URI path for version 1 of the Client-Server HTTP API.
* A constant representing the URI path for release 0 of the Client-Server HTTP API.
*/
module.exports.PREFIX_V1 = "/_matrix/client/api/v1";
module.exports.PREFIX_R0 = "/_matrix/client/r0";
/**
* A constant representing the URI path for version 2 alpha of the Client-Server
* HTTP API.
* A constant representing the URI path for as-yet unspecified Client-Server HTTP APIs.
*/
module.exports.PREFIX_V2_ALPHA = "/_matrix/client/v2_alpha";
module.exports.PREFIX_UNSTABLE = "/_matrix/client/unstable";
/**
* URI path for the identity API
*/
module.exports.PREFIX_IDENTITY_V1 = "/_matrix/identity/api/v1";
/**
* A constant representing the URI path for release 0 of the Client-Server HTTP API.
*/
module.exports.PREFIX_R0 = "/_matrix/client/r0";
/**
* Construct a MatrixHttpApi.
* @constructor
@@ -57,7 +51,7 @@ module.exports.PREFIX_R0 = "/_matrix/client/r0";
* @param {Function} opts.request Required. The function to call for HTTP
* requests. This function must look like function(opts, callback){ ... }.
* @param {string} opts.prefix Required. The matrix client prefix to use, e.g.
* '/_matrix/client/api/v1'. See PREFIX_V1 and PREFIX_V2_ALPHA for constants.
* '/_matrix/client/r0'. See PREFIX_R0 and PREFIX_UNSTABLE for constants.
* @param {bool} opts.onlyData True to return only the 'data' component of the
* response (e.g. the parsed HTTP body). If false, requests will return status
* codes and headers in addition to data. Default: false.