glitch-javascript-sdk 0.2.3 → 0.2.5

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/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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -42,7 +42,7 @@ class Communities {
42
42
  */
43
43
  public static update<T>(community_id : string, data : object) : AxiosPromise<Response<T>>{
44
44
 
45
- return Requests.processRoute(CommunitiesRoute.routes.create, data, {community_id : community_id});
45
+ return Requests.processRoute(CommunitiesRoute.routes.update, data, {community_id : community_id});
46
46
  }
47
47
 
48
48
  /**
@@ -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
 
@@ -42,7 +42,7 @@ class Templates {
42
42
  */
43
43
  public static update<T>(template_id : string, data : object) : AxiosPromise<Response<T>>{
44
44
 
45
- return Requests.processRoute(TemplatesRoute.routes.create, data, {template_id : template_id});
45
+ return Requests.processRoute(TemplatesRoute.routes.update, data, {template_id : template_id});
46
46
  }
47
47
 
48
48
  /**
@@ -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
  }