@wscsports/blaze-web-sdk 0.31.3 → 0.33.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": "@wscsports/blaze-web-sdk",
3
- "version": "0.31.3",
3
+ "version": "0.33.0",
4
4
  "main": "publish/index",
5
5
  "types": "publish/index",
6
6
  "files": [
@@ -16,24 +16,29 @@
16
16
  "publish:latest": "npm run build:prod && npm publish --access public --tag latest",
17
17
  "publish:beta": "npm run build:prod && npm publish --access public --tag beta",
18
18
  "version-download": "node ./version-downloader.js",
19
- "test": "cd e2e-tests && npx playwright test --project='Desktop Chrome'",
20
- "test:desktop": "cd e2e-tests && npx playwright test --project='Desktop Chrome' --project='Desktop Firefox' --project='Desktop Safari'",
21
- "test:desktop:stories": "cd e2e-tests && npx playwright test --project='Desktop Chrome' --project='Desktop Safari' tests/stories",
22
- "test:desktop:stories:vast-ad": "cd e2e-tests && npx playwright test --project='Desktop Chrome' --project='Desktop Firefox' --project='Desktop Safari' tests/stories/playback/story-playback-ad-vast.spec.ts --workers=1",
23
- "test:desktop:moments": "cd e2e-tests && npx playwright test --project='Desktop Chrome' --project='Desktop Safari' tests/moments",
24
- "test:desktop:long-form": "cd e2e-tests && npx playwright test --project='Desktop Chrome' --project='Desktop Safari' tests/video-longform",
25
- "test:mobile": "cd e2e-tests && npx playwright test --project='iOS Safari 13' --project='Android Chrome'",
26
- "test:mobile:stories": "cd e2e-tests && npx playwright test --project='iOS Safari 13' --project='Android Chrome' tests/stories",
27
- "test:mobile:moments": "cd e2e-tests && npx playwright test --project='iOS Safari 13' tests/moments",
28
- "test:mobile:long-form": "cd e2e-tests && npx playwright test --project='iOS Safari 13' tests/video-longform",
29
- "test:android:stories": "export USE_PHYSICAL_DEVICE=true && export $(cat .env.physical-device 2>/dev/null | xargs) && cd e2e-tests && npx playwright test --config=playwright.config.physical-device.ts --project='Android Mobile Chrome' tests/stories",
30
- "test:android:moments": "export USE_PHYSICAL_DEVICE=true && export $(cat .env.physical-device 2>/dev/null | xargs) && cd e2e-tests && npx playwright test --config=playwright.config.physical-device.ts --project='Android Mobile Chrome' tests/moments"
19
+ "test:unit": "jest",
20
+ "test:unit:watch": "jest --watch",
21
+ "test:unit:coverage": "jest --coverage",
22
+ "test": "node ./node_modules/@playwright/test/cli.js test --project='Desktop Chrome'",
23
+ "test:desktop": "node ./node_modules/@playwright/test/cli.js test --project='Desktop Chrome' --project='Desktop Firefox' --project='Desktop Safari'",
24
+ "test:desktop:stories": "node ./node_modules/@playwright/test/cli.js test --project='Desktop Chrome' --project='Desktop Safari' e2e-tests/tests/stories",
25
+ "test:desktop:stories:vast-ad": "node ./node_modules/@playwright/test/cli.js test --project='Desktop Chrome' --project='Desktop Firefox' --project='Desktop Safari' tests/stories/playback/story-playback-ad-vast.spec.ts --workers=1",
26
+ "test:desktop:stories:cta-nav": "node ./node_modules/@playwright/test/cli.js test --config=e2e-tests/playwright.config.ts --project='Desktop Chrome' --project='Desktop Safari' e2e-tests/tests/stories/navigation/story-cta-navigation.spec.ts",
27
+ "test:desktop:moments": "node ./node_modules/@playwright/test/cli.js test --project='Desktop Chrome' --project='Desktop Safari' e2e-tests/tests/moments",
28
+ "test:desktop:long-form": "node ./node_modules/@playwright/test/cli.js test --project='Desktop Chrome' --project='Desktop Safari' e2e-tests/tests/video-longform",
29
+ "test:mobile": "node ./node_modules/@playwright/test/cli.js test --project='iOS Safari 13' --project='Android Chrome'",
30
+ "test:mobile:stories": "node ./node_modules/@playwright/test/cli.js test --project='iOS Safari 13' --project='Android Chrome' e2e-tests/tests/stories",
31
+ "test:mobile:moments": "node ./node_modules/@playwright/test/cli.js test --project='iOS Safari 13' e2e-tests/tests/moments",
32
+ "test:mobile:long-form": "node ./node_modules/@playwright/test/cli.js test --project='iOS Safari 13' e2e-tests/tests/video-longform",
33
+ "test:android:stories": "export USE_PHYSICAL_DEVICE=true && export $(cat .env.physical-device 2>/dev/null | xargs) && node ./node_modules/@playwright/test/cli.js test --config=playwright.config.physical-device.ts --project='Android Mobile Chrome' e2e-tests/tests/stories",
34
+ "test:android:moments": "export USE_PHYSICAL_DEVICE=true && export $(cat .env.physical-device 2>/dev/null | xargs) && node ./node_modules/@playwright/test/cli.js test --config=playwright.config.physical-device.ts --project='Android Mobile Chrome' e2e-tests/tests/moments"
31
35
  },
