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
package/dist/index.d.ts
CHANGED
|
@@ -765,6 +765,14 @@ declare class Communities {
|
|
|
765
765
|
* @returns promise
|
|
766
766
|
*/
|
|
767
767
|
static removetUser<T>(community_id: string, user_id: string): AxiosPromise<Response<T>>;
|
|
768
|
+
/**
|
|
769
|
+
* Finds a community either by its subdomain or cname. The cname must be active.
|
|
770
|
+
*
|
|
771
|
+
* @param domain The subcname of the community.
|
|
772
|
+
*
|
|
773
|
+
* @returns promise
|
|
774
|
+
*/
|
|
775
|
+
static findByDomain<T>(domain: string): AxiosPromise<Response<T>>;
|
|
768
776
|
}
|
|
769
777
|
|
|
770
778
|
declare class Users {
|
package/package.json
CHANGED
package/src/api/Communities.ts
CHANGED
|
@@ -280,6 +280,17 @@ class Communities {
|
|
|
280
280
|
return Requests.processRoute(CommunitiesRoute.routes.removeUser, {}, {community_id : community_id, user_id});
|
|
281
281
|
}
|
|
282
282
|
|
|
283
|
+
/**
|
|
284
|
+
* Finds a community either by its subdomain or cname. The cname must be active.
|
|
285
|
+
*
|
|
286
|
+
* @param domain The subcname of the community.
|
|
287
|
+
*
|
|
288
|
+
* @returns promise
|
|
289
|
+
*/
|
|
290
|
+
public static findByDomain<T>(domain : string): AxiosPromise<Response<T>> {
|
|
291
|
+
return Requests.processRoute(CommunitiesRoute.routes.findByDomain, {}, {domain : domain});
|
|
292
|
+
}
|
|
293
|
+
|
|
283
294
|
|
|
284
295
|
|
|
285
296
|
|
|
@@ -19,7 +19,8 @@ class CommunitiesRoute {
|
|
|
19
19
|
addUser : {url : '/communities/{community_id}/users', method : HTTP_METHODS.POST},
|
|
20
20
|
showUser : {url : '/communities/{community_id}/users/{user_id}', method : HTTP_METHODS.GET},
|
|
21
21
|
updateUser : {url : '/communities/{community_id}/users/{user_id}', method : HTTP_METHODS.PUT},
|
|
22
|
-
removeUser : {url : '/communities/{community_id}/users/{user_id}', method : HTTP_METHODS.DELETE}
|
|
22
|
+
removeUser : {url : '/communities/{community_id}/users/{user_id}', method : HTTP_METHODS.DELETE},
|
|
23
|
+
findByDomain : {url : '/communities/findByDomain/{domain}', method : HTTP_METHODS.GET}
|
|
23
24
|
};
|
|
24
25
|
|
|
25
26
|
}
|
package/src/util/Requests.ts
CHANGED