glitch-javascript-sdk 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +14 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Communities.d.ts +8 -0
- package/dist/esm/index.js +14 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +8 -0
- package/package.json +1 -1
- package/src/api/Communities.ts +11 -0
- package/src/routes/CommunitiesRoute.ts +2 -1
- package/src/util/Requests.ts +3 -0
|
@@ -197,5 +197,13 @@ declare class Communities {
|
|
|
197
197
|
* @returns promise
|
|
198
198
|
*/
|
|
199
199
|
static removetUser<T>(community_id: string, user_id: string): AxiosPromise<Response<T>>;
|
|
200
|
+
/**
|
|
201
|
+
* Finds a community either by its subdomain or cname. The cname must be active.
|
|
202
|
+
*
|
|
203
|
+
* @param domain The subcname of the community.
|
|
204
|
+
*
|
|
205
|
+
* @returns promise
|
|
206
|
+
*/
|
|
207
|
+
static findByDomain<T>(domain: string): AxiosPromise<Response<T>>;
|
|
200
208
|
}
|
|
201
209
|
export default Communities;
|
package/dist/esm/index.js
CHANGED
|
@@ -29846,6 +29846,8 @@ var Requests = /** @class */ (function () {
|
|
|
29846
29846
|
if (fileData) {
|
|
29847
29847
|
headers['Content-Type'] = 'multipart/form-data';
|
|
29848
29848
|
}
|
|
29849
|
+
//Remove double slashes
|
|
29850
|
+
url = url.replace(/\/\//g, '/');
|
|
29849
29851
|
var uri = "".concat(this.baseUrl).concat(url);
|
|
29850
29852
|
var axiosPromise = axios({
|
|
29851
29853
|
method: method,
|
|
@@ -30716,7 +30718,8 @@ var CommunitiesRoute = /** @class */ (function () {
|
|
|
30716
30718
|
addUser: { url: '/communities/{community_id}/users', method: HTTP_METHODS.POST },
|
|
30717
30719
|
showUser: { url: '/communities/{community_id}/users/{user_id}', method: HTTP_METHODS.GET },
|
|
30718
30720
|
updateUser: { url: '/communities/{community_id}/users/{user_id}', method: HTTP_METHODS.PUT },
|
|
30719
|
-
removeUser: { url: '/communities/{community_id}/users/{user_id}', method: HTTP_METHODS.DELETE }
|
|
30721
|
+
removeUser: { url: '/communities/{community_id}/users/{user_id}', method: HTTP_METHODS.DELETE },
|
|
30722
|
+
findByDomain: { url: '/communities/findByDomain/{domain}', method: HTTP_METHODS.GET }
|
|
30720
30723
|
};
|
|
30721
30724
|
return CommunitiesRoute;
|
|
30722
30725
|
}());
|
|
@@ -30964,6 +30967,16 @@ var Communities = /** @class */ (function () {
|
|
|
30964
30967
|
Communities.removetUser = function (community_id, user_id) {
|
|
30965
30968
|
return Requests.processRoute(CommunitiesRoute.routes.removeUser, {}, { community_id: community_id, user_id: user_id });
|
|
30966
30969
|
};
|
|
30970
|
+
/**
|
|
30971
|
+
* Finds a community either by its subdomain or cname. The cname must be active.
|
|
30972
|
+
*
|
|
30973
|
+
* @param domain The subcname of the community.
|
|
30974
|
+
*
|
|
30975
|
+
* @returns promise
|
|
30976
|
+
*/
|
|
30977
|
+
Communities.findByDomain = function (domain) {
|
|
30978
|
+
return Requests.processRoute(CommunitiesRoute.routes.findByDomain, {}, { domain: domain });
|
|
30979
|
+
};
|
|
30967
30980
|
return Communities;
|
|
30968
30981
|
}());
|
|
30969
30982
|
|