glitch-javascript-sdk 2.8.5 → 2.8.6

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
@@ -26,12 +26,20 @@ declare class Config {
26
26
  * @param lock If set to true, will lock the baseUrl so it cannot be changed
27
27
  */
28
28
  static setBaseUrl(baseUrl: string, lock?: boolean): void;
29
+ /**
30
+ * Gets the base URL
31
+ */
32
+ static getBaseUrl(): string;
29
33
  /**
30
34
  * Set the JSON Web Token (JWT) that will be passed to the API
31
35
  *
32
36
  * @param authToken The JWT
33
37
  */
34
38
  static setAuthToken(authToken: string): void;
39
+ /**
40
+ * Gets the auth token
41
+ */
42
+ static getAuthToken(): string;
35
43
  /**
36
44
  * Set the community to be associated with this config through
37
45
  *
@@ -45,6 +53,9 @@ declare class Config {
45
53
  * @param domain The domain ie: example.com
46
54
  */
47
55
  static setRootDomain(domain: string): void;
56
+ /**
57
+ * Gets the root domain
58
+ */
48
59
  static getRootDomain(): string;
49
60
  /**
50
61
  * Gets base url
@@ -58,6 +69,10 @@ declare class Config {
58
69
  * Gets the community currently associated
59
70
  */
60
71
  static get getCommunity(): object;
72
+ /**
73
+ * Checks if the base URL is locked
74
+ */
75
+ static isBaseUrlLocked(): boolean;
61
76
  }
62
77
 
63
78
  interface Response<T> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "2.8.5",
3
+ "version": "2.8.6",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -53,6 +53,13 @@ class Config {
53
53
  }
54
54
  }
55
55
 
56
+ /**
57
+ * Gets the base URL
58
+ */
59
+ public static getBaseUrl(): string {
60
+ return Config._baseUrl;
61
+ }
62
+
56
63
  /**
57
64
  * Set the JSON Web Token (JWT) that will be passed to the API
58
65
  *
@@ -64,6 +71,16 @@ class Config {
64
71
  Requests.setAuthToken(authToken);
65
72
  }
66
73
 
74
+
75
+ /**
76
+ * Gets the auth token
77
+ */
78
+ public static getAuthToken(): string {
79
+ return Config._authToken;
80
+ }
81
+
82
+
83
+
67
84
  /**
68
85
  * Set the community to be associated with this config through
69
86
  *
@@ -77,6 +94,7 @@ class Config {
77
94
  LabelManager.initialize(community);
78
95
  }
79
96
 
97
+
80
98
  /**
81
99
  * Sets the root level domain so data can be accessed across
82
100
  * multiple subdomains
@@ -95,13 +113,16 @@ class Config {
95
113
 
96
114
  // REMOVE THIS LINE: formattedDomain = formattedDomain.replace(/^\./, '');
97
115
  // We WANT the dot.
98
-
116
+
99
117
  this._rootDomain = formattedDomain;
100
118
 
101
119
  Storage.setRootDomain(formattedDomain);
102
120
  }
103
121
 
104
- public static getRootDomain() {
122
+ /**
123
+ * Gets the root domain
124
+ */
125
+ public static getRootDomain(): string {
105
126
  return this._rootDomain;
106
127
  }
107
128
 
@@ -125,6 +146,13 @@ class Config {
125
146
  public static get getCommunity(): object {
126
147
  return Config._community;
127
148
  }
149
+
150
+ /**
151
+ * Checks if the base URL is locked
152
+ */
153
+ public static isBaseUrlLocked(): boolean {
154
+ return this._baseUrlLocked;
155
+ }
128
156
  }
129
157
 
130
158
  export default Config;