@24i/bigscreen-sdk 1.0.34 → 1.0.35-alpha.2586

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": "@24i/bigscreen-sdk",
3
- "version": "1.0.34",
3
+ "version": "1.0.35-alpha.2586",
4
4
  "description": "SmartApps BIGscreen SDK monorepo",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -40,7 +40,7 @@
40
40
  "@24i/appstage-shared-analytics": "1.0.20-alpha.70",
41
41
  "@24i/appstage-shared-events-manager": "1.0.11",
42
42
  "@24i/appstage-shared-perf-utils": "1.0.11",
43
- "@24i/bigscreen-players-engine-base": "3.0.2",
43
+ "@24i/bigscreen-players-engine-base": "3.1.1",
44
44
  "@24i/smartapps-datalayer": "3.0.11",
45
45
  "@sentry/browser": "7.35.0",
46
46
  "@sentry/types": "7.35.0",
@@ -53,14 +53,14 @@
53
53
  "@24i/bigscreen-sdk": "file:.",
54
54
  "@24i/eslint-config-smartapps-bigscreen-linters": "file:./libs/linters",
55
55
  "@24i/smartapps-bigscreen-changelog-generator": "0.17.0",
56
- "@babel/core": "^7.23.7",
57
- "@babel/preset-env": "^7.23.7",
56
+ "@babel/core": "^7.23.9",
57
+ "@babel/preset-env": "^7.23.9",
58
58
  "@types/fs-extra": "^11.0.4",
59
59
  "@types/gtag.js": "^0.0.18",
60
60
  "@types/inquirer": "^9.0.7",
61
61
  "@types/jest": "^29.5.11",
62
62
  "@types/minimist": "^1.2.5",
63
- "@types/node": "^20.10.6",
63
+ "@types/node": "^20.11.14",
64
64
  "@types/prop-types": "^15.7.11",
65
65
  "@types/react": "18.0.33",
66
66
  "@types/scheduler": "^0.16.8",
@@ -71,16 +71,16 @@
71
71
  "fs-extra": "^11.2.0",
72
72
  "full-icu": "^1.5.0",
73
73
  "identity-obj-proxy": "^3.0.0",
74
- "inquirer": "^9.2.12",
74
+ "inquirer": "^9.2.13",
75
75
  "jest": "^29.7.0",
76
76
  "jest-canvas-mock": "^2.5.2",
77
77
  "jest-environment-jsdom": "^29.7.0",
78
78
  "jest-sonar": "^0.2.15",
79
79
  "minimist": "^1.2.8",
80
80
  "patch-package": "^8.0.0",
81
- "sass": "^1.69.6",
81
+ "sass": "^1.70.0",
82
82
  "sass-true": "^6.1.0",
83
- "ts-jest": "^29.1.1",
83
+ "ts-jest": "^29.1.2",
84
84
  "ts-node": "^10.9.2",
85
85
  "tsconfig-paths-jest": "0.0.1",
86
86
  "typescript": "^5.1.6"
@@ -2,6 +2,7 @@ import {
2
2
  DeviceBase, ConnectionType, ScreenSaverStatus, VolumeRange,
3
3
  } from '@24i/bigscreen-sdk/driver-base';
4
4
  import { runAsync } from '@24i/bigscreen-sdk/utils/timers';
5
+ import { ipify } from '@24i/bigscreen-sdk/ipify';
5
6
  import { getKeyMap } from './keymap';
6
7
  import { ISmartCastApi, IFA, DEFAULT_TTS_TIMEOUT, DevicePlaybackQuality } from './types';
7
8
 
@@ -32,6 +33,8 @@ export class DeviceSmartCast extends DeviceBase {
32
33
 
33
34
  IFA?: IFA;
34
35
 
36
+ publicIpAddress?: string;
37
+
35
38
  async initDevice() {
36
39
  this.initNetworkChangeListener();
37
40
  this.initVisibilityChangeListener();
@@ -206,12 +209,14 @@ export class DeviceSmartCast extends DeviceBase {
206
209
  /**
207
210
  * Returns filled in Vast Tag URL.
208
211
  */
209
- getVastTagUrl(template: string): null | string {
212
+ async getVastTagUrl(template: string): Promise<null | string> {
210
213
  const IFAObject = this.IFA;
211
214
  const resolution = this.getResolution();
212
215
 
213
216
  if (!IFAObject) return null;
214
217
 
218
+ this.publicIpAddress = this.publicIpAddress ?? await ipify();
219
+
215
220
  return template
216
221
  .replace('{{width}}', String(resolution.width))
217
222
  .replace('{{height}}', String(resolution.height))
@@ -219,6 +224,7 @@ export class DeviceSmartCast extends DeviceBase {
219
224
  .replace('{{user_agent}}', encodeURIComponent(window.navigator.userAgent))
220
225
  .replace('{{ifa}}', IFAObject.IFA)
221
226
  .replace('{{ifa_type}}', IFAObject.IFA_TYPE)
227
+ .replace('{{ip_address}}', this.publicIpAddress!)
222
228
  .replace('{{lmt}}', String(IFAObject.LMT));
223
229
  }
224
230
 
@@ -9,7 +9,7 @@ export const deeplinkUrl = 'https://smartapps-bigscreen.24i.com/#/detail/SERIES/
9
9
  // eslint-disable-next-line max-len
10
10
  export const deeplinkUrl2 = 'https://smartapps-bigscreen.24i.com/#/detail/SERIES/Ge1sO4gBXRsigNB1TBwy/undefined/undefined/';
11
11
  // eslint-disable-next-line max-len
12
- export const vastTagTemplate = 'w={{width}}&h={{height}}&did={{ifa}}&ifa_type={{ifa_type}}&lmt={{lmt}}';
12
+ export const vastTagTemplate = 'w={{width}}&h={{height}}&did={{ifa}}&ifa_type={{ifa_type}}&lmt={{lmt}}&ip={{ip_address}}';
13
13
 
14
14
  export const SmartCastMockApi: ISmartCastApi = {
15
15
  deviceModel,
@@ -6,14 +6,16 @@ export const isPathVisible = (hash: string, regexpPath?: RegExp) => (
6
6
 
7
7
  export const getCurrentHash = () => window.location.href.split('#')[1] || '';
8
8
 
9
- const PARAM = '([a-zA-Z0-9+-=.:%_()\\[\\]{}]+)';
9
+ // eslint-disable-next-line no-useless-escape
10
+ const PARAM_REGEX = /([a-zA-Z0-9+\-=.:%_()\[\]{}]+)/;
11
+ export const PARAM_REGEX_STR = PARAM_REGEX.source;
10
12
 
11
13
  export const pathToRegExp = (path: string) => {
12
14
  const regexpParts: string[] = [];
13
15
  const paramNames: string[] = [];
14
16
  forEach(path.split('/'), (pathPart) => {
15
17
  if (pathPart.indexOf(':') === 0) {
16
- regexpParts.push(PARAM);
18
+ regexpParts.push(PARAM_REGEX_STR);
17
19
  paramNames.push(pathPart.replace(':', ''));
18
20
  } else regexpParts.push(pathPart);
19
21
  });