senza-sdk 4.3.2 → 4.3.3-13bd44c.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "senza-sdk",
3
- "version": "4.3.2",
3
+ "version": "4.3.3-13bd44c.0",
4
4
  "main": "./src/api.js",
5
5
  "description": "API for Senza application",
6
6
  "license": "MIT",
@@ -14,10 +14,13 @@
14
14
  "prepublishOnly": "npm run build:interface",
15
15
  "eslint": "eslint --max-warnings 0 src test",
16
16
  "build": "npm run build:interface && npm run build:implementation",
17
+ "prebuild:interface": "npm run version:output",
17
18
  "build:interface": "npx webpack --config interface.webpack.config.js",
19
+ "prebuild:implementation": "npm run version:output",
18
20
  "build:implementation": "npx webpack --config implementation.webpack.config.js",
19
21
  "test": "jest --coverage --verbose",
20
- "testall": "npm run test && npm run eslint --fix"
22
+ "testall": "npm run test && npm run eslint --fix",
23
+ "version:output": "echo 'export const version = \"'$npm_package_version'\";' > src/interface/version.js"
21
24
  },
22
25
  "devDependencies": {
23
26
  "@babel/cli": "^7.13.16",
package/src/api.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { sdkLogger, noop } from "./interface/utils.js";
2
- import pack from "../package.json";
2
+
3
3
  import { Lifecycle, RemotePlayer, DeviceManager, PlatformManager, AlarmManager, MessageManager, ShakaPlayer, shaka, showSequence, initSequence } from "./interface/api.js";
4
4
 
5
- const { version } = pack;
5
+ import { version } from "./interface/version.js";
6
6
 
7
7
  typeof document !== "undefined" && document.addEventListener("keydown", (event) => {
8
8
  sdkLogger.log(`Got ${event.key} key`);
@@ -1,7 +1,7 @@
1
- import { AlarmManager as AlarmManagerInterface } from "../interface/alarmManager";
2
- import { getFCID, sdkLogger } from "./utils";
3
- import { EventListenersManager } from "./eventListenersManager";
4
- import { lifecycle } from "./lifecycle";
1
+ import { AlarmManager as AlarmManagerInterface } from "../interface/alarmManager.js";
2
+ import { getFCID, sdkLogger } from "./utils.js";
3
+ import { EventListenersManager } from "./eventListenersManager.js";
4
+ import { lifecycle } from "./lifecycle.js";
5
5
 
6
6
  class AlarmManager extends AlarmManagerInterface {
7
7
  constructor() {
@@ -1,5 +1,5 @@
1
- import { lifecycle, remotePlayer } from "./api";
2
- import { sdkLogger } from "./utils";
1
+ import { lifecycle, remotePlayer } from "./api.js";
2
+ import { sdkLogger } from "./utils.js";
3
3
 
4
4
  const timeout = 500;
5
5
  let timerId;
@@ -1,6 +1,6 @@
1
- import { Lifecycle as LifecycleInterface } from "../interface/lifecycle";
2
- import { getPlatformInfo } from "./api";
3
- import { alarmManager } from "./alarmManager";
1
+ import { Lifecycle as LifecycleInterface } from "../interface/lifecycle.js";
2
+ import { getPlatformInfo } from "./api.js";
3
+ import { alarmManager } from "./alarmManager.js";
4
4
  import {
5
5
  getFCID,
6
6
  isAudioSyncConfigured,
@@ -11,9 +11,9 @@ import {
11
11
  SenzaError,
12
12
  TargetPlayingState
13
13
  } from "./utils";
14
- import { EventListenersManager } from "./eventListenersManager";
15
- import { sessionInfo } from "./SessionInfo";
16
- import { DEFAULT_REMOTE_PLAYER_CONFIRMATION_TIMEOUT, remotePlayer } from "./remotePlayer";
14
+ import { EventListenersManager } from "./eventListenersManager.js";
15
+ import { sessionInfo } from "./SessionInfo.js";
16
+ import { DEFAULT_REMOTE_PLAYER_CONFIRMATION_TIMEOUT, remotePlayer } from "./remotePlayer.js";
17
17
 
18
18
  // Default values for autoBackground settings. These values are used if the UIStreamer settings are not provided.
19
19
  const DEFAULT_AUTO_BACKGROUND_VIDEO_DELAY = 30;
@@ -647,7 +647,7 @@ class Lifecycle extends LifecycleInterface {
647
647
  fcid: FCID,
648
648
  session: btoa(JSON.stringify({
649
649
  tenantId,
650
- tenantSwitchInfo: {startTime: new Date().toISOString(), tenantOrigin: getPlatformInfo().sessionInfo?.tenant},
650
+ tenantSwitchInfo: { startTime: new Date().toISOString(), tenantOrigin: getPlatformInfo().sessionInfo?.tenant },
651
651
  ...getPlatformInfo().sessionInfo?.tenantId === contentHubTenantId && tenantId !== homeTenantId && { returnToTenantId: contentHubTenantId }
652
652
  }))
653
653
  };
@@ -688,7 +688,7 @@ class Lifecycle extends LifecycleInterface {
688
688
  splashUrl: sessionInfoObj?.homeSessionInfo.tenantInfo.tenantSettings.applicationSwitchSplashUrl,
689
689
  fcid: FCID
690
690
  };
691
- const session = {tenantSwitchInfo: {startTime: new Date().toISOString(), tenantOrigin: getPlatformInfo().sessionInfo?.tenant}};
691
+ const session = { tenantSwitchInfo: { startTime: new Date().toISOString(), tenantOrigin: getPlatformInfo().sessionInfo?.tenant } };
692
692
  if (sessionInfoObj?.returnToTenantId) {
693
693
  if (sessionInfoObj?.returnToTenantId === sessionInfoObj?.homeSessionInfo.tenantInfo.contentHubTenantId) {
694
694
  message.splashUrl = sessionInfoObj?.homeSessionInfo.contentHubTenantInfo.tenantSettings.applicationSwitchSplashUrl;
@@ -1,4 +1,4 @@
1
- import { noop } from "./utils";
1
+ import { noop } from "./utils.js";
2
2
 
3
3
  /**
4
4
  * alarm event
@@ -1,5 +1,4 @@
1
- import pack from "../../package.json";
2
- const { version } = pack;
1
+ import { version } from "./version.js";
3
2
 
4
3
  /* eslint-disable no-console */
5
4
  class SdkLogger {
@@ -0,0 +1 @@
1
+ export const version = "4.3.3-13bd44c.0";