@speechos/core 0.2.8 → 0.2.10
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/config.d.cts +1 -8
- package/dist/config.d.ts +1 -8
- package/dist/index.cjs +1 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -11
- package/dist/index.js.map +1 -1
- package/dist/types.d.cts +0 -42
- package/dist/types.d.ts +0 -42
- package/package.json +1 -1
package/dist/config.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Configuration management for SpeechOS Core SDK
|
|
3
3
|
*/
|
|
4
|
-
import type { SpeechOSCoreConfig, WebSocketFactory
|
|
4
|
+
import type { SpeechOSCoreConfig, WebSocketFactory } from "./types.js";
|
|
5
5
|
/**
|
|
6
6
|
* Default host - can be overridden by SPEECHOS_HOST env var at build time
|
|
7
7
|
*/
|
|
@@ -16,8 +16,6 @@ interface ResolvedConfig {
|
|
|
16
16
|
debug: boolean;
|
|
17
17
|
/** Custom WebSocket factory (undefined means use native WebSocket) */
|
|
18
18
|
webSocketFactory: WebSocketFactory | undefined;
|
|
19
|
-
/** Custom fetch handler (undefined means use native fetch) */
|
|
20
|
-
fetchHandler: FetchHandler | undefined;
|
|
21
19
|
/** JWT token for server-side settings persistence (undefined means no sync) */
|
|
22
20
|
settingsToken: string | undefined;
|
|
23
21
|
}
|
|
@@ -54,11 +52,6 @@ export declare function getSettingsToken(): string | undefined;
|
|
|
54
52
|
* Clear the settings token (e.g., when it expires)
|
|
55
53
|
*/
|
|
56
54
|
export declare function clearSettingsToken(): void;
|
|
57
|
-
/**
|
|
58
|
-
* Get the fetch handler from the current configuration
|
|
59
|
-
* @returns The fetch handler or undefined if not configured
|
|
60
|
-
*/
|
|
61
|
-
export declare function getFetchHandler(): FetchHandler | undefined;
|
|
62
55
|
/**
|
|
63
56
|
* Get or generate a persistent anonymous ID for Mixpanel tracking.
|
|
64
57
|
*
|
package/dist/config.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Configuration management for SpeechOS Core SDK
|
|
3
3
|
*/
|
|
4
|
-
import type { SpeechOSCoreConfig, WebSocketFactory
|
|
4
|
+
import type { SpeechOSCoreConfig, WebSocketFactory } from "./types.js";
|
|
5
5
|
/**
|
|
6
6
|
* Default host - can be overridden by SPEECHOS_HOST env var at build time
|
|
7
7
|
*/
|
|
@@ -16,8 +16,6 @@ interface ResolvedConfig {
|
|
|
16
16
|
debug: boolean;
|
|
17
17
|
/** Custom WebSocket factory (undefined means use native WebSocket) */
|
|
18
18
|
webSocketFactory: WebSocketFactory | undefined;
|
|
19
|
-
/** Custom fetch handler (undefined means use native fetch) */
|
|
20
|
-
fetchHandler: FetchHandler | undefined;
|
|
21
19
|
/** JWT token for server-side settings persistence (undefined means no sync) */
|
|
22
20
|
settingsToken: string | undefined;
|
|
23
21
|
}
|
|
@@ -54,11 +52,6 @@ export declare function getSettingsToken(): string | undefined;
|
|
|
54
52
|
* Clear the settings token (e.g., when it expires)
|
|
55
53
|
*/
|
|
56
54
|
export declare function clearSettingsToken(): void;
|
|
57
|
-
/**
|
|
58
|
-
* Get the fetch handler from the current configuration
|
|
59
|
-
* @returns The fetch handler or undefined if not configured
|
|
60
|
-
*/
|
|
61
|
-
export declare function getFetchHandler(): FetchHandler | undefined;
|
|
62
55
|
/**
|
|
63
56
|
* Get or generate a persistent anonymous ID for Mixpanel tracking.
|
|
64
57
|
*
|
package/dist/index.cjs
CHANGED
|
@@ -37,7 +37,6 @@ const defaultConfig = {
|
|
|
37
37
|
host: DEFAULT_HOST,
|
|
38
38
|
debug: false,
|
|
39
39
|
webSocketFactory: void 0,
|
|
40
|
-
fetchHandler: void 0,
|
|
41
40
|
settingsToken: void 0
|
|
42
41
|
};
|
|
43
42
|
/**
|
|
@@ -46,14 +45,13 @@ const defaultConfig = {
|
|
|
46
45
|
* @returns Validated and merged configuration
|
|
47
46
|
*/
|
|
48
47
|
function validateConfig(userConfig) {
|
|
49
|
-
if (!userConfig.apiKey) throw new Error("SpeechOS requires an apiKey. Get one from your team dashboard at /a
|
|
48
|
+
if (!userConfig.apiKey) throw new Error("SpeechOS requires an apiKey. Get one from your team dashboard at /a/.");
|
|
50
49
|
return {
|
|
51
50
|
apiKey: userConfig.apiKey,
|
|
52
51
|
userId: userConfig.userId ?? defaultConfig.userId,
|
|
53
52
|
host: userConfig.host ?? defaultConfig.host,
|
|
54
53
|
debug: userConfig.debug ?? defaultConfig.debug,
|
|
55
54
|
webSocketFactory: userConfig.webSocketFactory ?? defaultConfig.webSocketFactory,
|
|
56
|
-
fetchHandler: userConfig.fetchHandler ?? defaultConfig.fetchHandler,
|
|
57
55
|
settingsToken: userConfig.settingsToken ?? defaultConfig.settingsToken
|
|
58
56
|
};
|
|
59
57
|
}
|
|
@@ -107,13 +105,6 @@ function clearSettingsToken() {
|
|
|
107
105
|
};
|
|
108
106
|
}
|
|
109
107
|
/**
|
|
110
|
-
* Get the fetch handler from the current configuration
|
|
111
|
-
* @returns The fetch handler or undefined if not configured
|
|
112
|
-
*/
|
|
113
|
-
function getFetchHandler() {
|
|
114
|
-
return currentConfig.fetchHandler;
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
108
|
* LocalStorage key for anonymous ID persistence
|
|
118
109
|
*/
|
|
119
110
|
const ANONYMOUS_ID_KEY = "speechos_anonymous_id";
|
|
@@ -2302,7 +2293,6 @@ exports.createStateManager = createStateManager;
|
|
|
2302
2293
|
exports.events = events;
|
|
2303
2294
|
exports.getBackend = getBackend;
|
|
2304
2295
|
exports.getConfig = getConfig;
|
|
2305
|
-
exports.getFetchHandler = getFetchHandler;
|
|
2306
2296
|
exports.getSettingsToken = getSettingsToken;
|
|
2307
2297
|
exports.livekit = livekit;
|
|
2308
2298
|
exports.resetConfig = resetConfig;
|