@ikonai/sdk 0.0.2 → 0.0.3
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/client/ikon-client.d.ts +1 -0
- package/index.js +69 -65
- package/package.json +1 -1
package/client/ikon-client.d.ts
CHANGED
|
@@ -78,6 +78,7 @@ export declare class IkonClient {
|
|
|
78
78
|
* Disconnect from the server.
|
|
79
79
|
*/
|
|
80
80
|
disconnect(): void;
|
|
81
|
+
sendActionCall(actionId: string, payload?: string): void;
|
|
81
82
|
/**
|
|
82
83
|
* Send a protocol message to the server.
|
|
83
84
|
* Routes to appropriate channel based on the message's opcode group.
|
package/index.js
CHANGED
|
@@ -9,7 +9,7 @@ function wt(e) {
|
|
|
9
9
|
function kt(e) {
|
|
10
10
|
return wt(e) & 4294901760;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function Ve(e) {
|
|
13
13
|
const n = ce(e), d = new DataView(n.buffer, n.byteOffset, n.byteLength);
|
|
14
14
|
if (n.length < 27)
|
|
15
15
|
throw new Error("Protocol payload too short");
|
|
@@ -33,7 +33,7 @@ function Pe(e) {
|
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
function M(e, n, d) {
|
|
36
|
-
const i = ce(e), s =
|
|
36
|
+
const i = ce(e), s = Ve(i);
|
|
37
37
|
if (n !== void 0 && s.opcode !== n)
|
|
38
38
|
throw new Error(`Unexpected opcode ${s.opcode}`);
|
|
39
39
|
if (d !== void 0 && s.payloadVersion !== d)
|
|
@@ -107,7 +107,7 @@ class b {
|
|
|
107
107
|
this.writeVariableField(n, 9, a);
|
|
108
108
|
}
|
|
109
109
|
writeDictionaryField(n, d, i, s) {
|
|
110
|
-
const a = new
|
|
110
|
+
const a = new ke(d, i);
|
|
111
111
|
s(a);
|
|
112
112
|
const c = a.finish();
|
|
113
113
|
this.writeVariableField(n, 10, c);
|
|
@@ -222,7 +222,7 @@ class Fe {
|
|
|
222
222
|
10
|
|
223
223
|
/* Dict */
|
|
224
224
|
), this.count++;
|
|
225
|
-
const s = new
|
|
225
|
+
const s = new ke(n, d);
|
|
226
226
|
i(s);
|
|
227
227
|
const a = s.finish();
|
|
228
228
|
this.payload.writeBytes(a);
|
|
@@ -236,9 +236,9 @@ class Fe {
|
|
|
236
236
|
throw new Error(`Array element type is ${S[this.elementType]}, expected ${S[n]}`);
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
|
-
class
|
|
239
|
+
class ke {
|
|
240
240
|
constructor(n, d) {
|
|
241
|
-
this.keyType = n, this.valueType = d,
|
|
241
|
+
this.keyType = n, this.valueType = d, Ce(n);
|
|
242
242
|
}
|
|
243
243
|
payload = new ae();
|
|
244
244
|
count = 0;
|
|
@@ -427,7 +427,7 @@ class Ot {
|
|
|
427
427
|
10
|
|
428
428
|
/* Dict */
|
|
429
429
|
);
|
|
430
|
-
const s = new
|
|
430
|
+
const s = new ke(n, d);
|
|
431
431
|
i(s);
|
|
432
432
|
const a = s.finish();
|
|
433
433
|
this.payload.writeBytes(a), this.valueWritten = !0;
|
|
@@ -564,13 +564,13 @@ class R {
|
|
|
564
564
|
return this.ensureType(
|
|
565
565
|
9
|
|
566
566
|
/* Array */
|
|
567
|
-
),
|
|
567
|
+
), Se.create(this.payload);
|
|
568
568
|
}
|
|
569
569
|
asDictionary() {
|
|
570
570
|
return this.ensureType(
|
|
571
571
|
10
|
|
572
572
|
/* Dict */
|
|
573
|
-
),
|
|
573
|
+
), Oe.create(this.payload);
|
|
574
574
|
}
|
|
575
575
|
ensureType(n) {
|
|
576
576
|
if (this.type !== n)
|
|
@@ -585,7 +585,7 @@ class Ct extends R {
|
|
|
585
585
|
return this.type === 1;
|
|
586
586
|
}
|
|
587
587
|
}
|
|
588
|
-
class
|
|
588
|
+
class Se {
|
|
589
589
|
payload;
|
|
590
590
|
elementType;
|
|
591
591
|
count;
|
|
@@ -601,7 +601,7 @@ class ke {
|
|
|
601
601
|
this.count = K(n, i, "ArrayMalformed"), this.offset = i.offset;
|
|
602
602
|
}
|
|
603
603
|
static create(n) {
|
|
604
|
-
return new
|
|
604
|
+
return new Se(ce(n));
|
|
605
605
|
}
|
|
606
606
|
next() {
|
|
607
607
|
if (this.index >= this.count) {
|
|
@@ -641,11 +641,11 @@ class ke {
|
|
|
641
641
|
return this.offset = n.offset + d, new de(11, i);
|
|
642
642
|
}
|
|
643
643
|
case 9: {
|
|
644
|
-
const n =
|
|
644
|
+
const n = _e(this.payload, this.offset), d = this.payload.subarray(this.offset, this.offset + n);
|
|
645
645
|
return this.offset += n, new de(9, d);
|
|
646
646
|
}
|
|
647
647
|
case 10: {
|
|
648
|
-
const n =
|
|
648
|
+
const n = Le(this.payload, this.offset), d = this.payload.subarray(this.offset, this.offset + n);
|
|
649
649
|
return this.offset += n, new de(10, d);
|
|
650
650
|
}
|
|
651
651
|
default:
|
|
@@ -658,7 +658,7 @@ class de extends R {
|
|
|
658
658
|
super(n, d);
|
|
659
659
|
}
|
|
660
660
|
}
|
|
661
|
-
class
|
|
661
|
+
class Oe {
|
|
662
662
|
payload;
|
|
663
663
|
keyType;
|
|
664
664
|
valueType;
|
|
@@ -670,12 +670,12 @@ class Se {
|
|
|
670
670
|
throw new Error("Dictionary payload too short");
|
|
671
671
|
if (this.keyType = n[0] >> 4 & 15, this.valueType = n[1] >> 4 & 15, (n[0] & 15) !== 0 || (n[1] & 15) !== 0)
|
|
672
672
|
throw new Error("Dictionary key/value flags must be zero");
|
|
673
|
-
|
|
673
|
+
Ce(this.keyType);
|
|
674
674
|
const d = { offset: 2 };
|
|
675
675
|
this.count = K(n, d, "DictMalformed"), this.offset = d.offset;
|
|
676
676
|
}
|
|
677
677
|
static create(n) {
|
|
678
|
-
return new
|
|
678
|
+
return new Oe(ce(n));
|
|
679
679
|
}
|
|
680
680
|
next() {
|
|
681
681
|
if (this.index >= this.count) {
|
|
@@ -717,11 +717,11 @@ class Se {
|
|
|
717
717
|
return this.offset = n.offset + d, new R(11, i);
|
|
718
718
|
}
|
|
719
719
|
case 9: {
|
|
720
|
-
const n =
|
|
720
|
+
const n = _e(this.payload, this.offset), d = this.payload.subarray(this.offset, this.offset + n);
|
|
721
721
|
return this.offset += n, new R(9, d);
|
|
722
722
|
}
|
|
723
723
|
case 10: {
|
|
724
|
-
const n =
|
|
724
|
+
const n = Le(this.payload, this.offset), d = this.payload.subarray(this.offset, this.offset + n);
|
|
725
725
|
return this.offset += n, new R(10, d);
|
|
726
726
|
}
|
|
727
727
|
case 3:
|
|
@@ -787,8 +787,8 @@ class _ {
|
|
|
787
787
|
_.toHex(_.readUInt32LE(n, 0), 8),
|
|
788
788
|
_.toHex(_.readUInt16LE(n, 4), 4),
|
|
789
789
|
_.toHex(_.readUInt16LE(n, 6), 4),
|
|
790
|
-
|
|
791
|
-
|
|
790
|
+
Ge(n.subarray(8, 10)),
|
|
791
|
+
Ge(n.subarray(10, 16))
|
|
792
792
|
].join("-");
|
|
793
793
|
}
|
|
794
794
|
asBytes() {
|
|
@@ -906,7 +906,7 @@ function te(e) {
|
|
|
906
906
|
return -1;
|
|
907
907
|
}
|
|
908
908
|
}
|
|
909
|
-
function
|
|
909
|
+
function Ce(e) {
|
|
910
910
|
if (e === 9 || e === 11 || e === 10 || e === 1)
|
|
911
911
|
throw new Error("Dictionary keys must be primitive Teleport types");
|
|
912
912
|
}
|
|
@@ -917,7 +917,7 @@ function W(e, n, d) {
|
|
|
917
917
|
function jt(e, n) {
|
|
918
918
|
return (e[n] | e[n + 1] << 8 | e[n + 2] << 16 | e[n + 3] << 24) >>> 0;
|
|
919
919
|
}
|
|
920
|
-
function
|
|
920
|
+
function _e(e, n) {
|
|
921
921
|
if (n >= e.length)
|
|
922
922
|
throw new Error("Array payload exceeds bounds");
|
|
923
923
|
const d = e[n], i = d >> 4 & 15;
|
|
@@ -933,13 +933,13 @@ function Ce(e, n) {
|
|
|
933
933
|
w = Ee(i, e, w, "ArrayMalformed");
|
|
934
934
|
return w - n;
|
|
935
935
|
}
|
|
936
|
-
function
|
|
936
|
+
function Le(e, n) {
|
|
937
937
|
if (n + 2 > e.length)
|
|
938
938
|
throw new Error("Dictionary payload too short");
|
|
939
939
|
const d = e[n] >> 4 & 15, i = e[n + 1] >> 4 & 15;
|
|
940
940
|
if ((e[n] & 15) !== 0 || (e[n + 1] & 15) !== 0)
|
|
941
941
|
throw new Error("Dictionary key/value flags must be zero");
|
|
942
|
-
|
|
942
|
+
Ce(d);
|
|
943
943
|
const s = { offset: n + 2 }, a = K(e, s, "DictMalformed");
|
|
944
944
|
let c = s.offset;
|
|
945
945
|
for (let w = 0; w < a; w++)
|
|
@@ -961,14 +961,14 @@ function Ee(e, n, d, i) {
|
|
|
961
961
|
return W(n, a.offset, c), a.offset + c;
|
|
962
962
|
}
|
|
963
963
|
case 9:
|
|
964
|
-
return d + Ce(n, d);
|
|
965
|
-
case 10:
|
|
966
964
|
return d + _e(n, d);
|
|
965
|
+
case 10:
|
|
966
|
+
return d + Le(n, d);
|
|
967
967
|
default:
|
|
968
968
|
throw new Error(`Unsupported Teleport type ${S[e]}`);
|
|
969
969
|
}
|
|
970
970
|
}
|
|
971
|
-
function
|
|
971
|
+
function Ge(e) {
|
|
972
972
|
return Array.from(e).map((n) => n.toString(16).padStart(2, "0")).join("");
|
|
973
973
|
}
|
|
974
974
|
function ce(e) {
|
|
@@ -1034,7 +1034,7 @@ var ie;
|
|
|
1034
1034
|
}
|
|
1035
1035
|
e.fromProtocolMessage = F;
|
|
1036
1036
|
})(ie || (ie = {}));
|
|
1037
|
-
var
|
|
1037
|
+
var xe;
|
|
1038
1038
|
((e) => {
|
|
1039
1039
|
e.TeleportVersion = 2, e.TeleportOpcode = 1048578, e.TeleportLayoutHash = 2972842713, e.DescriptionFieldId = 1368629611, e.IsFinishedFieldId = 4172191587;
|
|
1040
1040
|
function n(t) {
|
|
@@ -1093,8 +1093,8 @@ var Ge;
|
|
|
1093
1093
|
return a(o, r);
|
|
1094
1094
|
}
|
|
1095
1095
|
e.fromProtocolMessage = F;
|
|
1096
|
-
})(
|
|
1097
|
-
var
|
|
1096
|
+
})(xe || (xe = {}));
|
|
1097
|
+
var We;
|
|
1098
1098
|
((e) => {
|
|
1099
1099
|
e.TeleportVersion = 1, e.TeleportOpcode = 1048610, e.TeleportLayoutHash = 2437970869, e.AudioStreamIdFieldId = 1699580607, e.FadeoutTimeInSecFieldId = 2279034664;
|
|
1100
1100
|
function n(t) {
|
|
@@ -1153,8 +1153,8 @@ var xe;
|
|
|
1153
1153
|
return a(o, r);
|
|
1154
1154
|
}
|
|
1155
1155
|
e.fromProtocolMessage = F;
|
|
1156
|
-
})(
|
|
1157
|
-
var
|
|
1156
|
+
})(We || (We = {}));
|
|
1157
|
+
var Ne;
|
|
1158
1158
|
((e) => {
|
|
1159
1159
|
e.TeleportVersion = 1, e.TeleportOpcode = 1048577, e.TeleportLayoutHash = 1470463683, e.ActionIdFieldId = 727023925, e.CallArgumentsJsonFieldId = 2749491771, e.ClientFunctionResultsFieldId = 3123601234, e.CallIdFieldId = 3748161056;
|
|
1160
1160
|
function n(r) {
|
|
@@ -1298,7 +1298,7 @@ var We;
|
|
|
1298
1298
|
}
|
|
1299
1299
|
}
|
|
1300
1300
|
})(e.ActionClientFunctionResult || (e.ActionClientFunctionResult = {}));
|
|
1301
|
-
})(
|
|
1301
|
+
})(Ne || (Ne = {}));
|
|
1302
1302
|
var Ke;
|
|
1303
1303
|
((e) => {
|
|
1304
1304
|
e.TeleportVersion = 1, e.TeleportOpcode = 1048616, e.TeleportLayoutHash = 3168041334, e.ResultJsonFieldId = 3403385840, e.CallIdFieldId = 3748161056;
|
|
@@ -5213,7 +5213,7 @@ var Kr;
|
|
|
5213
5213
|
}
|
|
5214
5214
|
e.fromProtocolMessage = F;
|
|
5215
5215
|
})(Kr || (Kr = {}));
|
|
5216
|
-
var
|
|
5216
|
+
var ye;
|
|
5217
5217
|
((e) => {
|
|
5218
5218
|
e.TeleportVersion = 5, e.TeleportOpcode = 65537, e.TeleportLayoutHash = 2640453758, e.CertHashFieldId = 166277978, e.EntrypointsFieldId = 1482635149, e.ChannelIdFieldId = 1559330978, e.ClientContextFieldId = 2802434353, e.ServerContextFieldId = 3085883711, e.FeatureFlagsFieldId = 3669484338, e.SpaceIdFieldId = 3707543140, e.PrimaryUserIdFieldId = 3712281496, e.ChannelTemplateIdFieldId = 4160646707;
|
|
5219
5219
|
function n(o) {
|
|
@@ -5348,7 +5348,7 @@ var Ne;
|
|
|
5348
5348
|
}
|
|
5349
5349
|
return l;
|
|
5350
5350
|
}
|
|
5351
|
-
})(
|
|
5351
|
+
})(ye || (ye = {}));
|
|
5352
5352
|
var Jr;
|
|
5353
5353
|
((e) => {
|
|
5354
5354
|
e.TeleportVersion = 2, e.TeleportOpcode = 65538, e.TeleportLayoutHash = 1906806456, e.SecretFieldId = 492729512, e.HostFieldId = 809220361, e.OpcodeGroupsFromServerFieldId = 1175184220, e.HttpsPortFieldId = 1804433001, e.ClientContextFieldId = 2802434353, e.OpcodeGroupsToServerFieldId = 3686066300, e.TcpPortFieldId = 3855320950;
|
|
@@ -5501,7 +5501,7 @@ var $r;
|
|
|
5501
5501
|
}
|
|
5502
5502
|
e.fromProtocolMessage = F;
|
|
5503
5503
|
})($r || ($r = {}));
|
|
5504
|
-
var
|
|
5504
|
+
var Me;
|
|
5505
5505
|
((e) => {
|
|
5506
5506
|
e.TeleportVersion = 1, e.TeleportOpcode = 0, e.TeleportLayoutHash = 2168354635, e.DeviceIdFieldId = 76337612, e.InstallIdFieldId = 185396121, e.UserAgentFieldId = 388632637, e.ContextTypeFieldId = 417197284, e.HasInputFieldId = 469070965, e.UserTypeFieldId = 470595159, e.UserIdFieldId = 781727218, e.ProductIdFieldId = 834078886, e.AuthSessionIdFieldId = 1043273762, e.OpcodeGroupsFromServerFieldId = 1175184220, e.ReceiveAllMessagesFieldId = 1236999138, e.DescriptionFieldId = 1368629611, e.LocaleFieldId = 1715899485, e.PayloadTypeFieldId = 2142346422, e.VersionIdFieldId = 2598291686, e.ClientTypeFieldId = 2810953526, e.ParametersFieldId = 2885165957, e.IsInternalFieldId = 3586157513, e.OpcodeGroupsToServerFieldId = 3686066300, e.ChannelLocaleFieldId = 3717933110, e.ProtocolVersionFieldId = 3828903910, e.ServerSessionIdFieldId = 3914217035, e.EmbeddedSpaceIdFieldId = 4062655306;
|
|
5507
5507
|
function n(r) {
|
|
@@ -5704,7 +5704,7 @@ var ye;
|
|
|
5704
5704
|
}
|
|
5705
5705
|
return o;
|
|
5706
5706
|
}
|
|
5707
|
-
})(
|
|
5707
|
+
})(Me || (Me = {}));
|
|
5708
5708
|
var se;
|
|
5709
5709
|
((e) => {
|
|
5710
5710
|
e.TeleportVersion = 1, e.TeleportOpcode = 0, e.TeleportLayoutHash = 2083170344, e.AuthTicketFieldId = 746516514, e.PriorityFieldId = 877841741, e.OpcodeGroupsFromServerFieldId = 1175184220, e.DescriptionFieldId = 1368629611, e.UriFieldId = 2341021724, e.TypeFieldId = 3167053791, e.OpcodeGroupsToServerFieldId = 3686066300;
|
|
@@ -13529,17 +13529,17 @@ var ct;
|
|
|
13529
13529
|
}
|
|
13530
13530
|
e.fromProtocolMessage = F;
|
|
13531
13531
|
})(ct || (ct = {}));
|
|
13532
|
-
class
|
|
13532
|
+
class De extends Error {
|
|
13533
13533
|
constructor(n, d) {
|
|
13534
13534
|
super(n), this.cause = d, this.name = "ConnectionError";
|
|
13535
13535
|
}
|
|
13536
13536
|
}
|
|
13537
|
-
class j extends
|
|
13537
|
+
class j extends De {
|
|
13538
13538
|
constructor(n, d) {
|
|
13539
13539
|
super(n, d), this.name = "AuthenticationError";
|
|
13540
13540
|
}
|
|
13541
13541
|
}
|
|
13542
|
-
class oe extends
|
|
13542
|
+
class oe extends De {
|
|
13543
13543
|
constructor(n, d) {
|
|
13544
13544
|
super(n, d), this.name = "TransportError";
|
|
13545
13545
|
}
|
|
@@ -13549,7 +13549,7 @@ class Tt extends oe {
|
|
|
13549
13549
|
super(`No keepalive received within ${n}ms`), this.name = "KeepaliveTimeoutError";
|
|
13550
13550
|
}
|
|
13551
13551
|
}
|
|
13552
|
-
class Ht extends
|
|
13552
|
+
class Ht extends De {
|
|
13553
13553
|
constructor(n) {
|
|
13554
13554
|
super(`Maximum reconnection attempts (${n}) exceeded`), this.name = "MaxRetriesExceededError";
|
|
13555
13555
|
}
|
|
@@ -13575,12 +13575,12 @@ class Wt extends j {
|
|
|
13575
13575
|
}
|
|
13576
13576
|
}
|
|
13577
13577
|
var ht = /* @__PURE__ */ ((e) => (e[e.DEBUG = 0] = "DEBUG", e[e.INFO = 1] = "INFO", e[e.WARN = 2] = "WARN", e[e.ERROR = 3] = "ERROR", e[e.NONE = 4] = "NONE", e))(ht || {});
|
|
13578
|
-
let
|
|
13578
|
+
let je = 1, Ie = null;
|
|
13579
13579
|
function ml(e) {
|
|
13580
|
-
|
|
13580
|
+
je = e;
|
|
13581
13581
|
}
|
|
13582
13582
|
function El() {
|
|
13583
|
-
return
|
|
13583
|
+
return je;
|
|
13584
13584
|
}
|
|
13585
13585
|
function Kt(e) {
|
|
13586
13586
|
Ie = e;
|
|
@@ -13607,7 +13607,7 @@ function ue(e, n, d, i) {
|
|
|
13607
13607
|
component: n,
|
|
13608
13608
|
message: d,
|
|
13609
13609
|
args: i
|
|
13610
|
-
}),
|
|
13610
|
+
}), je <= e) {
|
|
13611
13611
|
const c = $t(n, d);
|
|
13612
13612
|
switch (e) {
|
|
13613
13613
|
case 0:
|
|
@@ -13691,7 +13691,7 @@ class Rt {
|
|
|
13691
13691
|
}
|
|
13692
13692
|
handleProtocolMessage(n) {
|
|
13693
13693
|
try {
|
|
13694
|
-
if (
|
|
13694
|
+
if (Ve(n).opcode === J.KEEPALIVE_REQUEST) {
|
|
13695
13695
|
z.debug("Received keepalive request, sending response");
|
|
13696
13696
|
const s = le.toProtocolMessage(le.create(), { senderId: this.sessionId });
|
|
13697
13697
|
this.send(s), this.resetKeepaliveTimeout();
|
|
@@ -13783,7 +13783,7 @@ class zt {
|
|
|
13783
13783
|
*/
|
|
13784
13784
|
handleProtocolMessage(n) {
|
|
13785
13785
|
try {
|
|
13786
|
-
if (
|
|
13786
|
+
if (Ve(n).opcode === J.KEEPALIVE_REQUEST) {
|
|
13787
13787
|
v.debug("Received keepalive request, sending response");
|
|
13788
13788
|
const s = le.toProtocolMessage(le.create(), { senderId: this.sessionId });
|
|
13789
13789
|
this.send(s), this.resetKeepaliveTimeout();
|
|
@@ -14151,7 +14151,7 @@ class Xt {
|
|
|
14151
14151
|
}
|
|
14152
14152
|
}
|
|
14153
14153
|
const qt = 5e3, Zt = 3e4, Qt = 125e3, Bt = 500, At = 6, bt = 6e4, Ut = {}, D = Z("Authenticator"), ne = J.GROUP_CORE | J.GROUP_KEEPALIVE | J.GROUP_EVENTS | J.GROUP_ACTIONS | J.GROUP_UI | J.GROUP_AUDIO | J.GROUP_VIDEO, el = 1e3, rl = 5e3;
|
|
14154
|
-
function
|
|
14154
|
+
function He() {
|
|
14155
14155
|
return "device-" + Math.random().toString(36).substring(2, 15);
|
|
14156
14156
|
}
|
|
14157
14157
|
async function ol(e) {
|
|
@@ -14277,7 +14277,7 @@ async function yt(e, n, d, i, s) {
|
|
|
14277
14277
|
throw new j(`Unexpected channel state: ${I.state}`);
|
|
14278
14278
|
}
|
|
14279
14279
|
}
|
|
14280
|
-
async function
|
|
14280
|
+
async function ve(e, n) {
|
|
14281
14281
|
const d = await fetch(e, { signal: n });
|
|
14282
14282
|
if (!d.ok) {
|
|
14283
14283
|
const c = await d.text().catch(() => "Unknown error");
|
|
@@ -14285,11 +14285,11 @@ async function He(e, n) {
|
|
|
14285
14285
|
}
|
|
14286
14286
|
const i = await d.arrayBuffer(), s = new Uint8Array(i);
|
|
14287
14287
|
D.debug(`Received AuthResponse: ${s.length} bytes`);
|
|
14288
|
-
const a =
|
|
14288
|
+
const a = ye.fromProtocolMessage(s);
|
|
14289
14289
|
return D.debug(`Got ${a.Entrypoints.length} entrypoints`), { authResponse: a };
|
|
14290
14290
|
}
|
|
14291
14291
|
function cl(e, n) {
|
|
14292
|
-
return
|
|
14292
|
+
return Me.create({
|
|
14293
14293
|
ServerSessionId: "",
|
|
14294
14294
|
// Server will fill this in
|
|
14295
14295
|
ContextType: he.Browser,
|
|
@@ -14298,7 +14298,7 @@ function cl(e, n) {
|
|
|
14298
14298
|
IsInternal: !1,
|
|
14299
14299
|
Description: e.description ?? "Ikon SDK TypeScript",
|
|
14300
14300
|
UserId: n,
|
|
14301
|
-
DeviceId: e.deviceId ??
|
|
14301
|
+
DeviceId: e.deviceId ?? He(),
|
|
14302
14302
|
ProductId: e.productId ?? "ikon-sdk",
|
|
14303
14303
|
VersionId: e.versionId ?? "1.0.0",
|
|
14304
14304
|
InstallId: e.installId ?? "",
|
|
@@ -14367,7 +14367,7 @@ async function fl(e, n) {
|
|
|
14367
14367
|
throw new j("Server did not return a token");
|
|
14368
14368
|
D.debug("Got JWT token, requesting connection...");
|
|
14369
14369
|
const F = `${d}/connect?token=${encodeURIComponent(I)}`;
|
|
14370
|
-
return
|
|
14370
|
+
return ve(F, n);
|
|
14371
14371
|
}
|
|
14372
14372
|
async function wl(e, n) {
|
|
14373
14373
|
D.debug("Starting browser authentication");
|
|
@@ -14380,7 +14380,7 @@ async function wl(e, n) {
|
|
|
14380
14380
|
clientType: Te.DesktopWeb,
|
|
14381
14381
|
payloadType: pe.Teleport,
|
|
14382
14382
|
description: e.description ?? "Ikon SDK TypeScript",
|
|
14383
|
-
deviceId: e.deviceId ??
|
|
14383
|
+
deviceId: e.deviceId ?? He(),
|
|
14384
14384
|
productId: e.productId ?? "",
|
|
14385
14385
|
versionId: e.versionId ?? "",
|
|
14386
14386
|
installId: e.installId ?? "",
|
|
@@ -14396,7 +14396,7 @@ async function wl(e, n) {
|
|
|
14396
14396
|
if (!F.configuration?.url)
|
|
14397
14397
|
throw new j("Backend did not return a connect URL");
|
|
14398
14398
|
const t = F.configuration.url;
|
|
14399
|
-
return D.debug("Got connect URL, authenticating with Ikon server"),
|
|
14399
|
+
return D.debug("Got connect URL, authenticating with Ikon server"), ve(t, n);
|
|
14400
14400
|
}
|
|
14401
14401
|
async function Il(e, n) {
|
|
14402
14402
|
D.debug("Starting API key authentication");
|
|
@@ -14441,7 +14441,7 @@ async function Il(e, n) {
|
|
|
14441
14441
|
clientType: e.clientType ?? Te.DesktopWeb,
|
|
14442
14442
|
payloadType: pe.Teleport,
|
|
14443
14443
|
description: e.description ?? "Ikon SDK TypeScript",
|
|
14444
|
-
deviceId: e.deviceId ??
|
|
14444
|
+
deviceId: e.deviceId ?? He(),
|
|
14445
14445
|
productId: e.productId ?? "",
|
|
14446
14446
|
versionId: e.versionId ?? "",
|
|
14447
14447
|
installId: e.installId ?? "",
|
|
@@ -14457,7 +14457,7 @@ async function Il(e, n) {
|
|
|
14457
14457
|
if (!r.configuration?.url)
|
|
14458
14458
|
throw new j("Backend did not return a connect URL");
|
|
14459
14459
|
const o = r.configuration.url;
|
|
14460
|
-
return D.debug("Got connect URL, authenticating with Ikon server"),
|
|
14460
|
+
return D.debug("Got connect URL, authenticating with Ikon server"), ve(o, n);
|
|
14461
14461
|
}
|
|
14462
14462
|
const Q = Z("EndpointSelector"), ft = {
|
|
14463
14463
|
[L.WebTransport]: 0,
|
|
@@ -14621,6 +14621,10 @@ class yl {
|
|
|
14621
14621
|
disconnect() {
|
|
14622
14622
|
H.info("Disconnecting from Ikon server..."), this.clearTimers(), this.cleanupLifecycleHandlers(), this.abortController?.abort(), this.abortController = null, this.channelManager?.disconnect(), this.channelManager = null, this.authResponse = null, this._sessionId = void 0, this.setState("idle");
|
|
14623
14623
|
}
|
|
14624
|
+
sendActionCall(n, d) {
|
|
14625
|
+
const i = Ne.toProtocolMessage({ ActionId: n, CallId: "", CallArgumentsJson: d ?? "{}", ClientFunctionResults: [] });
|
|
14626
|
+
this.sendProtocolMessage(i);
|
|
14627
|
+
}
|
|
14624
14628
|
/**
|
|
14625
14629
|
* Send a protocol message to the server.
|
|
14626
14630
|
* Routes to appropriate channel based on the message's opcode group.
|
|
@@ -14798,15 +14802,15 @@ function Vl(e) {
|
|
|
14798
14802
|
return e === "offlineError";
|
|
14799
14803
|
}
|
|
14800
14804
|
const Mt = 1e3, gt = ht.INFO;
|
|
14801
|
-
let $ = [],
|
|
14805
|
+
let $ = [], ge = Mt, Pt = gt, Pe = null;
|
|
14802
14806
|
function Tl(e) {
|
|
14803
|
-
e.level < Pt || ($.push(e), $.length >
|
|
14807
|
+
e.level < Pt || ($.push(e), $.length > ge && ($ = $.slice(-ge)));
|
|
14804
14808
|
}
|
|
14805
14809
|
function hl(e) {
|
|
14806
|
-
|
|
14810
|
+
ge = e?.maxBufferSize ?? Mt, Pt = e?.minLevel ?? gt, $ = [], Kt(Tl);
|
|
14807
14811
|
}
|
|
14808
14812
|
function kl(e) {
|
|
14809
|
-
|
|
14813
|
+
Pe = e;
|
|
14810
14814
|
}
|
|
14811
14815
|
function Sl() {
|
|
14812
14816
|
return $;
|
|
@@ -14816,10 +14820,10 @@ function pl() {
|
|
|
14816
14820
|
return $ = [], e;
|
|
14817
14821
|
}
|
|
14818
14822
|
function Ol() {
|
|
14819
|
-
if (!
|
|
14823
|
+
if (!Pe || $.length === 0)
|
|
14820
14824
|
return 0;
|
|
14821
14825
|
const e = pl();
|
|
14822
|
-
return
|
|
14826
|
+
return Pe(e), e.length;
|
|
14823
14827
|
}
|
|
14824
14828
|
function Cl() {
|
|
14825
14829
|
$ = [];
|
|
@@ -14835,7 +14839,7 @@ export {
|
|
|
14835
14839
|
Gt as ChannelNotFoundError,
|
|
14836
14840
|
A as ClientReady,
|
|
14837
14841
|
Te as ClientType,
|
|
14838
|
-
|
|
14842
|
+
De as ConnectionError,
|
|
14839
14843
|
he as ContextType,
|
|
14840
14844
|
Fl as EndpointSelector,
|
|
14841
14845
|
L as EntrypointType,
|
|
@@ -14865,7 +14869,7 @@ export {
|
|
|
14865
14869
|
pt as isWebTransportSupported,
|
|
14866
14870
|
wt as readOpcode,
|
|
14867
14871
|
kt as readOpcodeGroup,
|
|
14868
|
-
|
|
14872
|
+
Ve as readProtocolMessageHeaders,
|
|
14869
14873
|
ml as setLogLevel,
|
|
14870
14874
|
Kt as setLogSink,
|
|
14871
14875
|
kl as setSendLogsCallback,
|