32
36
  "devDependencies": {
33
37
  "@playwright/test": "^1.56.0",
34
38
  "@types/animejs": "^3.1.7",
35
39
  "@types/google_interactive_media_ads_types": "^1.20241219.0",
36
40
  "@types/hammerjs": "^2.0.45",
41
+ "@types/jest": "^30.0.0",
37
42
  "@types/node": "^24.7.0",
38
43
  "@types/ua-parser-js": "^0.7.36",
39
44
  "@types/uuid": "^10.0.0",
@@ -45,11 +50,14 @@
45
50
  "html-webpack-plugin": "^5.5.3",
46
51
  "intersection-observer": "^0.12.2",
47
52
  "javascript-obfuscator": "^4.0.2",
53
+ "jest": "^30.2.0",
54
+ "jest-environment-jsdom": "^30.2.0",
48
55
  "media-captions": "^0.0.18",
49
56
  "npm-registry-fetch": "^16.0.0",
50
57
  "playwright-chromium": "^1.56.0",
51
58
  "playwright-webkit": "^1.56.0",
52
59
  "style-loader": "^3.3.3",
60
+ "ts-jest": "^29.4.6",
53
61
  "ts-loader": "^9.4.4",
54
62
  "typescript": "^5.4.2",
55
63
  "videojs-vtt.js": "^0.15.5",
@@ -387,20 +387,6 @@ export type BlazeAbTestType = {
387
387
  id: string;
388
388
  variant: string;
389
389
  };
390
- export type BlazeSourceType = "labels" | "ids" | "recommendations" | "text";
391
- export type AdvancedOrdering = "LiveFirst";
392
- export interface BlazeDataSourceType {
393
- sourceType: BlazeSourceType;
394
- labels?: string | string[] | BlazeWidgetLabel;
395
- labelsPriority?: string | string[] | BlazeWidgetLabel[];
396
- ids?: string[];
397
- orderType?: OrderType;
398
- maxItems?: number;
399
- advancedOrdering?: AdvancedOrdering;
400
- personalized?: BlazePersonalized;
401
- recommendations?: BlazeRecommendations;
402
- text?: string;
403
- }
404
390
  export interface IBlazeWidgetLabel {
405
391
  readonly _type: "BlazeWidgetLabel";
406
392
  value: string;
@@ -422,6 +408,20 @@ declare class BlazeWidgetLabel implements IBlazeWidgetLabel {
422
408
  private static validateAndProceed;
423
409
  private static isValidLabelFormat;
424
410
  }
411
+ export type BlazeSourceType = "labels" | "ids" | "recommendations" | "text";
412
+ export type AdvancedOrdering = "LiveFirst";
413
+ export interface BlazeDataSourceType {
414
+ sourceType: BlazeSourceType;
415
+ labels?: string | string[] | BlazeWidgetLabel;
416
+ labelsPriority?: string | string[] | BlazeWidgetLabel[];
417
+ ids?: string[];
418
+ orderType?: OrderType;
419
+ maxItems?: number;
420
+ advancedOrdering?: AdvancedOrdering;
421
+ personalized?: BlazePersonalized;
422
+ recommendations?: BlazeRecommendations;
423
+ text?: string;
424
+ }
425
425
  export type LocaleDirectionType = "LTR" | "RTL";
426
426
  export type OrderType = "Manual" | "AtoZ" | "ZtoA" | "RecentlyUpdatedFirst" | "RecentlyUpdatedLast" | "RecentlyCreatedFirst" | "RecentlyCreatedLast" | "Random";
427
427
  export type ContentOrderType = "LIVE_CHIP" | "STORY_TITLE" | "PUBLISHED_DATE";
@@ -548,7 +548,9 @@ export type RecommendationsType = {
548
548
  export type BlazeRecommendationsForYou = RecommendationsType & {
549
549
  promotedLabels?: string[];
550
550
  };
551
- export type BlazeRecommendationsTrending = RecommendationsType;
551
+ export type BlazeRecommendationsTrending = RecommendationsType & {
552
+ promotedLabels?: string[];
553
+ };
552
554
  export type BlazeRecommendations = {
553
555
  forYou?: BlazeRecommendationsForYou;
554
556
  trending?: BlazeRecommendationsTrending;
@@ -566,6 +568,13 @@ export type BlazeFollowEntity = {
566
568
  entityType: BlazeFollowEntityType;
567
569
  entityId: string;
568
570
  };
571
+ export type RetrievedLanguages = {
572
+ title?: string;
573
+ description?: string;
574
+ subtitle?: string;
575
+ cta?: string;
576
+ ctaText?: string;
577
+ };
569
578
  export interface IContent {
570
579
  id: string;
571
580
  title: string;
@@ -581,6 +590,7 @@ export interface IContent {
581
590
  closedCaptions?: IClosedCaption[];
582
591
  extraInfo: ExtraInfo;
583
592
  followEntities?: BlazeFollowEntity[];
593
+ retrievedLanguages?: RetrievedLanguages;
584
594
  }
585
595
  export interface IBlazeContent {
586
596
  id: string;
@@ -654,6 +664,7 @@ export interface IBlazeSDKOptions {
654
664
  shouldAllowClosedCaptions?: boolean;
655
665
  disableAutoLoadingContent?: boolean;
656
666
  followedEntities?: string[];
667
+ preferredLanguage?: string;
657
668
  }
658
669
  export interface IDataSourceBuilder {
659
670
  labels: (params: LabelsDataSourceParams) => BlazeDataSourceType;
@@ -786,6 +797,7 @@ declare enum ActionHandlerId {
786
797
  }
787
798
  export declare function setDoNotTrack(value: boolean): void;
788
799
  export declare function setGeoLocation(value: string): void;
800
+ export declare function setPreferredLanguage(preferredLanguage: string | null): void;
789
801
  export declare function setExternalUserId(value: string): Promise<void>;
790
802
  export declare function setOnItemClick(callback: ItemClickCallback | undefined): void;
791
803
  export declare function Initialize(apiKey: string, userOptions?: Partial<IBlazeSDKOptions>): Promise<void>;
@@ -844,6 +856,7 @@ declare const _default: {
844
856
  setDoNotTrack: typeof setDoNotTrack;
845
857
  setDisableAnalytics: typeof setDisableAnalytics;
846
858
  setGeoLocation: typeof setGeoLocation;
859
+ setPreferredLanguage: typeof setPreferredLanguage;
847
860
  setOnItemClick: typeof setOnItemClick;
848
861
  LabelBuilder: typeof LabelBuilder;
849
862
  DataSourceBuilder: typeof DataSourceBuilder;