@connekz/connekz-agent 2.3.2 → 2.4.0
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/CHANGELOG.md +35 -0
- package/README.md +45 -0
- package/dist/connekz-agent.es.js +5584 -5232
- package/dist/connekz-agent.umd.js +23 -12
- package/dist/worklet-processor.js +1 -1
- package/package.json +1 -1
- package/types.d.ts +52 -5
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@connekz/connekz-agent",
|
|
3
3
|
"private": false,
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "2.
|
|
5
|
+
"version": "2.4.0",
|
|
6
6
|
"description": "A package for Connekz clients to integrate Connekz Agent into their applications.",
|
|
7
7
|
"main": "./dist/connekz-agent.umd.js",
|
|
8
8
|
"module": "./dist/connekz-agent.es.js",
|
package/types.d.ts
CHANGED
|
@@ -72,18 +72,30 @@ export type ConnectionQuality = {
|
|
|
72
72
|
/**
|
|
73
73
|
* Error codes for Connekz Agent errors.
|
|
74
74
|
*
|
|
75
|
-
* CNKZ_ERR_1001 - Unable to reach the Connekz server (wrong URL, server down, network issue)
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
75
|
+
* CNKZ_ERR_1001 - Unable to reach the Connekz server (wrong URL, server down, network/proxy issue).
|
|
76
|
+
* The agent keeps retrying automatically, walking a websocket → polling transport ladder.
|
|
77
|
+
* CNKZ_ERR_1002 - Invalid client ID or client secret. Not retried.
|
|
78
|
+
* CNKZ_ERR_1003 - Usage quota exceeded (out of tokens / connection limit). Not retried.
|
|
79
|
+
* CNKZ_ERR_1004 - Weak network connection (voice unreliable; text chat suggested)
|
|
79
80
|
* CNKZ_ERR_1005 - Agent runtime error
|
|
81
|
+
* CNKZ_ERR_1006 - Browser is offline. Reconnects automatically when connectivity returns.
|
|
82
|
+
* CNKZ_ERR_1007 - Session/ephemeral token expired. Mint a fresh token server-side and re-initialize. Not retried.
|
|
83
|
+
* CNKZ_ERR_1008 - This page's origin is not in the instance's authorized domains list. Not retried.
|
|
84
|
+
* CNKZ_ERR_1009 - Browser unsupported (no realtime transport available at all). Not retried.
|
|
85
|
+
* CNKZ_ERR_1010 - Voice unsupported in this environment (insecure context, no mic API/hardware).
|
|
86
|
+
* Text chat continues to work.
|
|
80
87
|
*/
|
|
81
88
|
export type ConnekzErrorCode =
|
|
82
89
|
| 'CNKZ_ERR_1001'
|
|
83
90
|
| 'CNKZ_ERR_1002'
|
|
84
91
|
| 'CNKZ_ERR_1003'
|
|
85
92
|
| 'CNKZ_ERR_1004'
|
|
86
|
-
| 'CNKZ_ERR_1005'
|
|
93
|
+
| 'CNKZ_ERR_1005'
|
|
94
|
+
| 'CNKZ_ERR_1006'
|
|
95
|
+
| 'CNKZ_ERR_1007'
|
|
96
|
+
| 'CNKZ_ERR_1008'
|
|
97
|
+
| 'CNKZ_ERR_1009'
|
|
98
|
+
| 'CNKZ_ERR_1010';
|
|
87
99
|
|
|
88
100
|
export type ConnekzError = {
|
|
89
101
|
code: ConnekzErrorCode;
|
|
@@ -91,6 +103,35 @@ export type ConnekzError = {
|
|
|
91
103
|
timestamp: number;
|
|
92
104
|
};
|
|
93
105
|
|
|
106
|
+
/** Environment capability snapshot (see ConnekzSocketAPI.getDiagnostics). */
|
|
107
|
+
export type ConnekzCapabilities = {
|
|
108
|
+
webSocket: boolean;
|
|
109
|
+
httpTransport: boolean;
|
|
110
|
+
secureContext: boolean;
|
|
111
|
+
online: boolean;
|
|
112
|
+
mediaDevices: boolean;
|
|
113
|
+
audioContext: boolean;
|
|
114
|
+
audioWorklet: boolean;
|
|
115
|
+
localStorage: boolean;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Connection internals snapshot for debugging and support tickets.
|
|
120
|
+
* `transportStrategy` is the ladder rung last attempted
|
|
121
|
+
* (websocket / polling-upgrade / polling-only); `activeTransport` is what
|
|
122
|
+
* engine.io is actually using when connected.
|
|
123
|
+
*/
|
|
124
|
+
export type ConnekzDiagnostics = {
|
|
125
|
+
connected: boolean;
|
|
126
|
+
connecting: boolean;
|
|
127
|
+
transportStrategy: string | null;
|
|
128
|
+
activeTransport: string | null;
|
|
129
|
+
attempts: number;
|
|
130
|
+
lastError: { code: ConnekzErrorCode; userMessage: string; devMessage: string; retryable?: boolean } | null;
|
|
131
|
+
capabilities: ConnekzCapabilities;
|
|
132
|
+
baseUrl: string;
|
|
133
|
+
};
|
|
134
|
+
|
|
94
135
|
// New: Subscription types
|
|
95
136
|
export type Unsubscriber = () => void;
|
|
96
137
|
export interface SocketSubscribeAPI {
|
|
@@ -114,6 +155,12 @@ export interface ConnekzSocketAPI {
|
|
|
114
155
|
connect: (force?: boolean) => void;
|
|
115
156
|
disconnect: () => void;
|
|
116
157
|
cleanup: () => void;
|
|
158
|
+
/**
|
|
159
|
+
* Snapshot of connection internals: transport in use, attempt count, last
|
|
160
|
+
* classified error and environment capabilities. Include this in bug
|
|
161
|
+
* reports/support tickets for connection issues.
|
|
162
|
+
*/
|
|
163
|
+
getDiagnostics: () => ConnekzDiagnostics;
|
|
117
164
|
subscribe: SocketSubscribeAPI;
|
|
118
165
|
}
|
|
119
166
|
|