@vizbeetv/homesso-sdk-qa 1.0.2 → 1.0.4

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/es5/index.cjs CHANGED
@@ -493,19 +493,19 @@ var Logger = /** @class */ (function () {
493
493
  var logger = new Logger();
494
494
 
495
495
  var LOG_TAG$1 = 'VizbeeHomeSSOManager';
496
- /* eslint-disable @typescript-eslint/no-explicit-any */
497
496
  var VizbeeMetricsManager = /** @class */ (function () {
498
497
  function VizbeeMetricsManager() {
499
498
  var _this = this;
500
- var _a, _b, _c;
499
+ var _a, _b;
500
+ this.metricsManager = null;
501
501
  this.senderInfo = null;
502
502
  this.getSignInInfo = function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
503
503
  return [2 /*return*/, []];
504
504
  }); }); };
505
- if ((_c = (_b = (_a = window === null || window === void 0 ? void 0 : window.vizbee) === null || _a === void 0 ? void 0 : _a.continuity) === null || _b === void 0 ? void 0 : _b.analytics) === null || _c === void 0 ? void 0 : _c.AnalyticsProvider) {
505
+ var vizbee = window === null || window === void 0 ? void 0 : window.vizbee;
506
+ if ((_b = (_a = vizbee === null || vizbee === void 0 ? void 0 : vizbee.continuity) === null || _a === void 0 ? void 0 : _a.analytics) === null || _b === void 0 ? void 0 : _b.AnalyticsProvider) {
506
507
  this.metricsManager =
507
- new window.vizbee.continuity.analytics.AnalyticsProvider();
508
- // Create a wrapper with 'provider' property
508
+ new vizbee.continuity.analytics.AnalyticsProvider();
509
509
  var attributesProvider = {
510
510
  getAttributes: function () { return _this.getAttributes(); },
511
511
  };
@@ -534,7 +534,8 @@ var VizbeeMetricsManager = /** @class */ (function () {
534
534
  this.metricsManager.logMetrics(event, attributesToBeSent);
535
535
  };
536
536
  VizbeeMetricsManager.prototype.setCustomAttributes = function (customAttributes) {
537
- this.metricsManager.setCustomAttributes(customAttributes);
537
+ var _a;
538
+ (_a = this.metricsManager) === null || _a === void 0 ? void 0 : _a.setCustomAttributes(customAttributes);
538
539
  };
539
540
  VizbeeMetricsManager.prototype.getAttributes = function () {
540
541
  return this.createAttributesJson();
@@ -584,7 +585,7 @@ var VizbeeMetricsManager = /** @class */ (function () {
584
585
  var _a, _b, _c, _d;
585
586
  var attributes = {};
586
587
  attributes[VizbeeMetricsConstants.METRICS_ATTR_SCREEN_HOMESSO_SDK_VERSION] =
587
- '1.0.1';
588
+ '1.0.4';
588
589
  attributes['REMOTE_FRIENDLY_NAME'] = (_a = this.senderInfo) === null || _a === void 0 ? void 0 : _a.friendlyName;
589
590
  attributes['REMOTE_DEVICE_ID'] = (_b = this.senderInfo) === null || _b === void 0 ? void 0 : _b.deviceId;
590
591
  attributes['REMOTE_DEVICE_TYPE'] = (_c = this.senderInfo) === null || _c === void 0 ? void 0 : _c.deviceType;
@@ -618,15 +619,24 @@ var VizbeeConstants = {
618
619
  // SDK events types
619
620
  VIZBEE_SESSION_READY: 'vizbee-bicast-session-ready',
620
621
  };
622
+ /**
623
+ * Numeric session states reported by the Continuity SDK's bicast session manager.
624
+ * Mirrors SessionState in the VTV SDK — defined here so HomeSSO has no magic numbers.
625
+ */
626
+ var VizbeeSessionState = {
627
+ NOT_CONNECTED: 1,
628
+ CONNECTING: 2,
629
+ CONNECTED: 3,
630
+ };
621
631
  // Enum for sign in states
622
- var VizbeeSignInState;
632
+ exports.VizbeeSignInState = void 0;
623
633
  (function (VizbeeSignInState) {
624
634
  VizbeeSignInState["SIGN_IN_NOT_STARTED"] = "not_started";
625
635
  VizbeeSignInState["SIGN_IN_IN_PROGRESS"] = "in_progress";
626
636
  VizbeeSignInState["SIGN_IN_COMPLETED"] = "completed";
627
637
  VizbeeSignInState["SIGN_IN_FAILED"] = "failed";
628
638
  VizbeeSignInState["SIGN_IN_CANCELLED"] = "cancelled";
629
- })(VizbeeSignInState || (VizbeeSignInState = {}));
639
+ })(exports.VizbeeSignInState || (exports.VizbeeSignInState = {}));
630
640
 
631
641
  // Base abstract class for sign in status
632
642
  var VizbeeSignInStatus = /** @class */ (function () {
@@ -655,7 +665,7 @@ var ProgressStatus = /** @class */ (function (_super) {
655
665
  return _this;
656
666
  }
657
667
  ProgressStatus.prototype.getState = function () {
658
- return VizbeeSignInState.SIGN_IN_IN_PROGRESS;
668
+ return exports.VizbeeSignInState.SIGN_IN_IN_PROGRESS;
659
669
  };
660
670
  return ProgressStatus;
661
671
  }(VizbeeSignInStatus));
@@ -672,7 +682,7 @@ var SuccessStatus = /** @class */ (function (_super) {
672
682
  return _this;
673
683
  }
674
684
  SuccessStatus.prototype.getState = function () {
675
- return VizbeeSignInState.SIGN_IN_COMPLETED;
685
+ return exports.VizbeeSignInState.SIGN_IN_COMPLETED;
676
686
  };
677
687
  return SuccessStatus;
678
688
  }(VizbeeSignInStatus));
@@ -693,8 +703,8 @@ var FailureStatus = /** @class */ (function (_super) {
693
703
  }
694
704
  FailureStatus.prototype.getState = function () {
695
705
  return this.isCancelled
696
- ? VizbeeSignInState.SIGN_IN_CANCELLED
697
- : VizbeeSignInState.SIGN_IN_FAILED;
706
+ ? exports.VizbeeSignInState.SIGN_IN_CANCELLED
707
+ : exports.VizbeeSignInState.SIGN_IN_FAILED;
698
708
  };
699
709
  return FailureStatus;
700
710
  }(VizbeeSignInStatus));
@@ -706,12 +716,12 @@ var FailureStatus = /** @class */ (function (_super) {
706
716
  /**
707
717
  * Enum defining the different types of sign-in modals available in the system
708
718
  */
709
- var SignInModalType;
719
+ exports.SignInModalType = void 0;
710
720
  (function (SignInModalType) {
711
721
  SignInModalType["INFORMATION"] = "information";
712
722
  SignInModalType["PROGRESS"] = "progress";
713
723
  SignInModalType["SUCCESS"] = "success";
714
- })(SignInModalType || (SignInModalType = {}));
724
+ })(exports.SignInModalType || (exports.SignInModalType = {}));
715
725
  /**
716
726
  * Default theme configuration with basic color scheme
717
727
  */
@@ -1294,7 +1304,11 @@ var VizbeeSnackbar = /** @class */ (function () {
1294
1304
  return VizbeeSnackbar;
1295
1305
  }());
1296
1306
 
1297
- /* eslint-disable @typescript-eslint/no-explicit-any */
1307
+ /**
1308
+ * @fileoverview Manages Single Sign-On (SSO) functionality for Vizbee home devices.
1309
+ * Handles communication between mobile and TV devices for authentication purposes.
1310
+ * @module VizbeeHomeSSOManager
1311
+ */
1298
1312
  var LOG_TAG = 'VizbeeHomeSSOManager';
1299
1313
  /**
1300
1314
  * Manages Single Sign-On (SSO) functionality between mobile and TV devices in the Vizbee ecosystem.
@@ -1328,6 +1342,7 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1328
1342
  this.isSignInInProgress = false;
1329
1343
  /** @internal Information about the sender device */
1330
1344
  this.senderInfo = null;
1345
+ this.signInHandler = null;
1331
1346
  /**
1332
1347
  * Modal display preferences for the SSO UI
1333
1348
  * @public
@@ -1481,12 +1496,11 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1481
1496
  var _a, _b;
1482
1497
  try {
1483
1498
  logger.info("[".concat(LOG_TAG, "][initializeVizbeeSession] - Initializing Vizbee session"));
1484
- // Check if vizbee and continuity exist before accessing xmessages
1485
- if (!((_b = (_a = window.vizbee) === null || _a === void 0 ? void 0 : _a.continuity) === null || _b === void 0 ? void 0 : _b.xmessages)) {
1499
+ var xmessages = (_b = (_a = window.vizbee) === null || _a === void 0 ? void 0 : _a.continuity) === null || _b === void 0 ? void 0 : _b.xmessages;
1500
+ if (!xmessages) {
1486
1501
  throw new Error('Vizbee continuity or xmessages not initialized');
1487
1502
  }
1488
- // Access VizbeeBicastSessionManager directly from the existing object
1489
- var sessionManager_1 = new window.vizbee.continuity.xmessages.VizbeeBicastSessionManager();
1503
+ var sessionManager_1 = new xmessages.VizbeeBicastSessionManager();
1490
1504
  if (!sessionManager_1) {
1491
1505
  throw new Error('Session manager initialization failed');
1492
1506
  }
@@ -1495,7 +1509,7 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1495
1509
  sessionManager_1.addSessionStateListener({
1496
1510
  onSessionStateChanged: function (state) {
1497
1511
  logger.info("[".concat(LOG_TAG, "][onSessionStateChanged] - Session state changed:"), state);
1498
- if (state === 3) {
1512
+ if (state === VizbeeSessionState.CONNECTED) {
1499
1513
  _this.vizbeeSession = sessionManager_1.getSession();
1500
1514
  _this.vizbeeMessagingClient =
1501
1515
  _this.vizbeeSession.getMessagingClient();
@@ -1615,9 +1629,9 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1615
1629
  attributes = _c.sent();
1616
1630
  signInInfoList = attributes === null || attributes === void 0 ? void 0 : attributes['SCREEN_HOMESSO_USER_INFO'];
1617
1631
  logger.info("[".concat(LOG_TAG, "][isUserAlreadySignedIn] - signInInfoList"), signInInfoList);
1618
- tvSignInInfo = signInInfoList.find(function (info) { return info.user_login_type === signInType; });
1632
+ tvSignInInfo = signInInfoList === null || signInInfoList === void 0 ? void 0 : signInInfoList.find(function (info) { return info.user_login_type === signInType; });
1619
1633
  logger.debug("[".concat(LOG_TAG, "][isUserAlreadySignedIn] - TV sign in status fetched:"), tvSignInInfo);
1620
- return [2 /*return*/, tvSignInInfo === null || tvSignInInfo === void 0 ? void 0 : tvSignInInfo.user_is_signed_in];
1634
+ return [2 /*return*/, (tvSignInInfo === null || tvSignInInfo === void 0 ? void 0 : tvSignInInfo.user_is_signed_in) === true];
1621
1635
  case 2:
1622
1636
  error_1 = _c.sent();
1623
1637
  logger.warn("[".concat(LOG_TAG, "][isUserAlreadySignedIn] - Error checking sign-in status:"), error_1);
@@ -1659,13 +1673,24 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1659
1673
  * @internal
1660
1674
  */
1661
1675
  VizbeeHomeSSOManager.prototype.sendStatusToSender = function (status) {
1662
- var _a;
1663
- var signInStatus = this.serializeStatus(status);
1664
- var data = (_a = {},
1665
- _a[VizbeeConstants.KEY_SUB_TYPE] = VizbeeConstants.EVENT_SUBTYPE_SIGN_IN_STATUS,
1666
- _a[VizbeeConstants.KEY_SIGN_IN_STATUS] = signInStatus,
1667
- _a);
1668
- this.vizbeeMessagingClient.send(data, VizbeeConstants.EVENT_SSO_NAME);
1676
+ return __awaiter(this, void 0, void 0, function () {
1677
+ var signInStatus, data;
1678
+ var _a;
1679
+ return __generator(this, function (_b) {
1680
+ switch (_b.label) {
1681
+ case 0:
1682
+ signInStatus = this.serializeStatus(status);
1683
+ data = (_a = {},
1684
+ _a[VizbeeConstants.KEY_SUB_TYPE] = VizbeeConstants.EVENT_SUBTYPE_SIGN_IN_STATUS,
1685
+ _a[VizbeeConstants.KEY_SIGN_IN_STATUS] = signInStatus,
1686
+ _a);
1687
+ return [4 /*yield*/, this.vizbeeMessagingClient.send(data, VizbeeConstants.EVENT_SSO_NAME)];
1688
+ case 1:
1689
+ _b.sent();
1690
+ return [2 /*return*/];
1691
+ }
1692
+ });
1693
+ });
1669
1694
  };
1670
1695
  /**
1671
1696
  * Serializes status objects for transmission to mobile device
@@ -1675,16 +1700,7 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1675
1700
  * @internal
1676
1701
  */
1677
1702
  VizbeeHomeSSOManager.prototype.serializeStatus = function (status) {
1678
- if (status instanceof ProgressStatus) {
1679
- return status.serialize();
1680
- }
1681
- else if (status instanceof SuccessStatus) {
1682
- return status.serialize();
1683
- }
1684
- else if (status instanceof FailureStatus) {
1685
- return status.serialize();
1686
- }
1687
- return null;
1703
+ return status.serialize();
1688
1704
  };
1689
1705
  /**
1690
1706
  * Updates UI for sign-in progress state
@@ -1795,6 +1811,8 @@ var init = function () {
1795
1811
  }
1796
1812
  };
1797
1813
  var setupHomeSSO = function () {
1814
+ if (!window.vizbee)
1815
+ return;
1798
1816
  window.vizbee.homesso = {
1799
1817
  HomeSSOContext: HomeSSOContext,
1800
1818
  messages: {
@@ -1806,7 +1824,7 @@ var setupHomeSSO = function () {
1806
1824
  // Replaced at build time with package.json's version by
1807
1825
  // @rollup/plugin-replace (same token the metrics manager uses), so
1808
1826
  // integrators can read the loaded SDK version off the namespace.
1809
- VERSION: '1.0.1',
1827
+ VERSION: '1.0.4',
1810
1828
  };
1811
1829
  window.dispatchEvent(new Event('VIZBEE_HOMESSO_READY'));
1812
1830
  };
package/es5/index.mjs CHANGED
@@ -489,19 +489,19 @@ var Logger = /** @class */ (function () {
489
489
  var logger = new Logger();
490
490
 
491
491
  var LOG_TAG$1 = 'VizbeeHomeSSOManager';
492
- /* eslint-disable @typescript-eslint/no-explicit-any */
493
492
  var VizbeeMetricsManager = /** @class */ (function () {
494
493
  function VizbeeMetricsManager() {
495
494
  var _this = this;
496
- var _a, _b, _c;
495
+ var _a, _b;
496
+ this.metricsManager = null;
497
497
  this.senderInfo = null;
498
498
  this.getSignInInfo = function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
499
499
  return [2 /*return*/, []];
500
500
  }); }); };
501
- if ((_c = (_b = (_a = window === null || window === void 0 ? void 0 : window.vizbee) === null || _a === void 0 ? void 0 : _a.continuity) === null || _b === void 0 ? void 0 : _b.analytics) === null || _c === void 0 ? void 0 : _c.AnalyticsProvider) {
501
+ var vizbee = window === null || window === void 0 ? void 0 : window.vizbee;
502
+ if ((_b = (_a = vizbee === null || vizbee === void 0 ? void 0 : vizbee.continuity) === null || _a === void 0 ? void 0 : _a.analytics) === null || _b === void 0 ? void 0 : _b.AnalyticsProvider) {
502
503
  this.metricsManager =
503
- new window.vizbee.continuity.analytics.AnalyticsProvider();
504
- // Create a wrapper with 'provider' property
504
+ new vizbee.continuity.analytics.AnalyticsProvider();
505
505
  var attributesProvider = {
506
506
  getAttributes: function () { return _this.getAttributes(); },
507
507
  };
@@ -530,7 +530,8 @@ var VizbeeMetricsManager = /** @class */ (function () {
530
530
  this.metricsManager.logMetrics(event, attributesToBeSent);
531
531
  };
532
532
  VizbeeMetricsManager.prototype.setCustomAttributes = function (customAttributes) {
533
- this.metricsManager.setCustomAttributes(customAttributes);
533
+ var _a;
534
+ (_a = this.metricsManager) === null || _a === void 0 ? void 0 : _a.setCustomAttributes(customAttributes);
534
535
  };
535
536
  VizbeeMetricsManager.prototype.getAttributes = function () {
536
537
  return this.createAttributesJson();
@@ -580,7 +581,7 @@ var VizbeeMetricsManager = /** @class */ (function () {
580
581
  var _a, _b, _c, _d;
581
582
  var attributes = {};
582
583
  attributes[VizbeeMetricsConstants.METRICS_ATTR_SCREEN_HOMESSO_SDK_VERSION] =
583
- '1.0.1';
584
+ '1.0.4';
584
585
  attributes['REMOTE_FRIENDLY_NAME'] = (_a = this.senderInfo) === null || _a === void 0 ? void 0 : _a.friendlyName;
585
586
  attributes['REMOTE_DEVICE_ID'] = (_b = this.senderInfo) === null || _b === void 0 ? void 0 : _b.deviceId;
586
587
  attributes['REMOTE_DEVICE_TYPE'] = (_c = this.senderInfo) === null || _c === void 0 ? void 0 : _c.deviceType;
@@ -614,6 +615,15 @@ var VizbeeConstants = {
614
615
  // SDK events types
615
616
  VIZBEE_SESSION_READY: 'vizbee-bicast-session-ready',
616
617
  };
618
+ /**
619
+ * Numeric session states reported by the Continuity SDK's bicast session manager.
620
+ * Mirrors SessionState in the VTV SDK — defined here so HomeSSO has no magic numbers.
621
+ */
622
+ var VizbeeSessionState = {
623
+ NOT_CONNECTED: 1,
624
+ CONNECTING: 2,
625
+ CONNECTED: 3,
626
+ };
617
627
  // Enum for sign in states
618
628
  var VizbeeSignInState;
619
629
  (function (VizbeeSignInState) {
@@ -1290,7 +1300,11 @@ var VizbeeSnackbar = /** @class */ (function () {
1290
1300
  return VizbeeSnackbar;
1291
1301
  }());
1292
1302
 
1293
- /* eslint-disable @typescript-eslint/no-explicit-any */
1303
+ /**
1304
+ * @fileoverview Manages Single Sign-On (SSO) functionality for Vizbee home devices.
1305
+ * Handles communication between mobile and TV devices for authentication purposes.
1306
+ * @module VizbeeHomeSSOManager
1307
+ */
1294
1308
  var LOG_TAG = 'VizbeeHomeSSOManager';
1295
1309
  /**
1296
1310
  * Manages Single Sign-On (SSO) functionality between mobile and TV devices in the Vizbee ecosystem.
@@ -1324,6 +1338,7 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1324
1338
  this.isSignInInProgress = false;
1325
1339
  /** @internal Information about the sender device */
1326
1340
  this.senderInfo = null;
1341
+ this.signInHandler = null;
1327
1342
  /**
1328
1343
  * Modal display preferences for the SSO UI
1329
1344
  * @public
@@ -1477,12 +1492,11 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1477
1492
  var _a, _b;
1478
1493
  try {
1479
1494
  logger.info("[".concat(LOG_TAG, "][initializeVizbeeSession] - Initializing Vizbee session"));
1480
- // Check if vizbee and continuity exist before accessing xmessages
1481
- if (!((_b = (_a = window.vizbee) === null || _a === void 0 ? void 0 : _a.continuity) === null || _b === void 0 ? void 0 : _b.xmessages)) {
1495
+ var xmessages = (_b = (_a = window.vizbee) === null || _a === void 0 ? void 0 : _a.continuity) === null || _b === void 0 ? void 0 : _b.xmessages;
1496
+ if (!xmessages) {
1482
1497
  throw new Error('Vizbee continuity or xmessages not initialized');
1483
1498
  }
1484
- // Access VizbeeBicastSessionManager directly from the existing object
1485
- var sessionManager_1 = new window.vizbee.continuity.xmessages.VizbeeBicastSessionManager();
1499
+ var sessionManager_1 = new xmessages.VizbeeBicastSessionManager();
1486
1500
  if (!sessionManager_1) {
1487
1501
  throw new Error('Session manager initialization failed');
1488
1502
  }
@@ -1491,7 +1505,7 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1491
1505
  sessionManager_1.addSessionStateListener({
1492
1506
  onSessionStateChanged: function (state) {
1493
1507
  logger.info("[".concat(LOG_TAG, "][onSessionStateChanged] - Session state changed:"), state);
1494
- if (state === 3) {
1508
+ if (state === VizbeeSessionState.CONNECTED) {
1495
1509
  _this.vizbeeSession = sessionManager_1.getSession();
1496
1510
  _this.vizbeeMessagingClient =
1497
1511
  _this.vizbeeSession.getMessagingClient();
@@ -1611,9 +1625,9 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1611
1625
  attributes = _c.sent();
1612
1626
  signInInfoList = attributes === null || attributes === void 0 ? void 0 : attributes['SCREEN_HOMESSO_USER_INFO'];
1613
1627
  logger.info("[".concat(LOG_TAG, "][isUserAlreadySignedIn] - signInInfoList"), signInInfoList);
1614
- tvSignInInfo = signInInfoList.find(function (info) { return info.user_login_type === signInType; });
1628
+ tvSignInInfo = signInInfoList === null || signInInfoList === void 0 ? void 0 : signInInfoList.find(function (info) { return info.user_login_type === signInType; });
1615
1629
  logger.debug("[".concat(LOG_TAG, "][isUserAlreadySignedIn] - TV sign in status fetched:"), tvSignInInfo);
1616
- return [2 /*return*/, tvSignInInfo === null || tvSignInInfo === void 0 ? void 0 : tvSignInInfo.user_is_signed_in];
1630
+ return [2 /*return*/, (tvSignInInfo === null || tvSignInInfo === void 0 ? void 0 : tvSignInInfo.user_is_signed_in) === true];
1617
1631
  case 2:
1618
1632
  error_1 = _c.sent();
1619
1633
  logger.warn("[".concat(LOG_TAG, "][isUserAlreadySignedIn] - Error checking sign-in status:"), error_1);
@@ -1655,13 +1669,24 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1655
1669
  * @internal
1656
1670
  */
1657
1671
  VizbeeHomeSSOManager.prototype.sendStatusToSender = function (status) {
1658
- var _a;
1659
- var signInStatus = this.serializeStatus(status);
1660
- var data = (_a = {},
1661
- _a[VizbeeConstants.KEY_SUB_TYPE] = VizbeeConstants.EVENT_SUBTYPE_SIGN_IN_STATUS,
1662
- _a[VizbeeConstants.KEY_SIGN_IN_STATUS] = signInStatus,
1663
- _a);
1664
- this.vizbeeMessagingClient.send(data, VizbeeConstants.EVENT_SSO_NAME);
1672
+ return __awaiter(this, void 0, void 0, function () {
1673
+ var signInStatus, data;
1674
+ var _a;
1675
+ return __generator(this, function (_b) {
1676
+ switch (_b.label) {
1677
+ case 0:
1678
+ signInStatus = this.serializeStatus(status);
1679
+ data = (_a = {},
1680
+ _a[VizbeeConstants.KEY_SUB_TYPE] = VizbeeConstants.EVENT_SUBTYPE_SIGN_IN_STATUS,
1681
+ _a[VizbeeConstants.KEY_SIGN_IN_STATUS] = signInStatus,
1682
+ _a);
1683
+ return [4 /*yield*/, this.vizbeeMessagingClient.send(data, VizbeeConstants.EVENT_SSO_NAME)];
1684
+ case 1:
1685
+ _b.sent();
1686
+ return [2 /*return*/];
1687
+ }
1688
+ });
1689
+ });
1665
1690
  };
1666
1691
  /**
1667
1692
  * Serializes status objects for transmission to mobile device
@@ -1671,16 +1696,7 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1671
1696
  * @internal
1672
1697
  */
1673
1698
  VizbeeHomeSSOManager.prototype.serializeStatus = function (status) {
1674
- if (status instanceof ProgressStatus) {
1675
- return status.serialize();
1676
- }
1677
- else if (status instanceof SuccessStatus) {
1678
- return status.serialize();
1679
- }
1680
- else if (status instanceof FailureStatus) {
1681
- return status.serialize();
1682
- }
1683
- return null;
1699
+ return status.serialize();
1684
1700
  };
1685
1701
  /**
1686
1702
  * Updates UI for sign-in progress state
@@ -1791,6 +1807,8 @@ var init = function () {
1791
1807
  }
1792
1808
  };
1793
1809
  var setupHomeSSO = function () {
1810
+ if (!window.vizbee)
1811
+ return;
1794
1812
  window.vizbee.homesso = {
1795
1813
  HomeSSOContext: HomeSSOContext,
1796
1814
  messages: {
@@ -1802,10 +1820,10 @@ var setupHomeSSO = function () {
1802
1820
  // Replaced at build time with package.json's version by
1803
1821
  // @rollup/plugin-replace (same token the metrics manager uses), so
1804
1822
  // integrators can read the loaded SDK version off the namespace.
1805
- VERSION: '1.0.1',
1823
+ VERSION: '1.0.4',
1806
1824
  };
1807
1825
  window.dispatchEvent(new Event('VIZBEE_HOMESSO_READY'));
1808
1826
  };
1809
1827
  init();
1810
1828
 
1811
- export { FailureStatus, HomeSSOContext, LogLevel, ProgressStatus, SuccessStatus, UNKNOWN_VALUE, VizbeeHomeSSOManager, VizbeeHomeSSOUIManager };
1829
+ export { FailureStatus, HomeSSOContext, LogLevel, ProgressStatus, SignInModalType, SuccessStatus, UNKNOWN_VALUE, VizbeeHomeSSOManager, VizbeeHomeSSOUIManager, VizbeeSignInState };
package/es6/index.cjs CHANGED
@@ -404,16 +404,16 @@ class Logger {
404
404
  const logger = new Logger();
405
405
 
406
406
  const LOG_TAG$1 = 'VizbeeHomeSSOManager';
407
- /* eslint-disable @typescript-eslint/no-explicit-any */
408
407
  class VizbeeMetricsManager {
409
408
  constructor() {
410
- var _a, _b, _c;
409
+ var _a, _b;
410
+ this.metricsManager = null;
411
411
  this.senderInfo = null;
412
412
  this.getSignInInfo = () => __awaiter(this, void 0, void 0, function* () { return []; });
413
- if ((_c = (_b = (_a = window === null || window === void 0 ? void 0 : window.vizbee) === null || _a === void 0 ? void 0 : _a.continuity) === null || _b === void 0 ? void 0 : _b.analytics) === null || _c === void 0 ? void 0 : _c.AnalyticsProvider) {
413
+ const vizbee = window === null || window === void 0 ? void 0 : window.vizbee;
414
+ if ((_b = (_a = vizbee === null || vizbee === void 0 ? void 0 : vizbee.continuity) === null || _a === void 0 ? void 0 : _a.analytics) === null || _b === void 0 ? void 0 : _b.AnalyticsProvider) {
414
415
  this.metricsManager =
415
- new window.vizbee.continuity.analytics.AnalyticsProvider();
416
- // Create a wrapper with 'provider' property
416
+ new vizbee.continuity.analytics.AnalyticsProvider();
417
417
  const attributesProvider = {
418
418
  getAttributes: () => this.getAttributes(),
419
419
  };
@@ -441,7 +441,8 @@ class VizbeeMetricsManager {
441
441
  this.metricsManager.logMetrics(event, attributesToBeSent);
442
442
  }
443
443
  setCustomAttributes(customAttributes) {
444
- this.metricsManager.setCustomAttributes(customAttributes);
444
+ var _a;
445
+ (_a = this.metricsManager) === null || _a === void 0 ? void 0 : _a.setCustomAttributes(customAttributes);
445
446
  }
446
447
  getAttributes() {
447
448
  return this.createAttributesJson();
@@ -481,7 +482,7 @@ class VizbeeMetricsManager {
481
482
  var _a, _b, _c, _d;
482
483
  const attributes = {};
483
484
  attributes[VizbeeMetricsConstants.METRICS_ATTR_SCREEN_HOMESSO_SDK_VERSION] =
484
- '1.0.1';
485
+ '1.0.4';
485
486
  attributes['REMOTE_FRIENDLY_NAME'] = (_a = this.senderInfo) === null || _a === void 0 ? void 0 : _a.friendlyName;
486
487
  attributes['REMOTE_DEVICE_ID'] = (_b = this.senderInfo) === null || _b === void 0 ? void 0 : _b.deviceId;
487
488
  attributes['REMOTE_DEVICE_TYPE'] = (_c = this.senderInfo) === null || _c === void 0 ? void 0 : _c.deviceType;
@@ -514,15 +515,24 @@ const VizbeeConstants = {
514
515
  // SDK events types
515
516
  VIZBEE_SESSION_READY: 'vizbee-bicast-session-ready',
516
517
  };
518
+ /**
519
+ * Numeric session states reported by the Continuity SDK's bicast session manager.
520
+ * Mirrors SessionState in the VTV SDK — defined here so HomeSSO has no magic numbers.
521
+ */
522
+ const VizbeeSessionState = {
523
+ NOT_CONNECTED: 1,
524
+ CONNECTING: 2,
525
+ CONNECTED: 3,
526
+ };
517
527
  // Enum for sign in states
518
- var VizbeeSignInState;
528
+ exports.VizbeeSignInState = void 0;
519
529
  (function (VizbeeSignInState) {
520
530
  VizbeeSignInState["SIGN_IN_NOT_STARTED"] = "not_started";
521
531
  VizbeeSignInState["SIGN_IN_IN_PROGRESS"] = "in_progress";
522
532
  VizbeeSignInState["SIGN_IN_COMPLETED"] = "completed";
523
533
  VizbeeSignInState["SIGN_IN_FAILED"] = "failed";
524
534
  VizbeeSignInState["SIGN_IN_CANCELLED"] = "cancelled";
525
- })(VizbeeSignInState || (VizbeeSignInState = {}));
535
+ })(exports.VizbeeSignInState || (exports.VizbeeSignInState = {}));
526
536
 
527
537
  /* eslint-disable @typescript-eslint/no-explicit-any */
528
538
  // Base abstract class for sign in status
@@ -547,7 +557,7 @@ class ProgressStatus extends VizbeeSignInStatus {
547
557
  this.customData = customData;
548
558
  }
549
559
  getState() {
550
- return VizbeeSignInState.SIGN_IN_IN_PROGRESS;
560
+ return exports.VizbeeSignInState.SIGN_IN_IN_PROGRESS;
551
561
  }
552
562
  }
553
563
  // Success status class
@@ -559,7 +569,7 @@ class SuccessStatus extends VizbeeSignInStatus {
559
569
  this.customData = customData;
560
570
  }
561
571
  getState() {
562
- return VizbeeSignInState.SIGN_IN_COMPLETED;
572
+ return exports.VizbeeSignInState.SIGN_IN_COMPLETED;
563
573
  }
564
574
  }
565
575
  // Failure status class
@@ -574,8 +584,8 @@ class FailureStatus extends VizbeeSignInStatus {
574
584
  }
575
585
  getState() {
576
586
  return this.isCancelled
577
- ? VizbeeSignInState.SIGN_IN_CANCELLED
578
- : VizbeeSignInState.SIGN_IN_FAILED;
587
+ ? exports.VizbeeSignInState.SIGN_IN_CANCELLED
588
+ : exports.VizbeeSignInState.SIGN_IN_FAILED;
579
589
  }
580
590
  }
581
591
 
@@ -586,12 +596,12 @@ class FailureStatus extends VizbeeSignInStatus {
586
596
  /**
587
597
  * Enum defining the different types of sign-in modals available in the system
588
598
  */
589
- var SignInModalType;
599
+ exports.SignInModalType = void 0;
590
600
  (function (SignInModalType) {
591
601
  SignInModalType["INFORMATION"] = "information";
592
602
  SignInModalType["PROGRESS"] = "progress";
593
603
  SignInModalType["SUCCESS"] = "success";
594
- })(SignInModalType || (SignInModalType = {}));
604
+ })(exports.SignInModalType || (exports.SignInModalType = {}));
595
605
  /**
596
606
  * Default theme configuration with basic color scheme
597
607
  */
@@ -1229,7 +1239,11 @@ class VizbeeSnackbar {
1229
1239
  }
1230
1240
  }
1231
1241
 
1232
- /* eslint-disable @typescript-eslint/no-explicit-any */
1242
+ /**
1243
+ * @fileoverview Manages Single Sign-On (SSO) functionality for Vizbee home devices.
1244
+ * Handles communication between mobile and TV devices for authentication purposes.
1245
+ * @module VizbeeHomeSSOManager
1246
+ */
1233
1247
  const LOG_TAG = 'VizbeeHomeSSOManager';
1234
1248
  /**
1235
1249
  * Manages Single Sign-On (SSO) functionality between mobile and TV devices in the Vizbee ecosystem.
@@ -1263,6 +1277,7 @@ class VizbeeHomeSSOManager {
1263
1277
  this.isSignInInProgress = false;
1264
1278
  /** @internal Information about the sender device */
1265
1279
  this.senderInfo = null;
1280
+ this.signInHandler = null;
1266
1281
  /**
1267
1282
  * Modal display preferences for the SSO UI
1268
1283
  * @public
@@ -1415,12 +1430,11 @@ class VizbeeHomeSSOManager {
1415
1430
  var _a, _b;
1416
1431
  try {
1417
1432
  logger.info(`[${LOG_TAG}][initializeVizbeeSession] - Initializing Vizbee session`);
1418
- // Check if vizbee and continuity exist before accessing xmessages
1419
- if (!((_b = (_a = window.vizbee) === null || _a === void 0 ? void 0 : _a.continuity) === null || _b === void 0 ? void 0 : _b.xmessages)) {
1433
+ const xmessages = (_b = (_a = window.vizbee) === null || _a === void 0 ? void 0 : _a.continuity) === null || _b === void 0 ? void 0 : _b.xmessages;
1434
+ if (!xmessages) {
1420
1435
  throw new Error('Vizbee continuity or xmessages not initialized');
1421
1436
  }
1422
- // Access VizbeeBicastSessionManager directly from the existing object
1423
- const sessionManager = new window.vizbee.continuity.xmessages.VizbeeBicastSessionManager();
1437
+ const sessionManager = new xmessages.VizbeeBicastSessionManager();
1424
1438
  if (!sessionManager) {
1425
1439
  throw new Error('Session manager initialization failed');
1426
1440
  }
@@ -1429,7 +1443,7 @@ class VizbeeHomeSSOManager {
1429
1443
  sessionManager.addSessionStateListener({
1430
1444
  onSessionStateChanged: (state) => {
1431
1445
  logger.info(`[${LOG_TAG}][onSessionStateChanged] - Session state changed:`, state);
1432
- if (state === 3) {
1446
+ if (state === VizbeeSessionState.CONNECTED) {
1433
1447
  this.vizbeeSession = sessionManager.getSession();
1434
1448
  this.vizbeeMessagingClient =
1435
1449
  this.vizbeeSession.getMessagingClient();
@@ -1521,9 +1535,9 @@ class VizbeeHomeSSOManager {
1521
1535
  const attributes = yield ((_b = (_a = this.vizbeeMetricsManager) === null || _a === void 0 ? void 0 : _a.getAttributes) === null || _b === void 0 ? void 0 : _b.call(_a));
1522
1536
  const signInInfoList = attributes === null || attributes === void 0 ? void 0 : attributes['SCREEN_HOMESSO_USER_INFO'];
1523
1537
  logger.info(`[${LOG_TAG}][isUserAlreadySignedIn] - signInInfoList`, signInInfoList);
1524
- const tvSignInInfo = signInInfoList.find((info) => info.user_login_type === signInType);
1538
+ const tvSignInInfo = signInInfoList === null || signInInfoList === void 0 ? void 0 : signInInfoList.find((info) => info.user_login_type === signInType);
1525
1539
  logger.debug(`[${LOG_TAG}][isUserAlreadySignedIn] - TV sign in status fetched:`, tvSignInInfo);
1526
- return tvSignInInfo === null || tvSignInInfo === void 0 ? void 0 : tvSignInInfo.user_is_signed_in;
1540
+ return (tvSignInInfo === null || tvSignInInfo === void 0 ? void 0 : tvSignInInfo.user_is_signed_in) === true;
1527
1541
  }
1528
1542
  catch (error) {
1529
1543
  logger.warn(`[${LOG_TAG}][isUserAlreadySignedIn] - Error checking sign-in status:`, error);
@@ -1563,12 +1577,14 @@ class VizbeeHomeSSOManager {
1563
1577
  * @internal
1564
1578
  */
1565
1579
  sendStatusToSender(status) {
1566
- const signInStatus = this.serializeStatus(status);
1567
- const data = {
1568
- [VizbeeConstants.KEY_SUB_TYPE]: VizbeeConstants.EVENT_SUBTYPE_SIGN_IN_STATUS,
1569
- [VizbeeConstants.KEY_SIGN_IN_STATUS]: signInStatus,
1570
- };
1571
- this.vizbeeMessagingClient.send(data, VizbeeConstants.EVENT_SSO_NAME);
1580
+ return __awaiter(this, void 0, void 0, function* () {
1581
+ const signInStatus = this.serializeStatus(status);
1582
+ const data = {
1583
+ [VizbeeConstants.KEY_SUB_TYPE]: VizbeeConstants.EVENT_SUBTYPE_SIGN_IN_STATUS,
1584
+ [VizbeeConstants.KEY_SIGN_IN_STATUS]: signInStatus,
1585
+ };
1586
+ yield this.vizbeeMessagingClient.send(data, VizbeeConstants.EVENT_SSO_NAME);
1587
+ });
1572
1588
  }
1573
1589
  /**
1574
1590
  * Serializes status objects for transmission to mobile device
@@ -1578,16 +1594,7 @@ class VizbeeHomeSSOManager {
1578
1594
  * @internal
1579
1595
  */
1580
1596
  serializeStatus(status) {
1581
- if (status instanceof ProgressStatus) {
1582
- return status.serialize();
1583
- }
1584
- else if (status instanceof SuccessStatus) {
1585
- return status.serialize();
1586
- }
1587
- else if (status instanceof FailureStatus) {
1588
- return status.serialize();
1589
- }
1590
- return null;
1597
+ return status.serialize();
1591
1598
  }
1592
1599
  /**
1593
1600
  * Updates UI for sign-in progress state
@@ -1696,6 +1703,8 @@ const init = () => {
1696
1703
  }
1697
1704
  };
1698
1705
  const setupHomeSSO = () => {
1706
+ if (!window.vizbee)
1707
+ return;
1699
1708
  window.vizbee.homesso = {
1700
1709
  HomeSSOContext: HomeSSOContext,
1701
1710
  messages: {
@@ -1707,7 +1716,7 @@ const setupHomeSSO = () => {
1707
1716
  // Replaced at build time with package.json's version by
1708
1717
  // @rollup/plugin-replace (same token the metrics manager uses), so
1709
1718
  // integrators can read the loaded SDK version off the namespace.
1710
- VERSION: '1.0.1',
1719
+ VERSION: '1.0.4',
1711
1720
  };
1712
1721
  window.dispatchEvent(new Event('VIZBEE_HOMESSO_READY'));
1713
1722
  };
package/es6/index.mjs CHANGED
@@ -400,16 +400,16 @@ class Logger {
400
400
  const logger = new Logger();
401
401
 
402
402
  const LOG_TAG$1 = 'VizbeeHomeSSOManager';
403
- /* eslint-disable @typescript-eslint/no-explicit-any */
404
403
  class VizbeeMetricsManager {
405
404
  constructor() {
406
- var _a, _b, _c;
405
+ var _a, _b;
406
+ this.metricsManager = null;
407
407
  this.senderInfo = null;
408
408
  this.getSignInInfo = () => __awaiter(this, void 0, void 0, function* () { return []; });
409
- if ((_c = (_b = (_a = window === null || window === void 0 ? void 0 : window.vizbee) === null || _a === void 0 ? void 0 : _a.continuity) === null || _b === void 0 ? void 0 : _b.analytics) === null || _c === void 0 ? void 0 : _c.AnalyticsProvider) {
409
+ const vizbee = window === null || window === void 0 ? void 0 : window.vizbee;
410
+ if ((_b = (_a = vizbee === null || vizbee === void 0 ? void 0 : vizbee.continuity) === null || _a === void 0 ? void 0 : _a.analytics) === null || _b === void 0 ? void 0 : _b.AnalyticsProvider) {
410
411
  this.metricsManager =
411
- new window.vizbee.continuity.analytics.AnalyticsProvider();
412
- // Create a wrapper with 'provider' property
412
+ new vizbee.continuity.analytics.AnalyticsProvider();
413
413
  const attributesProvider = {
414
414
  getAttributes: () => this.getAttributes(),
415
415
  };
@@ -437,7 +437,8 @@ class VizbeeMetricsManager {
437
437
  this.metricsManager.logMetrics(event, attributesToBeSent);
438
438
  }
439
439
  setCustomAttributes(customAttributes) {
440
- this.metricsManager.setCustomAttributes(customAttributes);
440
+ var _a;
441
+ (_a = this.metricsManager) === null || _a === void 0 ? void 0 : _a.setCustomAttributes(customAttributes);
441
442
  }
442
443
  getAttributes() {
443
444
  return this.createAttributesJson();
@@ -477,7 +478,7 @@ class VizbeeMetricsManager {
477
478
  var _a, _b, _c, _d;
478
479
  const attributes = {};
479
480
  attributes[VizbeeMetricsConstants.METRICS_ATTR_SCREEN_HOMESSO_SDK_VERSION] =
480
- '1.0.1';
481
+ '1.0.4';
481
482
  attributes['REMOTE_FRIENDLY_NAME'] = (_a = this.senderInfo) === null || _a === void 0 ? void 0 : _a.friendlyName;
482
483
  attributes['REMOTE_DEVICE_ID'] = (_b = this.senderInfo) === null || _b === void 0 ? void 0 : _b.deviceId;
483
484
  attributes['REMOTE_DEVICE_TYPE'] = (_c = this.senderInfo) === null || _c === void 0 ? void 0 : _c.deviceType;
@@ -510,6 +511,15 @@ const VizbeeConstants = {
510
511
  // SDK events types
511
512
  VIZBEE_SESSION_READY: 'vizbee-bicast-session-ready',
512
513
  };
514
+ /**
515
+ * Numeric session states reported by the Continuity SDK's bicast session manager.
516
+ * Mirrors SessionState in the VTV SDK — defined here so HomeSSO has no magic numbers.
517
+ */
518
+ const VizbeeSessionState = {
519
+ NOT_CONNECTED: 1,
520
+ CONNECTING: 2,
521
+ CONNECTED: 3,
522
+ };
513
523
  // Enum for sign in states
514
524
  var VizbeeSignInState;
515
525
  (function (VizbeeSignInState) {
@@ -1225,7 +1235,11 @@ class VizbeeSnackbar {
1225
1235
  }
1226
1236
  }
1227
1237
 
1228
- /* eslint-disable @typescript-eslint/no-explicit-any */
1238
+ /**
1239
+ * @fileoverview Manages Single Sign-On (SSO) functionality for Vizbee home devices.
1240
+ * Handles communication between mobile and TV devices for authentication purposes.
1241
+ * @module VizbeeHomeSSOManager
1242
+ */
1229
1243
  const LOG_TAG = 'VizbeeHomeSSOManager';
1230
1244
  /**
1231
1245
  * Manages Single Sign-On (SSO) functionality between mobile and TV devices in the Vizbee ecosystem.
@@ -1259,6 +1273,7 @@ class VizbeeHomeSSOManager {
1259
1273
  this.isSignInInProgress = false;
1260
1274
  /** @internal Information about the sender device */
1261
1275
  this.senderInfo = null;
1276
+ this.signInHandler = null;
1262
1277
  /**
1263
1278
  * Modal display preferences for the SSO UI
1264
1279
  * @public
@@ -1411,12 +1426,11 @@ class VizbeeHomeSSOManager {
1411
1426
  var _a, _b;
1412
1427
  try {
1413
1428
  logger.info(`[${LOG_TAG}][initializeVizbeeSession] - Initializing Vizbee session`);
1414
- // Check if vizbee and continuity exist before accessing xmessages
1415
- if (!((_b = (_a = window.vizbee) === null || _a === void 0 ? void 0 : _a.continuity) === null || _b === void 0 ? void 0 : _b.xmessages)) {
1429
+ const xmessages = (_b = (_a = window.vizbee) === null || _a === void 0 ? void 0 : _a.continuity) === null || _b === void 0 ? void 0 : _b.xmessages;
1430
+ if (!xmessages) {
1416
1431
  throw new Error('Vizbee continuity or xmessages not initialized');
1417
1432
  }
1418
- // Access VizbeeBicastSessionManager directly from the existing object
1419
- const sessionManager = new window.vizbee.continuity.xmessages.VizbeeBicastSessionManager();
1433
+ const sessionManager = new xmessages.VizbeeBicastSessionManager();
1420
1434
  if (!sessionManager) {
1421
1435
  throw new Error('Session manager initialization failed');
1422
1436
  }
@@ -1425,7 +1439,7 @@ class VizbeeHomeSSOManager {
1425
1439
  sessionManager.addSessionStateListener({
1426
1440
  onSessionStateChanged: (state) => {
1427
1441
  logger.info(`[${LOG_TAG}][onSessionStateChanged] - Session state changed:`, state);
1428
- if (state === 3) {
1442
+ if (state === VizbeeSessionState.CONNECTED) {
1429
1443
  this.vizbeeSession = sessionManager.getSession();
1430
1444
  this.vizbeeMessagingClient =
1431
1445
  this.vizbeeSession.getMessagingClient();
@@ -1517,9 +1531,9 @@ class VizbeeHomeSSOManager {
1517
1531
  const attributes = yield ((_b = (_a = this.vizbeeMetricsManager) === null || _a === void 0 ? void 0 : _a.getAttributes) === null || _b === void 0 ? void 0 : _b.call(_a));
1518
1532
  const signInInfoList = attributes === null || attributes === void 0 ? void 0 : attributes['SCREEN_HOMESSO_USER_INFO'];
1519
1533
  logger.info(`[${LOG_TAG}][isUserAlreadySignedIn] - signInInfoList`, signInInfoList);
1520
- const tvSignInInfo = signInInfoList.find((info) => info.user_login_type === signInType);
1534
+ const tvSignInInfo = signInInfoList === null || signInInfoList === void 0 ? void 0 : signInInfoList.find((info) => info.user_login_type === signInType);
1521
1535
  logger.debug(`[${LOG_TAG}][isUserAlreadySignedIn] - TV sign in status fetched:`, tvSignInInfo);
1522
- return tvSignInInfo === null || tvSignInInfo === void 0 ? void 0 : tvSignInInfo.user_is_signed_in;
1536
+ return (tvSignInInfo === null || tvSignInInfo === void 0 ? void 0 : tvSignInInfo.user_is_signed_in) === true;
1523
1537
  }
1524
1538
  catch (error) {
1525
1539
  logger.warn(`[${LOG_TAG}][isUserAlreadySignedIn] - Error checking sign-in status:`, error);
@@ -1559,12 +1573,14 @@ class VizbeeHomeSSOManager {
1559
1573
  * @internal
1560
1574
  */
1561
1575
  sendStatusToSender(status) {
1562
- const signInStatus = this.serializeStatus(status);
1563
- const data = {
1564
- [VizbeeConstants.KEY_SUB_TYPE]: VizbeeConstants.EVENT_SUBTYPE_SIGN_IN_STATUS,
1565
- [VizbeeConstants.KEY_SIGN_IN_STATUS]: signInStatus,
1566
- };
1567
- this.vizbeeMessagingClient.send(data, VizbeeConstants.EVENT_SSO_NAME);
1576
+ return __awaiter(this, void 0, void 0, function* () {
1577
+ const signInStatus = this.serializeStatus(status);
1578
+ const data = {
1579
+ [VizbeeConstants.KEY_SUB_TYPE]: VizbeeConstants.EVENT_SUBTYPE_SIGN_IN_STATUS,
1580
+ [VizbeeConstants.KEY_SIGN_IN_STATUS]: signInStatus,
1581
+ };
1582
+ yield this.vizbeeMessagingClient.send(data, VizbeeConstants.EVENT_SSO_NAME);
1583
+ });
1568
1584
  }
1569
1585
  /**
1570
1586
  * Serializes status objects for transmission to mobile device
@@ -1574,16 +1590,7 @@ class VizbeeHomeSSOManager {
1574
1590
  * @internal
1575
1591
  */
1576
1592
  serializeStatus(status) {
1577
- if (status instanceof ProgressStatus) {
1578
- return status.serialize();
1579
- }
1580
- else if (status instanceof SuccessStatus) {
1581
- return status.serialize();
1582
- }
1583
- else if (status instanceof FailureStatus) {
1584
- return status.serialize();
1585
- }
1586
- return null;
1593
+ return status.serialize();
1587
1594
  }
1588
1595
  /**
1589
1596
  * Updates UI for sign-in progress state
@@ -1692,6 +1699,8 @@ const init = () => {
1692
1699
  }
1693
1700
  };
1694
1701
  const setupHomeSSO = () => {
1702
+ if (!window.vizbee)
1703
+ return;
1695
1704
  window.vizbee.homesso = {
1696
1705
  HomeSSOContext: HomeSSOContext,
1697
1706
  messages: {
@@ -1703,10 +1712,10 @@ const setupHomeSSO = () => {
1703
1712
  // Replaced at build time with package.json's version by
1704
1713
  // @rollup/plugin-replace (same token the metrics manager uses), so
1705
1714
  // integrators can read the loaded SDK version off the namespace.
1706
- VERSION: '1.0.1',
1715
+ VERSION: '1.0.4',
1707
1716
  };
1708
1717
  window.dispatchEvent(new Event('VIZBEE_HOMESSO_READY'));
1709
1718
  };
1710
1719
  init();
1711
1720
 
1712
- export { FailureStatus, HomeSSOContext, LogLevel, ProgressStatus, SuccessStatus, UNKNOWN_VALUE, VizbeeHomeSSOManager, VizbeeHomeSSOUIManager };
1721
+ export { FailureStatus, HomeSSOContext, LogLevel, ProgressStatus, SignInModalType, SuccessStatus, UNKNOWN_VALUE, VizbeeHomeSSOManager, VizbeeHomeSSOUIManager, VizbeeSignInState };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vizbeetv/homesso-sdk-qa",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "TV app authentication library (QA)",
5
5
  "main": "./es5/index.cjs",
6
6
  "module": "./es5/index.mjs",
@@ -1,6 +1,11 @@
1
+ /**
2
+ * @fileoverview Manages Single Sign-On (SSO) functionality for Vizbee home devices.
3
+ * Handles communication between mobile and TV devices for authentication purposes.
4
+ * @module VizbeeHomeSSOManager
5
+ */
1
6
  import { VizbeeSignInInfo } from './model/VizbeeSignInInfo';
2
7
  import { FailureStatus, ProgressStatus, SuccessStatus } from './model/VizbeeSignInStatus';
3
- import { MessagePayload, VizbeeModalPreferences, VizbeeSignInStatusCallback } from './types';
8
+ import { IVizbeeSignInInfo, StatusCallback, VizbeeModalPreferences, VizbeeSignInStatusCallback } from './types';
4
9
  /**
5
10
  * Manages Single Sign-On (SSO) functionality between mobile and TV devices in the Vizbee ecosystem.
6
11
  * Implements singleton pattern for global state management.
@@ -68,7 +73,7 @@ export declare class VizbeeHomeSSOManager implements VizbeeSignInStatusCallback
68
73
  * @param handler - Callback function to process sign-in information and provide status updates
69
74
  * @public
70
75
  */
71
- setSignInHandler(handler: (signInInfo: MessagePayload, statusCallback: (signInStatus: ProgressStatus | SuccessStatus | FailureStatus) => void) => void): void;
76
+ setSignInHandler(handler: (signInInfo: IVizbeeSignInInfo, statusCallback: StatusCallback) => void): void;
72
77
  /**
73
78
  * Sets the callback for retrieving sign-in information
74
79
  *
package/types/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { VizbeeHomeSSOManager } from './VizbeeHomeSSOManager';
2
2
  import { ProgressStatus, SuccessStatus, FailureStatus } from './model/VizbeeSignInStatus';
3
- import { IVizbeeAnalyticsProvider, IVizbeeXMessages } from './types';
4
3
  import { VizbeeHomeSSOUIManager } from './ui/VizbeeHomeSSOUIManager';
5
4
  import { LogLevel } from './utils/Logger';
6
5
  /**
@@ -30,34 +29,59 @@ declare class HomeSSOContext {
30
29
  enableLogger(enable: boolean): void;
31
30
  setLoggerLevel(level: LogLevel): void;
32
31
  }
32
+ /**
33
+ * Augmentable global interface for window.vizbee.
34
+ *
35
+ * Each Vizbee SDK package re-opens this interface to add only its own slice.
36
+ * TypeScript merges all augmentations so the full window.vizbee shape is
37
+ * available to consumers without any one package overriding another's types.
38
+ *
39
+ * - HomeSSO SDK adds: `homesso`
40
+ * - Continuity SDK adds: `continuity` (augment this interface in your project)
41
+ *
42
+ * Consumer bridging example (add to your project's global.d.ts):
43
+ * @example
44
+ * ```ts
45
+ * import type { ContinuityFramework } from '@vizbee/sdk/lg'; // or xbox, etc.
46
+ * declare global {
47
+ * interface VizbeeNamespace {
48
+ * continuity: ContinuityFramework;
49
+ * }
50
+ * }
51
+ * ```
52
+ */
33
53
  declare global {
54
+ interface VizbeeNamespace {
55
+ homesso: HomeSSONamespace;
56
+ }
34
57
  interface Window {
35
- vizbee: {
36
- continuity?: {
37
- xmessages: IVizbeeXMessages;
38
- analytics: {
39
- AnalyticsProvider: new () => IVizbeeAnalyticsProvider;
40
- };
41
- };
42
- homesso: {
43
- HomeSSOContext: typeof HomeSSOContext;
44
- messages: {
45
- ProgressStatus: typeof ProgressStatus;
46
- SuccessStatus: typeof SuccessStatus;
47
- FailureStatus: typeof FailureStatus;
48
- };
49
- LoggerLevel: typeof LogLevel;
50
- VERSION: string;
51
- };
52
- };
58
+ vizbee?: VizbeeNamespace;
53
59
  }
54
60
  }
61
+ /**
62
+ * The shape HomeSSO SDK adds to window.vizbee.homesso.
63
+ * Export this so consumers can reference it when augmenting VizbeeSDK or
64
+ * VizbeeNamespace in their own global declarations.
65
+ */
66
+ export type HomeSSONamespace = {
67
+ HomeSSOContext: typeof HomeSSOContext;
68
+ messages: {
69
+ ProgressStatus: typeof ProgressStatus;
70
+ SuccessStatus: typeof SuccessStatus;
71
+ FailureStatus: typeof FailureStatus;
72
+ };
73
+ LoggerLevel: typeof LogLevel;
74
+ VERSION: string;
75
+ };
55
76
  export { HomeSSOContext };
56
77
  export { ProgressStatus, SuccessStatus, FailureStatus } from './model/VizbeeSignInStatus';
57
78
  export { LogLevel } from './utils/Logger';
79
+ export { VizbeeSignInState } from './utils/constants';
58
80
  export { VizbeeHomeSSOManager } from './VizbeeHomeSSOManager';
59
81
  export { VizbeeHomeSSOUIManager } from './ui/VizbeeHomeSSOUIManager';
82
+ export { SignInModalType } from './ui/VizbeeHomeSSOUIConfig';
60
83
  export { UNKNOWN_VALUE } from './model/VizbeeSignInInfo';
61
- export type { VizbeeSignInInfo } from './model/VizbeeSignInInfo';
62
- export type { VizbeeSignInStatusCallback, IVizbeeAnalyticsProvider, IVizbeeXMessages, IVizbeeMessagingClient, IVizbeeSession, IVizbeeBicastSessionManager, ISessionStateListener, MessagePayload, VizbeeSenderDevice, } from './types';
63
- export type { VizbeeHomeSSOTheme, CommonModalPreferenceOptions, InformationalSignInPreferenceOptions, ProgressSignInPreferenceOptions, SuccessSignInPreferenceOptions, } from './ui/VizbeeHomeSSOUIConfig';
84
+ export type { VizbeeSignInInfo, ISignInInfo } from './model/VizbeeSignInInfo';
85
+ export type { VizbeeSignInStatusCallback, IVizbeeSignInInfo, StatusCallback, IVizbeeAnalyticsProvider, IVizbeeXMessages, IVizbeeMessagingClient, IVizbeeSession, IVizbeeBicastSessionManager, ISessionStateListener, MessagePayload, VizbeeSenderDevice, } from './types';
86
+ export type { SnackbarPosition, ModalDirection } from './ui/VizbeeSnackBar';
87
+ export type { VizbeeHomeSSOTheme, CommonModalPreferenceOptions, InformationalSignInPreferenceOptions, ProgressSignInPreferenceOptions, SuccessSignInPreferenceOptions, VizbeeHomeSSOUIConfig, VizbeeHomeSSODefaultConfig, InformationalSignInPreferenceConfig, ProgressSignInPreferenceConfig, SuccessSignInPreferenceConfig, } from './ui/VizbeeHomeSSOUIConfig';
@@ -6,9 +6,9 @@ export declare class VizbeeMetricsManager implements IVizbeeAttributesProvider {
6
6
  senderInfo: SenderInfo | null;
7
7
  getSignInInfo: () => Promise<VizbeeSignInInfo[]>;
8
8
  constructor();
9
- log(event: string, attributes: Record<string, any>, bypassAttributeProviders?: boolean): void;
10
- setCustomAttributes(customAttributes: Record<string, any>): void;
11
- getAttributes(): Promise<Record<string, any>>;
9
+ log(event: string, attributes: Record<string, unknown>, bypassAttributeProviders?: boolean): void;
10
+ setCustomAttributes(customAttributes: Record<string, unknown>): void;
11
+ getAttributes(): Promise<Record<string, unknown>>;
12
12
  private createAttributesJson;
13
13
  private createUserInfoObject;
14
14
  private addDefaultAttributes;
@@ -15,6 +15,6 @@ export interface SenderInfo {
15
15
  export interface VizbeeSenderSignInInfo {
16
16
  isSignedIn: boolean;
17
17
  signInType: string;
18
- customData: Record<string, any>;
18
+ customData: Record<string, unknown>;
19
19
  senderInfo: SenderInfo | null;
20
20
  }
@@ -1,11 +1,18 @@
1
1
  export declare const UNKNOWN_VALUE = "UNKNOWN";
2
+ /**
3
+ * Sign-in state of the TV app user, returned by the getter registered via
4
+ * VizbeeHomeSSOManager.setSignInInfoGetter(). The SDK uses this to decide
5
+ * whether to skip or proceed with a sign-in request from a mobile sender.
6
+ */
2
7
  export interface VizbeeSignInInfo {
3
8
  userLoginType: string;
4
9
  isSignedIn: boolean;
5
- userLogin: string;
10
+ userLogin?: string;
6
11
  userName?: string;
7
12
  userSubscriptionType?: string;
8
13
  userSubscriptionValue?: string;
9
14
  userSubscriptionRenewalType?: string;
10
- userAdditionalInfo?: Record<string, any>;
15
+ userAdditionalInfo?: Record<string, unknown>;
11
16
  }
17
+ /** Canonical interface alias — prefer this name in new integrations. */
18
+ export type ISignInInfo = VizbeeSignInInfo;
@@ -1,22 +1,22 @@
1
1
  import { VizbeeSignInState } from '../utils/constants';
2
2
  declare abstract class VizbeeSignInStatus {
3
3
  readonly signInType: string;
4
- readonly customData: Record<string, any> | null;
5
- protected constructor(signInType: string, customData: Record<string, any> | null);
4
+ readonly customData: Record<string, unknown> | null;
5
+ protected constructor(signInType: string, customData: Record<string, unknown> | null);
6
6
  abstract getState(): VizbeeSignInState;
7
- serialize(): Record<string, any>;
7
+ serialize(): Record<string, unknown>;
8
8
  }
9
9
  export declare class ProgressStatus extends VizbeeSignInStatus {
10
10
  readonly signInType: string;
11
- readonly customData: Record<string, any> | null;
12
- constructor(signInType: string, customData?: Record<string, any> | null);
11
+ readonly customData: Record<string, unknown> | null;
12
+ constructor(signInType: string, customData?: Record<string, unknown> | null);
13
13
  getState(): VizbeeSignInState;
14
14
  }
15
15
  export declare class SuccessStatus extends VizbeeSignInStatus {
16
16
  readonly signInType: string;
17
17
  readonly userId: string | null;
18
- readonly customData: Record<string, any> | null;
19
- constructor(signInType: string, userId?: string | null, customData?: Record<string, any> | null);
18
+ readonly customData: Record<string, unknown> | null;
19
+ constructor(signInType: string, userId?: string | null, customData?: Record<string, unknown> | null);
20
20
  getState(): VizbeeSignInState;
21
21
  }
22
22
  export declare class FailureStatus extends VizbeeSignInStatus {
@@ -24,8 +24,8 @@ export declare class FailureStatus extends VizbeeSignInStatus {
24
24
  readonly isCancelled: boolean;
25
25
  readonly reason: string | null;
26
26
  readonly exception: Error | null;
27
- readonly customData: Record<string, any> | null;
28
- constructor(signInType: string, isCancelled: boolean, reason?: string | null, exception?: Error | null, customData?: Record<string, any> | null);
27
+ readonly customData: Record<string, unknown> | null;
28
+ constructor(signInType: string, isCancelled: boolean, reason?: string | null, exception?: Error | null, customData?: Record<string, unknown> | null);
29
29
  getState(): VizbeeSignInState;
30
30
  }
31
31
  export {};
package/types/types.d.ts CHANGED
@@ -20,7 +20,7 @@ export interface VizbeeSenderDevice {
20
20
  */
21
21
  export interface IVizbeeMessagingClient {
22
22
  addReceiver(namespace: string, callback: (payload: MessagePayload, namespace: string, device: VizbeeSenderDevice) => void): void;
23
- send(payload: Record<string, any>, namespace: string, callback?: (error?: Error) => void): void;
23
+ send(payload: Record<string, unknown>, namespace: string): Promise<void>;
24
24
  }
25
25
  /**
26
26
  * Manages a communication session and provides access to messaging capabilities
@@ -49,6 +49,23 @@ export interface IVizbeeXMessages {
49
49
  new (): IVizbeeBicastSessionManager;
50
50
  };
51
51
  }
52
+ /**
53
+ * The sign-in info object passed to the handler registered via
54
+ * VizbeeHomeSSOManager.setSignInHandler(). Contains the sign-in context
55
+ * received from the mobile sender device.
56
+ */
57
+ export interface IVizbeeSignInInfo {
58
+ isSignedIn: boolean;
59
+ signInType: string;
60
+ deviceId?: string;
61
+ deviceType?: string;
62
+ customData?: Record<string, unknown>;
63
+ }
64
+ /**
65
+ * Callback used inside the sign-in handler to report progress, success, or
66
+ * failure back to the HomeSSO SDK (and on to the mobile sender).
67
+ */
68
+ export type StatusCallback = (status: ProgressStatus | SuccessStatus | FailureStatus) => void;
52
69
  /**
53
70
  * Interface for sign-in status callbacks
54
71
  */
@@ -69,9 +86,9 @@ export interface ISignInModalManager {
69
86
  updateSignInStatus(state: VizbeeSignInState, preferences: VizbeeModalPreferences, isRemoteSignedIn: boolean): void;
70
87
  }
71
88
  export interface IVizbeeAnalyticsProvider {
72
- logMetrics(eventName: string, properties: Record<string, any>): void;
73
- setCustomAttributes(customAttributes: Record<string, any>): void;
89
+ logMetrics(eventName: string, properties: Record<string, unknown>): void;
90
+ setCustomAttributes(customAttributes: Record<string, unknown>): void;
74
91
  }
75
92
  export interface IVizbeeAttributesProvider {
76
- getAttributes(): Promise<Record<string, any>>;
93
+ getAttributes(): Promise<Record<string, unknown>>;
77
94
  }
@@ -125,6 +125,15 @@ export interface SuccessSignInPreferenceConfig {
125
125
  enable: boolean;
126
126
  options: SuccessSignInPreferenceOptions;
127
127
  }
128
+ /**
129
+ * Return type of VizbeeHomeSSOUIManager.getDefaultConfig().
130
+ * Contains the resolved (theme-applied) default options for each modal state.
131
+ */
132
+ export interface VizbeeHomeSSODefaultConfig {
133
+ informational: InformationalSignInPreferenceOptions;
134
+ progress: ProgressSignInPreferenceOptions;
135
+ success: SuccessSignInPreferenceOptions;
136
+ }
128
137
  /**
129
138
  * Main configuration interface combining all UI components
130
139
  */
@@ -2,7 +2,7 @@
2
2
  * @fileoverview Manages UI configuration for Vizbee Home SSO implementation
3
3
  * Handles theme customization and modal preferences for different sign-in states
4
4
  */
5
- import { CommonModalPreferenceOptions, InformationalSignInPreferenceOptions, ProgressSignInPreferenceOptions, SuccessSignInPreferenceOptions, VizbeeHomeSSOTheme } from './VizbeeHomeSSOUIConfig';
5
+ import { CommonModalPreferenceOptions, InformationalSignInPreferenceOptions, ProgressSignInPreferenceOptions, SuccessSignInPreferenceOptions, VizbeeHomeSSODefaultConfig, VizbeeHomeSSOTheme } from './VizbeeHomeSSOUIConfig';
6
6
  /**
7
7
  * Singleton class responsible for managing UI configurations for Home SSO experience
8
8
  * Handles theme customization and specific modal configurations for different sign-in states
@@ -49,11 +49,7 @@ export declare class VizbeeHomeSSOUIManager {
49
49
  * Returns default configurations for all modal types
50
50
  * @returns Object containing default configs for informational, progress, and success modals
51
51
  */
52
- getDefaultConfig(): {
53
- informational: InformationalSignInPreferenceOptions;
54
- progress: ProgressSignInPreferenceOptions;
55
- success: SuccessSignInPreferenceOptions;
56
- };
52
+ getDefaultConfig(): VizbeeHomeSSODefaultConfig;
57
53
  /**
58
54
  * Updates the current theme configuration
59
55
  * @param theme - Partial theme configuration to merge with current theme
@@ -18,6 +18,15 @@ export declare const VizbeeConstants: {
18
18
  readonly EVENT_SUBTYPE_SIGN_IN_STATUS: "sign_in_status";
19
19
  readonly VIZBEE_SESSION_READY: "vizbee-bicast-session-ready";
20
20
  };
21
+ /**
22
+ * Numeric session states reported by the Continuity SDK's bicast session manager.
23
+ * Mirrors SessionState in the VTV SDK — defined here so HomeSSO has no magic numbers.
24
+ */
25
+ export declare const VizbeeSessionState: {
26
+ readonly NOT_CONNECTED: 1;
27
+ readonly CONNECTING: 2;
28
+ readonly CONNECTED: 3;
29
+ };
21
30
  export declare enum VizbeeSignInState {
22
31
  SIGN_IN_NOT_STARTED = "not_started",
23
32
  SIGN_IN_IN_PROGRESS = "in_progress",
@@ -16,7 +16,7 @@ export interface RequestConfig extends RequestInit {
16
16
  /**
17
17
  * Standard HTTP response format with type safety
18
18
  */
19
- export interface HttpResponse<T = any> {
19
+ export interface HttpResponse<T = unknown> {
20
20
  /** Response data of type T */
21
21
  data: T;
22
22
  /** HTTP status code */
@@ -32,14 +32,14 @@ export interface HttpResponse<T = any> {
32
32
  export declare class HttpError extends Error {
33
33
  message: string;
34
34
  status?: number | undefined;
35
- response?: any | undefined;
35
+ response?: unknown | undefined;
36
36
  /**
37
37
  * Creates a new HttpError instance
38
38
  * @param message Error message
39
39
  * @param status HTTP status code
40
40
  * @param response Raw response data
41
41
  */
42
- constructor(message: string, status?: number | undefined, response?: any | undefined);
42
+ constructor(message: string, status?: number | undefined, response?: unknown | undefined);
43
43
  }
44
44
  /**
45
45
  * A feature-rich HTTP client with support for timeouts, retries, and type safety
@@ -59,7 +59,7 @@ export declare class HttpClient {
59
59
  * @param config Request configuration
60
60
  * @returns Promise resolving to typed response
61
61
  */
62
- get<T = any>(endpoint: string, config?: RequestConfig): Promise<HttpResponse<T>>;
62
+ get<T = unknown>(endpoint: string, config?: RequestConfig): Promise<HttpResponse<T>>;
63
63
  /**
64
64
  * Performs a POST request
65
65
  * @param endpoint API endpoint
@@ -67,7 +67,7 @@ export declare class HttpClient {
67
67
  * @param config Request configuration
68
68
  * @returns Promise resolving to typed response
69
69
  */
70
- post<T = any>(endpoint: string, data?: any, config?: RequestConfig): Promise<HttpResponse<T>>;
70
+ post<T = unknown>(endpoint: string, data?: unknown, config?: RequestConfig): Promise<HttpResponse<T>>;
71
71
  /**
72
72
  * Performs a PUT request
73
73
  * @param endpoint API endpoint
@@ -75,14 +75,14 @@ export declare class HttpClient {
75
75
  * @param config Request configuration
76
76
  * @returns Promise resolving to typed response
77
77
  */
78
- put<T = any>(endpoint: string, data?: any, config?: RequestConfig): Promise<HttpResponse<T>>;
78
+ put<T = unknown>(endpoint: string, data?: unknown, config?: RequestConfig): Promise<HttpResponse<T>>;
79
79
  /**
80
80
  * Performs a DELETE request
81
81
  * @param endpoint API endpoint
82
82
  * @param config Request configuration
83
83
  * @returns Promise resolving to typed response
84
84
  */
85
- delete<T = any>(endpoint: string, config?: RequestConfig): Promise<HttpResponse<T>>;
85
+ delete<T = unknown>(endpoint: string, config?: RequestConfig): Promise<HttpResponse<T>>;
86
86
  /**
87
87
  * Executes a fetch request with timeout handling
88
88
  * @throws {HttpError} When request times out