glitch-javascript-sdk 0.2.6 → 0.2.7

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
@@ -1,87 +1,5 @@
1
1
  import { AxiosPromise } from 'axios';
2
2
 
3
- interface Template {
4
- id?: string;
5
- name?: string;
6
- description?: string;
7
- version?: string;
8
- directory?: string;
9
- entry_point_file?: string;
10
- author_name?: string;
11
- author_website?: string;
12
- author_email?: string;
13
- main_image?: string;
14
- logo?: string;
15
- is_private?: boolean;
16
- }
17
-
18
- interface User {
19
- id?: string;
20
- first_name?: string;
21
- last_name?: string;
22
- username?: string;
23
- display_name?: string;
24
- bio?: string;
25
- avatar?: string;
26
- banner_image?: string;
27
- twitter_page?: string;
28
- facebook_page?: string;
29
- instagram_page?: string;
30
- snapchat_page?: string;
31
- tiktok_page?: string;
32
- twitch_page?: string;
33
- youtube_page?: string;
34
- paetron_page?: string;
35
- twitter_handle?: string;
36
- facebook_handle?: string;
37
- instagram_handle?: string;
38
- snapchat_handle?: string;
39
- tiktok_handle?: string;
40
- twitch_handle?: string;
41
- youtube_handle?: string;
42
- paetron_handle?: string;
43
- created_at?: string;
44
- updated_at?: string;
45
- }
46
-
47
- interface Community {
48
- id?: string;
49
- name?: string;
50
- description?: string;
51
- logo?: string;
52
- banner_image?: string;
53
- video_logo?: string;
54
- subdomain?: string;
55
- cname?: string;
56
- bannner_image?: string;
57
- cname_enabled?: boolean;
58
- require_attendee_rsvp?: boolean;
59
- is_private?: boolean;
60
- disable_streams?: boolean;
61
- disable_competitions?: boolean;
62
- disable_forums?: boolean;
63
- disable_teams?: boolean;
64
- custom_css?: boolean;
65
- twitter_page?: string;
66
- facebook_page?: string;
67
- instagram_page?: string;
68
- snapchat_page?: string;
69
- tiktok_page?: string;
70
- twitch_page?: string;
71
- youtube_page?: string;
72
- paetron_page?: string;
73
- twitter_handle?: string;
74
- facebook_handle?: string;
75
- instagram_handle?: string;
76
- snapchat_handle?: string;
77
- tiktok_handle?: string;
78
- twitch_handle?: string;
79
- youtube_handle?: string;
80
- paetron_handle?: string;
81
- template?: Template;
82
- admins?: User[];
83
- }
84
-
85
3
  /**
86
4
  * Config
87
5
  *
@@ -116,9 +34,9 @@ declare class Config {
116
34
  /**
117
35
  * Set the community to be associated with this config through
118
36
  *
119
- * @param authToken The JWT
37
+ * @param community The object of the community
120
38
  */
121
- static setCommunity(community: Community): void;
39
+ static setCommunity(community: Record<string, any>): void;
122
40
  /**
123
41
  * Gets base url
124
42
  */
@@ -130,7 +48,7 @@ declare class Config {
130
48
  /**
131
49
  * Gets the community currently associated
132
50
  */
133
- static get getCommunity(): Community;
51
+ static get getCommunity(): object;
134
52
  }
135
53
 
136
54
  interface Response<T> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -64,9 +64,9 @@ class Config {
64
64
  /**
65
65
  * Set the community to be associated with this config through
66
66
  *
67
- * @param authToken The JWT
67
+ * @param community The object of the community
68
68
  */
69
- public static setCommunity(community: Community) {
69
+ public static setCommunity(community: Record<string, any>) {
70
70
  Config._community = community;
71
71
 
72
72
  Requests.setCommunityID(community.id);
@@ -89,7 +89,7 @@ class Config {
89
89
  /**
90
90
  * Gets the community currently associated
91
91
  */
92
- public static get getCommunity(): Community {
92
+ public static get getCommunity(): object {
93
93
  return Config._community;
94
94
  }
95
95
  }
@@ -46,6 +46,7 @@ class Requests {
46
46
  * @param token
47
47
  */
48
48
  public static setCommunityID(community_id : string | undefined) {
49
+ console.log("setting communty_id", community_id);
49
50
  this.community_id = community_id;
50
51
  }
51
52
 
@@ -103,6 +104,7 @@ class Requests {
103
104
  url = `${url}?${queryString}`;
104
105
  }
105
106
 
107
+ console.log("Community ID in Request", this.community_id);
106
108
  if (this.community_id) {
107
109
  // Check if the URL already contains query parameters
108
110
  const separator = url.includes('?') ? '&' : '?';