groupchat 0.0.5 → 0.0.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.
@@ -1,3 +1,19 @@
1
+ // src/lib/config.ts
2
+ import { config as loadEnv } from "dotenv";
3
+ if (process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test") {
4
+ loadEnv();
5
+ }
6
+ var DEFAULT_CONFIG = {
7
+ consoleUrl: "https://app.groupchatty.com",
8
+ wsUrl: "wss://api.groupchatty.com/socket"
9
+ };
10
+ function getConfig() {
11
+ return {
12
+ consoleUrl: process.env.GROUPCHAT_CONSOLE_URL || DEFAULT_CONFIG.consoleUrl,
13
+ wsUrl: process.env.GROUPCHAT_WS_URL || DEFAULT_CONFIG.wsUrl
14
+ };
15
+ }
16
+
1
17
  // src/auth/auth-manager.ts
2
18
  import crypto from "crypto";
3
19
  import http from "http";
@@ -34,22 +50,6 @@ async function hasValidToken() {
34
50
  return stored !== null;
35
51
  }
36
52
 
37
- // src/lib/config.ts
38
- import { config as loadEnv } from "dotenv";
39
- if (process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test") {
40
- loadEnv();
41
- }
42
- var DEFAULT_CONFIG = {
43
- consoleUrl: "https://app.groupchatty.com",
44
- wsUrl: "wss://api.groupchatty.com/socket"
45
- };
46
- function getConfig() {
47
- return {
48
- consoleUrl: process.env.GROUPCHAT_CONSOLE_URL || DEFAULT_CONFIG.consoleUrl,
49
- wsUrl: process.env.GROUPCHAT_WS_URL || DEFAULT_CONFIG.wsUrl
50
- };
51
- }
52
-
53
53
  // src/auth/auth-manager.ts
54
54
  function generateState() {
55
55
  return crypto.randomBytes(32).toString("hex");