@interopio/fdc3-web-bridge 1.3.0 → 1.5.0-beta.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
CHANGED
|
@@ -1571,7 +1571,7 @@ Decoder.valueAt;
|
|
|
1571
1571
|
/** See `Decoder.succeed` */
|
|
1572
1572
|
Decoder.succeed;
|
|
1573
1573
|
/** See `Decoder.fail` */
|
|
1574
|
-
Decoder.fail;
|
|
1574
|
+
var fail = Decoder.fail;
|
|
1575
1575
|
/** See `Decoder.lazy` */
|
|
1576
1576
|
Decoder.lazy;
|
|
1577
1577
|
|
|
@@ -1582,11 +1582,15 @@ const regexDecoder = anyJson().andThen((value) => {
|
|
|
1582
1582
|
});
|
|
1583
1583
|
const urlDecoder = nonEmptyStringDecoder$4.andThen((url) => {
|
|
1584
1584
|
try {
|
|
1585
|
-
new URL(url);
|
|
1585
|
+
const { protocol } = new URL(url);
|
|
1586
|
+
const disallowedProtocols = ["data:", "javascript:", "vbscript:"];
|
|
1587
|
+
if (disallowedProtocols.includes(protocol)) {
|
|
1588
|
+
return fail(`Expected a URL with a safe protocol, got: ${protocol} (disallowed protocols: ${disallowedProtocols.join(", ")})`);
|
|
1589
|
+
}
|
|
1586
1590
|
return nonEmptyStringDecoder$4;
|
|
1587
1591
|
}
|
|
1588
1592
|
catch {
|
|
1589
|
-
return fail("
|
|
1593
|
+
return fail("Expected a valid URL");
|
|
1590
1594
|
}
|
|
1591
1595
|
});
|
|
1592
1596
|
|
|
@@ -1598,7 +1602,7 @@ const intentDefinitionDecoder = object({
|
|
|
1598
1602
|
});
|
|
1599
1603
|
const v2TypeDecoder = oneOf(constant("web"), constant("native"), constant("citrix"), constant("onlineNative"), constant("other"));
|
|
1600
1604
|
const v2DetailsDecoder = object({
|
|
1601
|
-
url:
|
|
1605
|
+
url: urlDecoder
|
|
1602
1606
|
});
|
|
1603
1607
|
const v2IconDecoder = object({
|
|
1604
1608
|
src: nonEmptyStringDecoder$4,
|
|
@@ -1626,18 +1630,19 @@ const v2UserChannelDecoder = object({
|
|
|
1626
1630
|
listensFor: optional(array(nonEmptyStringDecoder$4))
|
|
1627
1631
|
});
|
|
1628
1632
|
const v2AppChannelDecoder = object({
|
|
1629
|
-
name: nonEmptyStringDecoder$4,
|
|
1633
|
+
name: optional(nonEmptyStringDecoder$4),
|
|
1634
|
+
id: optional(nonEmptyStringDecoder$4),
|
|
1630
1635
|
description: optional(nonEmptyStringDecoder$4),
|
|
1631
1636
|
broadcasts: optional(array(nonEmptyStringDecoder$4)),
|
|
1632
1637
|
listensFor: optional(array(nonEmptyStringDecoder$4))
|
|
1633
|
-
});
|
|
1638
|
+
}).where((appChannel) => Boolean(appChannel.name || appChannel.id), "Expected at least a name or an id property to be present in the app channel definition");
|
|
1634
1639
|
const v2InteropDecoder = object({
|
|
1635
1640
|
intents: optional(v2IntentsDecoder),
|
|
1636
1641
|
userChannels: optional(v2UserChannelDecoder),
|
|
1637
1642
|
appChannels: optional(array(v2AppChannelDecoder))
|
|
1638
1643
|
});
|
|
1639
1644
|
const glue42ApplicationDetailsDecoder = object({
|
|
1640
|
-
url: optional(
|
|
1645
|
+
url: optional(urlDecoder),
|
|
1641
1646
|
top: optional(number()),
|
|
1642
1647
|
left: optional(number()),
|
|
1643
1648
|
width: optional(nonNegativeNumberDecoder),
|
|
@@ -2656,6 +2661,7 @@ class ChannelsController {
|
|
|
2656
2661
|
if (event.type !== "userChannelChanged") {
|
|
2657
2662
|
return;
|
|
2658
2663
|
}
|
|
2664
|
+
const currentChannelId = event.details.currentChannelId ?? null;
|
|
2659
2665
|
const response = {
|
|
2660
2666
|
type: "channelChangedEvent",
|
|
2661
2667
|
meta: {
|
|
@@ -2663,7 +2669,8 @@ class ChannelsController {
|
|
|
2663
2669
|
timestamp: new Date()
|
|
2664
2670
|
},
|
|
2665
2671
|
payload: {
|
|
2666
|
-
|
|
2672
|
+
currentChannelId,
|
|
2673
|
+
newChannelId: currentChannelId,
|
|
2667
2674
|
}
|
|
2668
2675
|
};
|
|
2669
2676
|
this.logger?.info(`Sending 'channelChangedEvent' message: ${JSON.stringify(response)}`);
|
|
@@ -3714,7 +3721,7 @@ class IoC {
|
|
|
3714
3721
|
}
|
|
3715
3722
|
}
|
|
3716
3723
|
|
|
3717
|
-
var version = "1.
|
|
3724
|
+
var version = "1.5.0-beta.0";
|
|
3718
3725
|
|
|
3719
3726
|
window.fdc3WebBridgeInfo = {
|
|
3720
3727
|
version
|