@ikonai/sdk 1.8.0 → 1.11.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/app-messaging.d.ts +13 -2
- package/app-messaging.d.ts.map +1 -0
- package/assets/audio-playback-worker-BA5LbdyM.js +1 -0
- package/assets/protocol-worker-Byc-OmNW.js +3 -0
- package/assets/video-capture-worker-DRYxkwR0.js +1 -0
- package/assets/video-playback-worker-v179IJ-C.js +1 -0
- package/assets/viseme-worker-CmvzHAbf.js +1 -0
- package/audio-constants-0i9B4zLJ.js +4 -0
- package/backend/account-functions.d.ts +22 -0
- package/backend/account-functions.d.ts.map +1 -0
- package/backend/user-account.d.ts +58 -0
- package/backend/user-account.d.ts.map +1 -0
- package/capabilities-ljRyAKpA.js +248 -0
- package/capture/capture-functions.d.ts +34 -0
- package/capture/capture-functions.d.ts.map +1 -0
- package/capture/view-capture.d.ts +35 -0
- package/capture/view-capture.d.ts.map +1 -0
- package/channel/channel-manager.d.ts +3 -2
- package/channel/channel-manager.d.ts.map +1 -0
- package/channel/channel.d.ts +6 -2
- package/channel/channel.d.ts.map +1 -0
- package/channel/index.d.ts +1 -0
- package/channel/index.d.ts.map +1 -0
- package/channel-manager-ehgy3BJp.js +878 -0
- package/client/connection-state.d.ts +1 -0
- package/client/connection-state.d.ts.map +1 -0
- package/client/endpoint-selector.d.ts +2 -1
- package/client/endpoint-selector.d.ts.map +1 -0
- package/client/ikon-client-config.d.ts +14 -1
- package/client/ikon-client-config.d.ts.map +1 -0
- package/client/ikon-client.d.ts +146 -5
- package/client/ikon-client.d.ts.map +1 -0
- package/connection/authenticator.d.ts +6 -1
- package/connection/authenticator.d.ts.map +1 -0
- package/connection/urls.d.ts +1 -0
- package/connection/urls.d.ts.map +1 -0
- package/consent/consent-api.d.ts +61 -0
- package/consent/consent-api.d.ts.map +1 -0
- package/dist-BrkppKKs.js +801 -0
- package/errors/index.d.ts +11 -0
- package/errors/index.d.ts.map +1 -0
- package/feedback/feedback-api.d.ts +63 -0
- package/feedback/feedback-api.d.ts.map +1 -0
- package/functions/browser-functions.d.ts +2 -1
- package/functions/browser-functions.d.ts.map +1 -0
- package/functions/download-functions.d.ts +20 -0
- package/functions/download-functions.d.ts.map +1 -0
- package/functions/function-registry.d.ts +2 -1
- package/functions/function-registry.d.ts.map +1 -0
- package/functions/index.d.ts +2 -0
- package/functions/index.d.ts.map +1 -0
- package/functions/media-capture-functions.d.ts +1 -0
- package/functions/media-capture-functions.d.ts.map +1 -0
- package/functions/sound-functions.d.ts +3 -1
- package/functions/sound-functions.d.ts.map +1 -0
- package/functions/type-conversion.d.ts +1 -0
- package/functions/type-conversion.d.ts.map +1 -0
- package/functions/types.d.ts +2 -1
- package/functions/types.d.ts.map +1 -0
- package/ikon-media-BQjL59S_.js +2074 -0
- package/ikon-media-capture-BiGydwdg.js +1422 -0
- package/index.d.ts +24 -11
- package/index.d.ts.map +1 -0
- package/index.js +6707 -10749
- package/log-type-DewKVFaU.js +832 -0
- package/logger-gjegmH6K.js +80 -0
- package/login/index.d.ts +1 -0
- package/login/index.d.ts.map +1 -0
- package/login/login-error-interceptor.d.ts +1 -0
- package/login/login-error-interceptor.d.ts.map +1 -0
- package/login/login-store.d.ts +1 -0
- package/login/login-store.d.ts.map +1 -0
- package/login/reprovision.d.ts +1 -0
- package/login/reprovision.d.ts.map +1 -0
- package/media/audio-constants.d.ts +1 -0
- package/media/audio-constants.d.ts.map +1 -0
- package/media/capabilities.d.ts +1 -0
- package/media/capabilities.d.ts.map +1 -0
- package/media/device-detection.d.ts +1 -0
- package/media/device-detection.d.ts.map +1 -0
- package/media/ikon-audio-capture.d.ts +23 -0
- package/media/ikon-audio-capture.d.ts.map +1 -0
- package/media/ikon-audio-playback.d.ts +3 -1
- package/media/ikon-audio-playback.d.ts.map +1 -0
- package/media/ikon-image-capture.d.ts +1 -0
- package/media/ikon-image-capture.d.ts.map +1 -0
- package/media/ikon-media-capture.d.ts +1 -0
- package/media/ikon-media-capture.d.ts.map +1 -0
- package/media/ikon-media.d.ts +1 -0
- package/media/ikon-media.d.ts.map +1 -0
- package/media/ikon-video-capture.d.ts +9 -0
- package/media/ikon-video-capture.d.ts.map +1 -0
- package/media/ikon-video-playback.d.ts +2 -1
- package/media/ikon-video-playback.d.ts.map +1 -0
- package/media/index.d.ts +1 -0
- package/media/index.d.ts.map +1 -0
- package/media/media-permission.d.ts +1 -0
- package/media/media-permission.d.ts.map +1 -0
- package/media/media-session-helper.d.ts +1 -0
- package/media/media-session-helper.d.ts.map +1 -0
- package/media/ring-buffer.d.ts +1 -0
- package/media/ring-buffer.d.ts.map +1 -0
- package/media/video-constants.d.ts +1 -0
- package/media/video-constants.d.ts.map +1 -0
- package/media/viseme-tracker.d.ts +2 -1
- package/media/viseme-tracker.d.ts.map +1 -0
- package/media-session-helper-Do-OxyU6.js +51 -0
- package/package.json +1 -1
- package/reactive/reactive-registry.d.ts +1 -0
- package/reactive/reactive-registry.d.ts.map +1 -0
- package/sha2-DPTGfEM2.js +261 -0
- package/storage.d.ts +2 -1
- package/storage.d.ts.map +1 -0
- package/transport/http-stream-transport.d.ts +17 -1
- package/transport/http-stream-transport.d.ts.map +1 -0
- package/transport/keepalive-watchdog.d.ts +32 -0
- package/transport/keepalive-watchdog.d.ts.map +1 -0
- package/transport/message-framer.d.ts +1 -0
- package/transport/message-framer.d.ts.map +1 -0
- package/transport/transport-probe.d.ts +2 -1
- package/transport/transport-probe.d.ts.map +1 -0
- package/transport/transport.d.ts +16 -1
- package/transport/transport.d.ts.map +1 -0
- package/transport/web-socket-transport.d.ts +4 -1
- package/transport/web-socket-transport.d.ts.map +1 -0
- package/transport/web-transport-support.d.ts +5 -0
- package/transport/web-transport-support.d.ts.map +1 -0
- package/transport/web-transport-transport.d.ts +4 -8
- package/transport/web-transport-transport.d.ts.map +1 -0
- package/upload/file-upload.d.ts +62 -0
- package/upload/file-upload.d.ts.map +1 -0
- package/utils/abort-signal.d.ts +1 -0
- package/utils/abort-signal.d.ts.map +1 -0
- package/utils/app-routes.d.ts +1 -0
- package/utils/app-routes.d.ts.map +1 -0
- package/utils/boot-signal.d.ts +1 -0
- package/utils/boot-signal.d.ts.map +1 -0
- package/utils/browser-compat.d.ts +1 -0
- package/utils/browser-compat.d.ts.map +1 -0
- package/utils/browser-support.d.ts +1 -0
- package/utils/browser-support.d.ts.map +1 -0
- package/utils/client-identity.d.ts +14 -0
- package/utils/client-identity.d.ts.map +1 -0
- package/utils/connect-timeline.d.ts +1 -0
- package/utils/connect-timeline.d.ts.map +1 -0
- package/utils/debug-mode.d.ts +1 -0
- package/utils/debug-mode.d.ts.map +1 -0
- package/utils/deferred.d.ts +1 -0
- package/utils/deferred.d.ts.map +1 -0
- package/utils/delay.d.ts +1 -0
- package/utils/delay.d.ts.map +1 -0
- package/utils/embedded-oauth.d.ts +1 -0
- package/utils/embedded-oauth.d.ts.map +1 -0
- package/utils/external-link.d.ts +1 -0
- package/utils/external-link.d.ts.map +1 -0
- package/utils/inspect-mode.d.ts +1 -0
- package/utils/inspect-mode.d.ts.map +1 -0
- package/utils/log-sender.d.ts +1 -0
- package/utils/log-sender.d.ts.map +1 -0
- package/utils/log-sink.d.ts +1 -0
- package/utils/log-sink.d.ts.map +1 -0
- package/utils/logger.d.ts +1 -0
- package/utils/logger.d.ts.map +1 -0
- package/utils/oauth-start-url.d.ts +22 -0
- package/utils/oauth-start-url.d.ts.map +1 -0
- package/utils/opcode-names.d.ts +1 -0
- package/utils/opcode-names.d.ts.map +1 -0
- package/utils/parent-log-forward.d.ts +23 -0
- package/utils/parent-log-forward.d.ts.map +1 -0
- package/utils/pkce.d.ts +1 -0
- package/utils/pkce.d.ts.map +1 -0
- package/utils/platform.d.ts +1 -0
- package/utils/platform.d.ts.map +1 -0
- package/utils/query-params.d.ts +21 -0
- package/utils/query-params.d.ts.map +1 -0
- package/utils/user-gesture.d.ts +1 -0
- package/utils/user-gesture.d.ts.map +1 -0
- package/utils/uuid.d.ts +1 -0
- package/utils/uuid.d.ts.map +1 -0
- package/viseme-tracker-CAtczW00.js +183 -0
- package/web-transport-support-Cdyk4mQe.js +229 -0
- package/webrtc/index.d.ts +1 -0
- package/webrtc/index.d.ts.map +1 -0
- package/webrtc/webrtc-config.d.ts +1 -0
- package/webrtc/webrtc-config.d.ts.map +1 -0
- package/webrtc/webrtc-connection.d.ts +10 -0
- package/webrtc/webrtc-connection.d.ts.map +1 -0
- package/webrtc/webrtc-reachability.d.ts +1 -0
- package/webrtc/webrtc-reachability.d.ts.map +1 -0
- package/webrtc/webrtc-signaling.d.ts +19 -1
- package/webrtc/webrtc-signaling.d.ts.map +1 -0
- package/worker/audio-capture-worker.d.ts +1 -0
- package/worker/audio-capture-worker.d.ts.map +1 -0
- package/worker/audio-playback-worker.d.ts +2 -1
- package/worker/audio-playback-worker.d.ts.map +1 -0
- package/worker/protocol-worker.d.ts +1 -0
- package/worker/protocol-worker.d.ts.map +1 -0
- package/worker/video-capture-worker.d.ts +1 -0
- package/worker/video-capture-worker.d.ts.map +1 -0
- package/worker/video-playback-worker.d.ts +2 -1
- package/worker/video-playback-worker.d.ts.map +1 -0
- package/worker/viseme-worker.d.ts +2 -1
- package/worker/viseme-worker.d.ts.map +1 -0
- package/assets/audio-playback-worker-BXZR_9iK.js +0 -1
- package/assets/protocol-worker-PNQ9dfGq.js +0 -3
- package/assets/video-capture-worker-mvwKyjOn.js +0 -1
- package/assets/video-playback-worker-DqNjooZJ.js +0 -1
- package/assets/viseme-worker-D0AKWUTO.js +0 -1
- package/capabilities-xDnE0vqq.js +0 -105
- package/vite.config.d.ts +0 -2
package/sha2-DPTGfEM2.js
ADDED
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
//#region ../../node_modules/@noble/hashes/_u64.js
|
|
2
|
+
var e = (e) => e / 2 ** 32 | 0, t = (e) => e >>> 0;
|
|
3
|
+
function n(n, r, i, a) {
|
|
4
|
+
let o = e(i), s = t(i);
|
|
5
|
+
n.setUint32(r, a ? s : o, a), n.setUint32(r + 4, a ? o : s, a);
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region ../../node_modules/@noble/hashes/utils.js
|
|
9
|
+
function r(e) {
|
|
10
|
+
return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === "Uint8Array" && "BYTES_PER_ELEMENT" in e && e.BYTES_PER_ELEMENT === 1;
|
|
11
|
+
}
|
|
12
|
+
var i = (e) => e ? `"${e}" ` : "";
|
|
13
|
+
function a(e, t = "") {
|
|
14
|
+
if (typeof e != "number") throw TypeError(i(t) + "expected number, got " + typeof e);
|
|
15
|
+
if (!Number.isSafeInteger(e) || e < 0) throw RangeError(i(t) + "expected integer >= 0, got " + e);
|
|
16
|
+
return e;
|
|
17
|
+
}
|
|
18
|
+
function o(e, t, n = "") {
|
|
19
|
+
if (r(e) && (t === void 0 || e.length === t)) return e;
|
|
20
|
+
t !== void 0 && a(t, "length");
|
|
21
|
+
let o = r(e), s = t === void 0 ? "" : ` of length ${t}`, c = o ? `length=${e.length}` : `type=${typeof e}`, l = i(n) + "expected Uint8Array" + s + ", got " + c;
|
|
22
|
+
throw o ? RangeError(l) : TypeError(l);
|
|
23
|
+
}
|
|
24
|
+
var s = (e, t) => {
|
|
25
|
+
if (typeof e != "object" || !e || Array.isArray(e)) throw TypeError((t === "object" ? "" : `"${t}" `) + "expected object, got type=" + typeof e);
|
|
26
|
+
}, c = (e, t) => {
|
|
27
|
+
s(e, t);
|
|
28
|
+
let n = Object.getPrototypeOf(e);
|
|
29
|
+
if (n !== Object.prototype && n !== null) throw TypeError(`"${t}" expected plain object`);
|
|
30
|
+
if (Object.hasOwn(e, "__proto__")) throw TypeError(`"${t}.__proto__" is not allowed`);
|
|
31
|
+
};
|
|
32
|
+
function l(e, t = !0) {
|
|
33
|
+
if (e.destroyed) throw Error("hash was destroyed");
|
|
34
|
+
if (t && e.finished) throw Error("digest() was already called");
|
|
35
|
+
}
|
|
36
|
+
function u(e, t) {
|
|
37
|
+
o(e, void 0, "output");
|
|
38
|
+
let n = t.outputLen;
|
|
39
|
+
if (!(e.length >= n)) throw RangeError("\"output\" expected length >= " + n);
|
|
40
|
+
}
|
|
41
|
+
function d(...e) {
|
|
42
|
+
for (let t = 0; t < e.length; t++) e[t].fill(0);
|
|
43
|
+
}
|
|
44
|
+
function f(e) {
|
|
45
|
+
return new DataView(e.buffer, e.byteOffset, e.byteLength);
|
|
46
|
+
}
|
|
47
|
+
function p(e, t) {
|
|
48
|
+
return e << 32 - t | e >>> t;
|
|
49
|
+
}
|
|
50
|
+
function m(e, t, n = "opts") {
|
|
51
|
+
return c(e, "defaults"), t !== void 0 && c(t, n), Object.assign(Object.create(null), e, t);
|
|
52
|
+
}
|
|
53
|
+
function h(e, t = {}) {
|
|
54
|
+
if (typeof e != "function") throw TypeError("\"hashCons\" expected function, got type=" + typeof e);
|
|
55
|
+
t = m({}, t, "info");
|
|
56
|
+
let n = (t, n) => e(n).update(t).digest(), r = e(void 0);
|
|
57
|
+
return n.outputLen = r.outputLen, n.blockLen = r.blockLen, n.canXOF = r.canXOF, n.create = (t) => e(t), Object.assign(n, t), Object.freeze(n);
|
|
58
|
+
}
|
|
59
|
+
var g = (e) => ({ oid: Uint8Array.from([
|
|
60
|
+
6,
|
|
61
|
+
9,
|
|
62
|
+
96,
|
|
63
|
+
134,
|
|
64
|
+
72,
|
|
65
|
+
1,
|
|
66
|
+
101,
|
|
67
|
+
3,
|
|
68
|
+
4,
|
|
69
|
+
2,
|
|
70
|
+
e
|
|
71
|
+
]) });
|
|
72
|
+
//#endregion
|
|
73
|
+
//#region ../../node_modules/@noble/hashes/_md.js
|
|
74
|
+
function _(e, t, n) {
|
|
75
|
+
return e & t ^ ~e & n;
|
|
76
|
+
}
|
|
77
|
+
function v(e, t, n) {
|
|
78
|
+
return e & t ^ e & n ^ t & n;
|
|
79
|
+
}
|
|
80
|
+
var y = class {
|
|
81
|
+
blockLen;
|
|
82
|
+
outputLen;
|
|
83
|
+
canXOF = !1;
|
|
84
|
+
padOffset;
|
|
85
|
+
isLE;
|
|
86
|
+
buffer;
|
|
87
|
+
view;
|
|
88
|
+
finished = !1;
|
|
89
|
+
length = 0;
|
|
90
|
+
pos = 0;
|
|
91
|
+
destroyed = !1;
|
|
92
|
+
constructor(e, t, n, r) {
|
|
93
|
+
this.blockLen = e, this.outputLen = t, this.padOffset = n, this.isLE = r, this.buffer = new Uint8Array(e), this.view = f(this.buffer);
|
|
94
|
+
}
|
|
95
|
+
update(e) {
|
|
96
|
+
l(this), o(e);
|
|
97
|
+
let { view: t, buffer: n, blockLen: r } = this, i = e.length, a = !1;
|
|
98
|
+
for (let o = 0; o < i;) {
|
|
99
|
+
let s = Math.min(r - this.pos, i - o);
|
|
100
|
+
if (s === r) {
|
|
101
|
+
let t = f(e);
|
|
102
|
+
for (; r <= i - o; o += r) this.process(t, o);
|
|
103
|
+
a = !0;
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
n.set(o === 0 && s === i ? e : e.subarray(o, o + s), this.pos), this.pos += s, o += s, this.pos === r && (this.process(t, 0), this.pos = 0, a = !0);
|
|
107
|
+
}
|
|
108
|
+
return this.length += e.length, a && this.roundClean(), this;
|
|
109
|
+
}
|
|
110
|
+
digestInto(e) {
|
|
111
|
+
l(this), u(e, this), this.finished = !0;
|
|
112
|
+
let { buffer: t, view: r, blockLen: i, isLE: a } = this, { pos: o } = this;
|
|
113
|
+
t[o++] = 128, t.fill(0, o), this.padOffset > i - o && (this.process(r, 0), t.fill(0)), n(r, i - 8, this.length * 8, a), this.process(r, 0), this.roundClean();
|
|
114
|
+
let s = e === t ? r : f(e), c = this.outputLen, d = c / 4, p = this.get();
|
|
115
|
+
if (c % 4 || d > p.length) throw Error("invalid outputLen");
|
|
116
|
+
for (let e = 0; e < d; e++) s.setUint32(4 * e, p[e], a);
|
|
117
|
+
}
|
|
118
|
+
digest() {
|
|
119
|
+
let { buffer: e, outputLen: t } = this;
|
|
120
|
+
this.digestInto(e);
|
|
121
|
+
let n = e.slice(0, t);
|
|
122
|
+
return this.destroy(), n;
|
|
123
|
+
}
|
|
124
|
+
_cloneIntoMeta(e) {
|
|
125
|
+
let { buffer: t, length: n, finished: r, destroyed: i, pos: a } = this;
|
|
126
|
+
return e.destroyed = i, e.finished = r, e.length = n, e.pos = a, a && e.buffer.set(t), e;
|
|
127
|
+
}
|
|
128
|
+
clone() {
|
|
129
|
+
return this._cloneInto();
|
|
130
|
+
}
|
|
131
|
+
}, b = /* @__PURE__ */ Uint32Array.from([
|
|
132
|
+
1779033703,
|
|
133
|
+
3144134277,
|
|
134
|
+
1013904242,
|
|
135
|
+
2773480762,
|
|
136
|
+
1359893119,
|
|
137
|
+
2600822924,
|
|
138
|
+
528734635,
|
|
139
|
+
1541459225
|
|
140
|
+
]), x = /* @__PURE__ */ Uint32Array.from([
|
|
141
|
+
1116352408,
|
|
142
|
+
1899447441,
|
|
143
|
+
3049323471,
|
|
144
|
+
3921009573,
|
|
145
|
+
961987163,
|
|
146
|
+
1508970993,
|
|
147
|
+
2453635748,
|
|
148
|
+
2870763221,
|
|
149
|
+
3624381080,
|
|
150
|
+
310598401,
|
|
151
|
+
607225278,
|
|
152
|
+
1426881987,
|
|
153
|
+
1925078388,
|
|
154
|
+
2162078206,
|
|
155
|
+
2614888103,
|
|
156
|
+
3248222580,
|
|
157
|
+
3835390401,
|
|
158
|
+
4022224774,
|
|
159
|
+
264347078,
|
|
160
|
+
604807628,
|
|
161
|
+
770255983,
|
|
162
|
+
1249150122,
|
|
163
|
+
1555081692,
|
|
164
|
+
1996064986,
|
|
165
|
+
2554220882,
|
|
166
|
+
2821834349,
|
|
167
|
+
2952996808,
|
|
168
|
+
3210313671,
|
|
169
|
+
3336571891,
|
|
170
|
+
3584528711,
|
|
171
|
+
113926993,
|
|
172
|
+
338241895,
|
|
173
|
+
666307205,
|
|
174
|
+
773529912,
|
|
175
|
+
1294757372,
|
|
176
|
+
1396182291,
|
|
177
|
+
1695183700,
|
|
178
|
+
1986661051,
|
|
179
|
+
2177026350,
|
|
180
|
+
2456956037,
|
|
181
|
+
2730485921,
|
|
182
|
+
2820302411,
|
|
183
|
+
3259730800,
|
|
184
|
+
3345764771,
|
|
185
|
+
3516065817,
|
|
186
|
+
3600352804,
|
|
187
|
+
4094571909,
|
|
188
|
+
275423344,
|
|
189
|
+
430227734,
|
|
190
|
+
506948616,
|
|
191
|
+
659060556,
|
|
192
|
+
883997877,
|
|
193
|
+
958139571,
|
|
194
|
+
1322822218,
|
|
195
|
+
1537002063,
|
|
196
|
+
1747873779,
|
|
197
|
+
1955562222,
|
|
198
|
+
2024104815,
|
|
199
|
+
2227730452,
|
|
200
|
+
2361852424,
|
|
201
|
+
2428436474,
|
|
202
|
+
2756734187,
|
|
203
|
+
3204031479,
|
|
204
|
+
3329325298
|
|
205
|
+
]), S = /* @__PURE__ */ new Uint32Array(64), C = class extends y {
|
|
206
|
+
A = 0;
|
|
207
|
+
B = 0;
|
|
208
|
+
C = 0;
|
|
209
|
+
D = 0;
|
|
210
|
+
E = 0;
|
|
211
|
+
F = 0;
|
|
212
|
+
G = 0;
|
|
213
|
+
H = 0;
|
|
214
|
+
constructor(e, t) {
|
|
215
|
+
super(64, e, 8, !1), this.A = t[0] | 0, this.B = t[1] | 0, this.C = t[2] | 0, this.D = t[3] | 0, this.E = t[4] | 0, this.F = t[5] | 0, this.G = t[6] | 0, this.H = t[7] | 0;
|
|
216
|
+
}
|
|
217
|
+
get() {
|
|
218
|
+
let { A: e, B: t, C: n, D: r, E: i, F: a, G: o, H: s } = this;
|
|
219
|
+
return [
|
|
220
|
+
e,
|
|
221
|
+
t,
|
|
222
|
+
n,
|
|
223
|
+
r,
|
|
224
|
+
i,
|
|
225
|
+
a,
|
|
226
|
+
o,
|
|
227
|
+
s
|
|
228
|
+
];
|
|
229
|
+
}
|
|
230
|
+
set(e, t, n, r, i, a, o, s) {
|
|
231
|
+
this.A = e | 0, this.B = t | 0, this.C = n | 0, this.D = r | 0, this.E = i | 0, this.F = a | 0, this.G = o | 0, this.H = s | 0;
|
|
232
|
+
}
|
|
233
|
+
_cloneInto(e) {
|
|
234
|
+
return (e ||= new this.constructor()).set(...this.get()), this._cloneIntoMeta(e);
|
|
235
|
+
}
|
|
236
|
+
process(e, t) {
|
|
237
|
+
for (let n = 0; n < 16; n++, t += 4) S[n] = e.getUint32(t, !1);
|
|
238
|
+
for (let e = 16; e < 64; e++) {
|
|
239
|
+
let t = S[e - 15], n = S[e - 2], r = p(t, 7) ^ p(t, 18) ^ t >>> 3, i = p(n, 17) ^ p(n, 19) ^ n >>> 10;
|
|
240
|
+
S[e] = i + S[e - 7] + r + S[e - 16] | 0;
|
|
241
|
+
}
|
|
242
|
+
let { A: n, B: r, C: i, D: a, E: o, F: s, G: c, H: l } = this;
|
|
243
|
+
for (let e = 0; e < 64; e++) {
|
|
244
|
+
let t = p(o, 6) ^ p(o, 11) ^ p(o, 25), u = l + t + _(o, s, c) + x[e] + S[e] | 0, d = (p(n, 2) ^ p(n, 13) ^ p(n, 22)) + v(n, r, i) | 0;
|
|
245
|
+
l = c, c = s, s = o, o = a + u | 0, a = i, i = r, r = n, n = u + d | 0;
|
|
246
|
+
}
|
|
247
|
+
n = n + this.A | 0, r = r + this.B | 0, i = i + this.C | 0, a = a + this.D | 0, o = o + this.E | 0, s = s + this.F | 0, c = c + this.G | 0, l = l + this.H | 0, this.set(n, r, i, a, o, s, c, l);
|
|
248
|
+
}
|
|
249
|
+
roundClean() {
|
|
250
|
+
d(S);
|
|
251
|
+
}
|
|
252
|
+
destroy() {
|
|
253
|
+
this.destroyed = !0, this.set(0, 0, 0, 0, 0, 0, 0, 0), d(this.buffer);
|
|
254
|
+
}
|
|
255
|
+
}, w = class extends C {
|
|
256
|
+
constructor() {
|
|
257
|
+
super(32, b);
|
|
258
|
+
}
|
|
259
|
+
}, T = /* @__PURE__ */ h(() => new w(), /* @__PURE__ */ g(1));
|
|
260
|
+
//#endregion
|
|
261
|
+
export { T as sha256 };
|
package/storage.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* Get or create a persistent device ID.
|
|
6
6
|
* Uses randomUuid() and stores in localStorage for persistence across sessions.
|
|
7
|
-
* Falls back to
|
|
7
|
+
* Falls back to a page-lifetime id when localStorage is unavailable.
|
|
8
8
|
*/
|
|
9
9
|
export declare function getOrCreateDeviceId(): string;
|
|
10
10
|
/**
|
|
@@ -31,3 +31,4 @@ export interface AuthTokenClaims {
|
|
|
31
31
|
* `role`). Returns null if the token cannot be decoded.
|
|
32
32
|
*/
|
|
33
33
|
export declare function extractAuthClaimsFromToken(token: string): AuthTokenClaims | null;
|
|
34
|
+
//# sourceMappingURL=storage.d.ts.map
|
package/storage.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../sdk/sdk/src/storage.ts"],"names":[],"mappings":"AAAA;;GAEG;AAkBH;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAkB5C;AAED;;;GAGG;AACH,wBAAgB,aAAa,IAAI,IAAI,CAQpC;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGnE;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAShF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProtocolMessage } from '
|
|
1
|
+
import { ProtocolMessage } from '@ikonai/protocol';
|
|
2
2
|
import { HttpStreamMode, Transport, TransportConfig } from './transport';
|
|
3
3
|
/**
|
|
4
4
|
* Carries the protocol over ordinary HTTP requests, for networks that permit HTTPS to the app's
|
|
@@ -102,6 +102,22 @@ export declare class HttpStreamTransport implements Transport {
|
|
|
102
102
|
private handleProtocolMessage;
|
|
103
103
|
private handleClose;
|
|
104
104
|
private abortDownstream;
|
|
105
|
+
checkKeepaliveNow(): void;
|
|
106
|
+
checkKeepaliveWithin(maxSilenceMs: number): void;
|
|
105
107
|
private resetKeepaliveTimeout;
|
|
106
108
|
private clearKeepaliveTimeout;
|
|
107
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
* Reassembles the protocol byte stream out of SSE `data:` lines.
|
|
112
|
+
*
|
|
113
|
+
* Deliberately not a full SSE parser: the server emits one shape — an optional comment preamble and
|
|
114
|
+
* `data: <base64>` records — and event names, ids and retry fields never appear.
|
|
115
|
+
*/
|
|
116
|
+
export declare class SseDecoder {
|
|
117
|
+
private static readonly MaxLineLength;
|
|
118
|
+
private readonly decoder;
|
|
119
|
+
private pending;
|
|
120
|
+
push(chunk: Uint8Array, onMessage: (message: Uint8Array) => void): void;
|
|
121
|
+
private assertWithinLineBound;
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=http-stream-transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-stream-transport.d.ts","sourceRoot":"","sources":["../../../../sdk/sdk/src/transport/http-stream-transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuF,KAAK,eAAe,EAA8B,MAAM,kBAAkB,CAAC;AAKzK,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AA8B9E;;;;;;;;;;GAUG;AACH,qBAAa,mBAAoB,YAAW,SAAS;IACnD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuB;IAC9C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA+B;IACzD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAS;IAC5C,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAS;IAC7C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA6B;IACxD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA6B;IAE3D,OAAO,CAAC,OAAO,CAAM;IACrB,OAAO,CAAC,GAAG,CAAM;IACjB,OAAO,CAAC,IAAI,CAA4B;IACxC,OAAO,CAAC,eAAe,CAAgC;IACvD,OAAO,CAAC,SAAS,CAAkC;IACnD,OAAO,CAAC,wBAAwB,CAAgC;IAChE,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,UAAU,CAAS;IAE3B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAoB;IAC9C,OAAO,CAAC,eAAe,CAAS;IAGhC,OAAO,CAAC,oBAAoB,CAA6B;gBAE7C,MAAM,EAAE,eAAe;IASnC,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED,6FAA6F;IAC7F,IAAI,UAAU,IAAI,cAAc,CAE/B;IAEK,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAiDjE,IAAI,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;IAUpC,KAAK,IAAI,IAAI;IAQb;;;;;;;;OAQG;YACW,QAAQ;IAetB;;;;;;;;;;OAUG;YACW,WAAW;IA+BzB;;;;;;OAMG;YACW,cAAc;IA4C5B;;;;;OAKG;YACW,iBAAiB;YA2CjB,YAAY;IAwB1B;;;;;;OAMG;YACW,WAAW;IA4CzB;;;;;OAKG;IACH,OAAO,CAAC,SAAS;IA4BjB,OAAO,CAAC,SAAS;IAIjB;;;OAGG;IACH,OAAO,CAAC,OAAO;IAIf,OAAO,CAAC,OAAO;IAIf,OAAO,CAAC,oBAAoB;IAQ5B,OAAO,CAAC,qBAAqB;IA2B7B,OAAO,CAAC,WAAW;IAenB,OAAO,CAAC,eAAe;IAOvB,iBAAiB,IAAI,IAAI;IAIzB,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAIhD,OAAO,CAAC,qBAAqB;IAQ7B,OAAO,CAAC,qBAAqB;CAG9B;AAiBD;;;;;GAKG;AACH,qBAAa,UAAU;IAErB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAA0C;IAE/E,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqB;IAC7C,OAAO,CAAC,OAAO,CAAM;IAErB,IAAI,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,IAAI,GAAG,IAAI;IAsBvE,OAAO,CAAC,qBAAqB;CAM9B"}
|
|
@@ -3,13 +3,45 @@ import { KeepaliveTimeoutError } from '../errors';
|
|
|
3
3
|
* The transport-side dead-link detector, one implementation for every transport: the server
|
|
4
4
|
* promises a keepalive cadence at connect, and a silence longer than the promised watchdog closes
|
|
5
5
|
* the transport so the reconnect ladder can take over.
|
|
6
|
+
*
|
|
7
|
+
* The timer alone is not enough in a browser: a suspended tab's timers do not fire on schedule, so
|
|
8
|
+
* a link that died while the tab slept keeps looking alive after it wakes. The watchdog therefore
|
|
9
|
+
* also remembers the wall-clock time of the last keepalive; {@link checkNow} compares against it
|
|
10
|
+
* on wake, closing the transport immediately when the cadence was missed during the suspension.
|
|
11
|
+
*
|
|
12
|
+
* The promised cadence is sized for the worst case the server allows itself, so it is far too
|
|
13
|
+
* patient for a link something else already gives reason to doubt — a browser reporting the
|
|
14
|
+
* interface gone. {@link checkWithin} is that case: the caller names a shorter budget, and the
|
|
15
|
+
* link is asked to prove itself with traffic inside it.
|
|
6
16
|
*/
|
|
7
17
|
export declare class KeepaliveWatchdog {
|
|
8
18
|
private readonly timeoutMs;
|
|
9
19
|
private readonly what;
|
|
10
20
|
private readonly onTimeout;
|
|
11
21
|
private timeout;
|
|
22
|
+
private lastResetAt;
|
|
12
23
|
constructor(timeoutMs: number, what: string, onTimeout: (error: KeepaliveTimeoutError) => void);
|
|
13
24
|
reset(): void;
|
|
25
|
+
/**
|
|
26
|
+
* Wall-clock verification of the promised cadence, for the moments scheduled timers cannot
|
|
27
|
+
* serve (a tab resuming from suspension). Fires the timeout handler when the cadence was
|
|
28
|
+
* missed; a no-op while the watchdog is disarmed or disabled.
|
|
29
|
+
*/
|
|
30
|
+
checkNow(): void;
|
|
31
|
+
/**
|
|
32
|
+
* Hold the link to a shorter budget than the promised cadence, for when something outside the
|
|
33
|
+
* transport gives reason to doubt it but cannot prove anything — a browser reporting the network
|
|
34
|
+
* gone, which is a hint and not evidence, and which some devices get plainly wrong.
|
|
35
|
+
*
|
|
36
|
+
* Traffic is what answers: any inbound message calls {@link reset}, which clears this deadline
|
|
37
|
+
* and restores the negotiated budget, so a link that is merely slandered survives being asked.
|
|
38
|
+
* Silence past the budget closes the transport through the same path a dead link always takes.
|
|
39
|
+
*
|
|
40
|
+
* @param maxSilenceMs - The tightened budget. Never lengthens the standing deadline; a budget
|
|
41
|
+
* longer than the promised cadence is capped to it.
|
|
42
|
+
*/
|
|
43
|
+
checkWithin(maxSilenceMs: number): void;
|
|
14
44
|
clear(): void;
|
|
45
|
+
private fire;
|
|
15
46
|
}
|
|
47
|
+
//# sourceMappingURL=keepalive-watchdog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keepalive-watchdog.d.ts","sourceRoot":"","sources":["../../../../sdk/sdk/src/transport/keepalive-watchdog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAKlD;;;;;;;;;;;;;;GAcG;AACH,qBAAa,iBAAiB;IAK1B,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAN5B,OAAO,CAAC,OAAO,CAA8C;IAC7D,OAAO,CAAC,WAAW,CAAK;gBAGL,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI;IAGpE,KAAK,IAAI,IAAI;IAsBb;;;;OAIG;IACH,QAAQ,IAAI,IAAI;IAahB;;;;;;;;;;;OAWG;IACH,WAAW,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAuBvC,KAAK,IAAI,IAAI;IAOb,OAAO,CAAC,IAAI;CAIb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-framer.d.ts","sourceRoot":"","sources":["../../../../sdk/sdk/src/transport/message-framer.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;GAUG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAuD;IACrE,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,YAAY,CAAK;IAEzB,OAAO,CAAC,QAAQ,CAAyB;IACzC,OAAO,CAAC,cAAc,CAAgC;IAEtD;;;;;;;;OAQG;IACH,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,IAAI,GAAG,IAAI;IAgCtE,qFAAqF;IACrF,KAAK,IAAI,IAAI;IAKb;;;OAGG;IACH,OAAO,CAAC,MAAM;IAsBd,OAAO,CAAC,WAAW;CAUpB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EntrypointType } from '
|
|
1
|
+
import { EntrypointType } from '@ikonai/protocol';
|
|
2
2
|
/**
|
|
3
3
|
* Can this client still reach an entrypoint over the given transport?
|
|
4
4
|
*
|
|
@@ -17,3 +17,4 @@ export declare function probeEntrypointReachable(type: EntrypointType, uri: stri
|
|
|
17
17
|
timeoutMs?: number;
|
|
18
18
|
signal?: AbortSignal;
|
|
19
19
|
}): Promise<boolean>;
|
|
20
|
+
//# sourceMappingURL=transport-probe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport-probe.d.ts","sourceRoot":"","sources":["../../../../sdk/sdk/src/transport/transport-probe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAQlD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,cAAc,EACpB,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,WAAW,CAAA;CAAE,GACrD,OAAO,CAAC,OAAO,CAAC,CAwBlB"}
|
package/transport/transport.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProtocolMessage } from '
|
|
1
|
+
import { ProtocolMessage } from '@ikonai/protocol';
|
|
2
2
|
/**
|
|
3
3
|
* The HTTP stream transport's downstream encodings, most efficient first.
|
|
4
4
|
*
|
|
@@ -30,6 +30,20 @@ export interface Transport {
|
|
|
30
30
|
* Check if the transport is currently connected.
|
|
31
31
|
*/
|
|
32
32
|
readonly isConnected: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Verify the promised keepalive cadence by wall clock and close the transport when it was
|
|
35
|
+
* missed. Timers do not fire while a page is suspended, so a link that died during the
|
|
36
|
+
* suspension still schedules as healthy; this is the wake-time complement to the scheduled
|
|
37
|
+
* keepalive watchdog, called from the channel health check when the page becomes visible again.
|
|
38
|
+
*/
|
|
39
|
+
checkKeepaliveNow?(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Hold the link to a shorter budget than the promised cadence and close the transport when no
|
|
42
|
+
* message arrives inside it. For a suspicion raised outside the transport — a browser reporting
|
|
43
|
+
* the interface gone — which the promised cadence is far too patient to settle. Inbound traffic
|
|
44
|
+
* cancels the tightened deadline, so asking cannot disturb a live link.
|
|
45
|
+
*/
|
|
46
|
+
checkKeepaliveWithin?(maxSilenceMs: number): void;
|
|
33
47
|
}
|
|
34
48
|
/**
|
|
35
49
|
* Callbacks for transport events.
|
|
@@ -86,3 +100,4 @@ export interface TransportConfig {
|
|
|
86
100
|
*/
|
|
87
101
|
httpStreamPreferredMode?: HttpStreamMode;
|
|
88
102
|
}
|
|
103
|
+
//# sourceMappingURL=transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../../../sdk/sdk/src/transport/transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;AAEvD;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB;;;;OAIG;IACH,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5D;;OAEG;IACH,IAAI,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC;IAErC;;OAEG;IACH,KAAK,IAAI,IAAI,CAAC;IAEd;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAE9B;;;;;OAKG;IACH,iBAAiB,CAAC,IAAI,IAAI,CAAC;IAE3B;;;;;OAKG;IACH,oBAAoB,CAAC,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CACnD;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,iBAAiB,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,IAAI,CAAC;IAEjD;;;;OAIG;IACH,OAAO,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAEvD;;OAEG;IACH,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,SAAS,EAAE,kBAAkB,CAAC;IAE9B;;;OAGG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;;;OAIG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAEhC;;;;OAIG;IACH,uBAAuB,CAAC,EAAE,cAAc,CAAC;CAC1C"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProtocolMessage } from '
|
|
1
|
+
import { ProtocolMessage } from '@ikonai/protocol';
|
|
2
2
|
import { Transport, TransportConfig } from './transport';
|
|
3
3
|
/**
|
|
4
4
|
* WebSocket transport implementation for Ikon server connections.
|
|
@@ -23,6 +23,9 @@ export declare class WebSocketTransport implements Transport {
|
|
|
23
23
|
*/
|
|
24
24
|
private getKeepaliveResponse;
|
|
25
25
|
private handleProtocolMessage;
|
|
26
|
+
checkKeepaliveNow(): void;
|
|
27
|
+
checkKeepaliveWithin(maxSilenceMs: number): void;
|
|
26
28
|
private resetKeepaliveTimeout;
|
|
27
29
|
private clearKeepaliveTimeout;
|
|
28
30
|
}
|
|
31
|
+
//# sourceMappingURL=web-socket-transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-socket-transport.d.ts","sourceRoot":"","sources":["../../../../sdk/sdk/src/transport/web-socket-transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuE,KAAK,eAAe,EAA8B,MAAM,kBAAkB,CAAC;AAIzJ,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAM9D;;GAEG;AACH,qBAAa,kBAAmB,YAAW,SAAS;IAClD,OAAO,CAAC,EAAE,CAA0B;IACpC,OAAO,CAAC,SAAS,CAAkC;IACnD,OAAO,CAAC,QAAQ,CAAS;IAEzB,OAAO,CAAC,wBAAwB,CAAgC;IAGhE,OAAO,CAAC,oBAAoB,CAA6B;IACzD,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAS;IAC5C,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAS;IAC7C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA+B;IACzD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;gBAEvB,MAAM,EAAE,eAAe;IAOnC,IAAI,WAAW,IAAI,OAAO,CAEzB;IAEK,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAoHjE,IAAI,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;IAQpC,KAAK,IAAI,IAAI;IASb;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAO5B,OAAO,CAAC,qBAAqB;IA6B7B,iBAAiB,IAAI,IAAI;IAIzB,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAIhD,OAAO,CAAC,qBAAqB;IAQ7B,OAAO,CAAC,qBAAqB;CAG9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-transport-support.d.ts","sourceRoot":"","sources":["../../../../sdk/sdk/src/transport/web-transport-support.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,OAAO,CAEjD"}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import { ProtocolMessage } from '
|
|
1
|
+
import { ProtocolMessage } from '@ikonai/protocol';
|
|
2
2
|
import { Transport, TransportConfig } from './transport';
|
|
3
|
-
/**
|
|
4
|
-
* Check if WebTransport is supported in the current environment.
|
|
5
|
-
*/
|
|
6
|
-
export declare function isWebTransportSupported(): boolean;
|
|
7
3
|
/**
|
|
8
4
|
* WebTransport transport implementation for Ikon server connections.
|
|
9
5
|
*
|
|
@@ -51,9 +47,8 @@ export declare class WebTransportTransport implements Transport {
|
|
|
51
47
|
* Handle connection close.
|
|
52
48
|
*/
|
|
53
49
|
private handleClose;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
*/
|
|
50
|
+
checkKeepaliveNow(): void;
|
|
51
|
+
checkKeepaliveWithin(maxSilenceMs: number): void;
|
|
57
52
|
private resetKeepaliveTimeout;
|
|
58
53
|
private clearKeepaliveTimeout;
|
|
59
54
|
/**
|
|
@@ -61,3 +56,4 @@ export declare class WebTransportTransport implements Transport {
|
|
|
61
56
|
*/
|
|
62
57
|
private cleanup;
|
|
63
58
|
}
|
|
59
|
+
//# sourceMappingURL=web-transport-transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-transport-transport.d.ts","sourceRoot":"","sources":["../../../../sdk/sdk/src/transport/web-transport-transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuE,KAAK,eAAe,EAA8B,MAAM,kBAAkB,CAAC;AAMzJ,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAM9D;;;;;;;;;GASG;AACH,qBAAa,qBAAsB,YAAW,SAAS;IACrD,OAAO,CAAC,SAAS,CAA6B;IAC9C,OAAO,CAAC,MAAM,CAAgD;IAC9D,OAAO,CAAC,MAAM,CAAwD;IACtE,OAAO,CAAC,MAAM,CAAwD;IACtE,OAAO,CAAC,SAAS,CAAkC;IACnD,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAS;IAIzB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuB;IAG9C,OAAO,CAAC,wBAAwB,CAAgC;IAIhE,OAAO,CAAC,oBAAoB,CAA6B;IACzD,OAAO,CAAC,oBAAoB,CAAyC;IAErE,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAS;IAC5C,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAS;IAC7C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA+B;IACzD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;gBAEvB,MAAM,EAAE,eAAe;IAOnC,IAAI,WAAW,IAAI,OAAO,CAEzB;IAEK,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAqGjE,IAAI,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;IAcpC,KAAK,IAAI,IAAI;IAOb;;OAEG;YACW,aAAa;IAoC3B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAO5B;;OAEG;IACH,OAAO,CAAC,qBAAqB;IA6B7B;;OAEG;IACH,OAAO,CAAC,WAAW;IA0BnB,iBAAiB,IAAI,IAAI;IAIzB,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAIhD,OAAO,CAAC,qBAAqB;IAQ7B,OAAO,CAAC,qBAAqB;IAI7B;;OAEG;IACH,OAAO,CAAC,OAAO;CAwBhB"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { ActionFileUploadComplete2 } from '@ikonai/protocol';
|
|
2
|
+
import { IkonClient } from '../client/ikon-client';
|
|
3
|
+
/** One file to send through an app's upload action. */
|
|
4
|
+
export interface FileUploadRequest {
|
|
5
|
+
file: Blob & {
|
|
6
|
+
readonly name: string;
|
|
7
|
+
};
|
|
8
|
+
/** Chosen by the sender; the app sees it on every upload event, and a capture returns it. */
|
|
9
|
+
uploadId: string;
|
|
10
|
+
/** The upload action the app registered (a `FileUploadZone`'s, or one handed to a client function). */
|
|
11
|
+
uploadActionId: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* An upload that did not finish. `retriable` separates the failures where sending the same bytes
|
|
15
|
+
* again is likely to work — a stall, a dropped connection — from a verdict the server will simply
|
|
16
|
+
* repeat, so a caller can decide whether offering a retry is honest.
|
|
17
|
+
*/
|
|
18
|
+
export declare class UploadFailedError extends Error {
|
|
19
|
+
readonly retriable: boolean;
|
|
20
|
+
constructor(message: string, retriable: boolean);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The failure a Complete2 carries, or null when it reports success. A server that predates the
|
|
24
|
+
* verdict sends neither field, and its Complete2 always meant success — so only an explicit `false`
|
|
25
|
+
* is a failure. The verdict is the server's final word on these bytes, so it is not retriable.
|
|
26
|
+
*/
|
|
27
|
+
export declare function uploadFailureFromComplete(complete: ActionFileUploadComplete2): UploadFailedError | null;
|
|
28
|
+
export declare function uploadFile(client: IkonClient, request: FileUploadRequest): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Follows the ACK stream for one upload through a single subscription. The sender keeps several
|
|
31
|
+
* chunks outstanding at once, so more than one sequence can be waited on at a time, and a listener
|
|
32
|
+
* per chunk would mean a subscribe/unsubscribe cycle per megabyte.
|
|
33
|
+
*/
|
|
34
|
+
export declare class UploadAckTracker {
|
|
35
|
+
private readonly uploadId;
|
|
36
|
+
private readonly signal;
|
|
37
|
+
private readonly waiters;
|
|
38
|
+
private readonly unsubscribe;
|
|
39
|
+
private readonly onAbort;
|
|
40
|
+
private idleTimer;
|
|
41
|
+
private highestAcked;
|
|
42
|
+
private failure;
|
|
43
|
+
private disposed;
|
|
44
|
+
constructor(client: IkonClient, uploadId: string, signal: AbortSignal);
|
|
45
|
+
/** Resolves once the server has acknowledged this sequence. */
|
|
46
|
+
waitFor(sequenceId: number): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Releases everything waiting on an acknowledgement that can no longer arrive, so the sender can
|
|
49
|
+
* go and re-establish where the server got to instead of sitting out the idle timeout.
|
|
50
|
+
*/
|
|
51
|
+
disconnected(): void;
|
|
52
|
+
/** Re-points the tracker at the server's resume position after a reconnect. */
|
|
53
|
+
rewindTo(lastAckedSequenceId: number): void;
|
|
54
|
+
dispose(): void;
|
|
55
|
+
private onAck;
|
|
56
|
+
private resetIdleTimer;
|
|
57
|
+
private clearIdleTimer;
|
|
58
|
+
private fail;
|
|
59
|
+
/** An abort is the server's Complete2 arriving; the sender stops on its own signal check. */
|
|
60
|
+
private settleAll;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=file-upload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-upload.d.ts","sourceRoot":"","sources":["../../../../sdk/sdk/src/upload/file-upload.ts"],"names":[],"mappings":"AAAA,OAAO,EAsBL,KAAK,yBAAyB,EAG/B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGxD,uDAAuD;AACvD,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,IAAI,GAAG;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACvC,6FAA6F;IAC7F,QAAQ,EAAE,MAAM,CAAC;IACjB,uGAAuG;IACvG,cAAc,EAAE,MAAM,CAAC;CACxB;AA2BD;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;gBAEhB,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO;CAKhD;AAaD;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,yBAAyB,GAAG,iBAAiB,GAAG,IAAI,CAMvG;AA0BD,wBAAsB,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAoM9F;AAkOD;;;;GAIG;AACH,qBAAa,gBAAgB;IAWzB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAXzB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA8E;IACtG,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAa;IACzC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAa;IACrC,OAAO,CAAC,SAAS,CAA8C;IAC/D,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,OAAO,CAAsB;IACrC,OAAO,CAAC,QAAQ,CAAS;gBAGvB,MAAM,EAAE,UAAU,EACD,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,WAAW;IA8BtC,+DAA+D;IAC/D,OAAO,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAc1C;;;OAGG;IACH,YAAY,IAAI,IAAI;IAUpB,+EAA+E;IAC/E,QAAQ,CAAC,mBAAmB,EAAE,MAAM,GAAG,IAAI;IAM3C,OAAO,IAAI,IAAI;IAWf,OAAO,CAAC,KAAK;IAgBb,OAAO,CAAC,cAAc;IAatB,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,IAAI;IAWZ,6FAA6F;IAC7F,OAAO,CAAC,SAAS;CASlB"}
|
package/utils/abort-signal.d.ts
CHANGED
|
@@ -18,3 +18,4 @@ export declare function abortSignalTimeout(ms: number): AbortSignal;
|
|
|
18
18
|
* Returns an `AbortSignal` that aborts as soon as any of `signals` aborts.
|
|
19
19
|
*/
|
|
20
20
|
export declare function abortSignalAny(signals: AbortSignal[]): AbortSignal;
|
|
21
|
+
//# sourceMappingURL=abort-signal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abort-signal.d.ts","sourceRoot":"","sources":["../../../../sdk/sdk/src/utils/abort-signal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAkBH;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,WAAW,CAU1D;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,WAAW,EAAE,GAAG,WAAW,CAuBlE"}
|
package/utils/app-routes.d.ts
CHANGED
|
@@ -15,3 +15,4 @@ export declare const RESERVED_PATH_PREFIXES: readonly ["/ikon", "/api"];
|
|
|
15
15
|
* `/ikonic` and other paths that merely share a leading substring are NOT reserved.
|
|
16
16
|
*/
|
|
17
17
|
export declare function isReservedPath(path: string): boolean;
|
|
18
|
+
//# sourceMappingURL=app-routes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-routes.d.ts","sourceRoot":"","sources":["../../../../sdk/sdk/src/utils/app-routes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,4BAA6B,CAAC;AAEjE;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CASpD"}
|
package/utils/boot-signal.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boot-signal.d.ts","sourceRoot":"","sources":["../../../../sdk/sdk/src/utils/boot-signal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,wBAAgB,mBAAmB,IAAI,IAAI,CAW1C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-compat.d.ts","sourceRoot":"","sources":["../../../../sdk/sdk/src/utils/browser-compat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAkCH;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CA0FzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-support.d.ts","sourceRoot":"","sources":["../../../../sdk/sdk/src/utils/browser-support.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAaH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,eAAe,EAAE,MAAM,EAAE,CAAC;CACpC;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,oBAAoB,CAkB1D"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** This build's version, or `dev` when the bundler did not stamp one in. */
|
|
2
|
+
export declare const SDK_VERSION: string;
|
|
3
|
+
/**
|
|
4
|
+
* Names the SDK and its version on every request it makes.
|
|
5
|
+
*
|
|
6
|
+
* Not `User-Agent`: browsers refuse to let `fetch` set that one, so from the backend's side every
|
|
7
|
+
* request the web SDK makes is indistinguishable from any other page on the same browser. Diagnosing
|
|
8
|
+
* a misbehaving client meant guessing from the route it called.
|
|
9
|
+
*/
|
|
10
|
+
export declare const IKON_CLIENT_HEADER = "X-Ikon-Client";
|
|
11
|
+
export declare const IKON_CLIENT_HEADER_VALUE: string;
|
|
12
|
+
/** Spread into a fetch's headers; one place so a new request cannot forget to identify itself. */
|
|
13
|
+
export declare function ikonClientHeaders(): Record<string, string>;
|
|
14
|
+
//# sourceMappingURL=client-identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-identity.d.ts","sourceRoot":"","sources":["../../../../sdk/sdk/src/utils/client-identity.ts"],"names":[],"mappings":"AAKA,4EAA4E;AAC5E,eAAO,MAAM,WAAW,EAAE,MAAgF,CAAC;AAE3G;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,kBAAkB,CAAC;AAElD,eAAO,MAAM,wBAAwB,QAAuC,CAAC;AAE7E,kGAAkG;AAClG,wBAAgB,iBAAiB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAE1D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connect-timeline.d.ts","sourceRoot":"","sources":["../../../../sdk/sdk/src/utils/connect-timeline.ts"],"names":[],"mappings":"AAoBA,wBAAgB,iBAAiB,IAAI,MAAM,CAa1C;AAgFD,wBAAgB,qBAAqB,CAAC,IAAI,GAAE;IAAE,cAAc,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,IAAI,CAgDnF"}
|
package/utils/debug-mode.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug-mode.d.ts","sourceRoot":"","sources":["../../../../sdk/sdk/src/utils/debug-mode.ts"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAa7C;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAE5C;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAStC"}
|