@ikonai/sdk 0.0.4 → 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.
- package/channel/channel-manager.d.ts +1 -1
- package/channel/channel.d.ts +1 -1
- package/client/endpoint-selector.d.ts +1 -1
- package/client/ikon-client-config.d.ts +4 -4
- package/client/ikon-client.d.ts +8 -1
- package/connection/authenticator.d.ts +8 -7
- package/index.d.ts +3 -3
- package/index.js +3295 -3073
- package/package.json +1 -1
- package/transport/transport.d.ts +1 -1
- package/transport/web-socket-transport.d.ts +1 -1
- package/transport/web-transport-transport.d.ts +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EndpointSelector } from '../client/endpoint-selector';
|
|
2
|
-
import { Entrypoint, EntrypointType, ProtocolMessage } from '
|
|
2
|
+
import { Entrypoint, EntrypointType, ProtocolMessage } from '../../../../shared/generated/src/index.ts';
|
|
3
3
|
/**
|
|
4
4
|
* ChannelManager state.
|
|
5
5
|
*/
|
package/channel/channel.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Entrypoint, EntrypointType } from '
|
|
1
|
+
import { Entrypoint, EntrypointType } from '../../../../shared/generated/src/index.ts';
|
|
2
2
|
import { LocalConfig } from './ikon-client-config';
|
|
3
3
|
/**
|
|
4
4
|
* EndpointSelector handles ordering and selection of endpoint types.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProtocolMessage } from '
|
|
1
|
+
import { ProtocolMessage } from '../../../../shared/generated/src/index.ts';
|
|
2
2
|
import { ConnectionState } from './connection-state';
|
|
3
3
|
/**
|
|
4
4
|
* Backend environment type.
|
|
@@ -32,7 +32,7 @@ export interface CommonConnectionConfig {
|
|
|
32
32
|
*/
|
|
33
33
|
description?: string;
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* Client parameters passed to the server.
|
|
36
36
|
*/
|
|
37
37
|
parameters?: Record<string, string>;
|
|
38
38
|
/**
|
|
@@ -80,9 +80,9 @@ export interface CloudConnectionConfig extends CommonConnectionConfig {
|
|
|
80
80
|
*/
|
|
81
81
|
channelKey?: string;
|
|
82
82
|
/**
|
|
83
|
-
* Optional session
|
|
83
|
+
* Optional session ID for targeting precomputed sessions.
|
|
84
84
|
*/
|
|
85
|
-
|
|
85
|
+
sessionId?: string;
|
|
86
86
|
/**
|
|
87
87
|
* Timeout for provisioning in milliseconds.
|
|
88
88
|
* Default: 60000 (60 seconds)
|
package/client/ikon-client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProtocolMessage } from '
|
|
1
|
+
import { GlobalState, ProtocolMessage } from '../../../../shared/generated/src/index.ts';
|
|
2
2
|
import { ConnectionState } from './connection-state';
|
|
3
3
|
import { IkonClientConfig } from './ikon-client-config';
|
|
4
4
|
/**
|
|
@@ -52,6 +52,8 @@ export declare class IkonClient {
|
|
|
52
52
|
private boundBeforeUnload;
|
|
53
53
|
private boundPageHide;
|
|
54
54
|
private boundVisibilityChange;
|
|
55
|
+
private _globalState;
|
|
56
|
+
private _initialGlobalStateReceived;
|
|
55
57
|
constructor(config: IkonClientConfig);
|
|
56
58
|
private _lastError;
|
|
57
59
|
/**
|
|
@@ -65,6 +67,11 @@ export declare class IkonClient {
|
|
|
65
67
|
* Returns undefined if not connected.
|
|
66
68
|
*/
|
|
67
69
|
get sessionId(): number | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Get the current GlobalState from the server.
|
|
72
|
+
* Returns null if not yet received.
|
|
73
|
+
*/
|
|
74
|
+
get globalState(): GlobalState | null;
|
|
68
75
|
/**
|
|
69
76
|
* Get the current connection state.
|
|
70
77
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthResponse } from '
|
|
1
|
+
import { AuthResponse } from '../../../../shared/generated/src/index.ts';
|
|
2
2
|
import { ApiKeyConfig, BrowserConfig, LocalConfig } from '../client/ikon-client-config';
|
|
3
3
|
/**
|
|
4
4
|
* Result of authentication - contains the AuthResponse from the server.
|
|
@@ -30,12 +30,13 @@ export declare function authenticateLocal(config: LocalConfig, signal?: AbortSig
|
|
|
30
30
|
* Authenticate with the Ikon backend using browser session cookies.
|
|
31
31
|
*
|
|
32
32
|
* Flow:
|
|
33
|
-
* 1.
|
|
34
|
-
* 2.
|
|
35
|
-
* 3. Fetch
|
|
36
|
-
* 4.
|
|
37
|
-
* 5.
|
|
38
|
-
* 6.
|
|
33
|
+
* 1. Parse URL query parameters (id → sessionId, ck → channelKey, all → parameters)
|
|
34
|
+
* 2. Derive backend URL and space domain from hostname
|
|
35
|
+
* 3. Fetch space info by domain
|
|
36
|
+
* 4. Fetch channels for space
|
|
37
|
+
* 5. Select channel (by channelKey or first available)
|
|
38
|
+
* 6. POST /rooms/connect and poll until running
|
|
39
|
+
* 7. Connect to the returned Ikon server URL
|
|
39
40
|
*/
|
|
40
41
|
export declare function authenticateBrowser(config: BrowserConfig, signal?: AbortSignal): Promise<AuthResult>;
|
|
41
42
|
/**
|
package/index.d.ts
CHANGED
|
@@ -6,9 +6,9 @@ export { ChannelManager, type ChannelManagerConfig, type ChannelManagerState } f
|
|
|
6
6
|
export { Channel, type ChannelConfig, type ChannelState } from './channel/channel';
|
|
7
7
|
export { EndpointSelector } from './client/endpoint-selector';
|
|
8
8
|
export { ConnectionError, AuthenticationError, TransportError, KeepaliveTimeoutError, MaxRetriesExceededError, ProvisioningTimeoutError, ChannelNotFoundError, SpaceNotFoundError, NoChannelsError, } from './errors';
|
|
9
|
-
export { Opcode, EntrypointType, ClientReady, UserType, ClientType, ContextType } from '
|
|
10
|
-
export type { ProtocolMessage, ProtocolMessageHeaders } from '
|
|
11
|
-
export { teleportReadOpcode as readOpcode, teleportReadOpcodeGroup as readOpcodeGroup, asProtocolMessage, readProtocolMessageHeaders } from '
|
|
9
|
+
export { Opcode, EntrypointType, ClientReady, UserType, ClientType, ContextType, GlobalState } from '../../../shared/generated/src/index.ts';
|
|
10
|
+
export type { ProtocolMessage, ProtocolMessageHeaders } from '../../../shared/generated/src/index.ts';
|
|
11
|
+
export { teleportReadOpcode as readOpcode, teleportReadOpcodeGroup as readOpcodeGroup, asProtocolMessage, readProtocolMessageHeaders } from '../../../shared/generated/src/index.ts';
|
|
12
12
|
export { isWebTransportSupported } from './transport/web-transport-transport';
|
|
13
13
|
export { setLogLevel, setLogSink, getLogLevel, getLogSink, createLogger, LogLevel } from './utils/logger';
|
|
14
14
|
export type { LogEntry, LogSink, Logger } from './utils/logger';
|