@wscsports/blaze-web-sdk 0.17.1 → 0.19.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 +1 -1
- package/publish/index.d.ts +67 -9
- package/publish/index.js +1 -1
package/package.json
CHANGED
package/publish/index.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ export declare function setAbTestParams(abTestParams: BlazeAbTestType): void;
|
|
|
32
32
|
export declare function getAppContextManager(): Record<string, any>;
|
|
33
33
|
export declare const pushConsentEvent: (action: string, body: Record<string, any>) => void;
|
|
34
34
|
export declare const isInitialized: () => boolean;
|
|
35
|
+
export declare function setBeforeContentPlayCallback(callback: BeforeContentPlayCallback | undefined): void;
|
|
35
36
|
declare const _default: {
|
|
36
37
|
Initialize: typeof Initialize;
|
|
37
38
|
WidgetGridView: typeof WidgetGridView;
|
|
@@ -58,6 +59,7 @@ declare const _default: {
|
|
|
58
59
|
getAppContextManager: typeof getAppContextManager;
|
|
59
60
|
pushConsentEvent: (action: string, body: Record<string, any>) => void;
|
|
60
61
|
isInitialized: () => boolean;
|
|
62
|
+
setBeforeContentPlayCallback: typeof setBeforeContentPlayCallback;
|
|
61
63
|
};
|
|
62
64
|
export default _default;
|
|
63
65
|
|
|
@@ -361,7 +363,7 @@ export declare abstract class BaseWidget extends HTMLElement {
|
|
|
361
363
|
removeElement(): void;
|
|
362
364
|
}
|
|
363
365
|
|
|
364
|
-
type BlazeSourceType = 'labels' | 'ids';
|
|
366
|
+
type BlazeSourceType = 'labels' | 'ids' | 'recommendations';
|
|
365
367
|
export type AdvancedOrdering = 'LiveFirst';
|
|
366
368
|
export interface BlazeDataSourceType {
|
|
367
369
|
sourceType: BlazeSourceType;
|
|
@@ -372,6 +374,7 @@ export interface BlazeDataSourceType {
|
|
|
372
374
|
maxItems?: number;
|
|
373
375
|
advancedOrdering?: AdvancedOrdering;
|
|
374
376
|
personalized?: BlazePersonalized;
|
|
377
|
+
recommendations?: BlazeRecommendations;
|
|
375
378
|
}
|
|
376
379
|
export declare const BlazeInternalError: {
|
|
377
380
|
LabelExpressionMustNotBeEmpty: string;
|
|
@@ -379,10 +382,15 @@ export declare const BlazeInternalError: {
|
|
|
379
382
|
IdsMustNotBeEmpty: string;
|
|
380
383
|
MissingLabelsProperty: string;
|
|
381
384
|
IdsMustNotHaveSpaces: string;
|
|
385
|
+
ForYouNotSupported: string;
|
|
386
|
+
TrendingNotSupported: string;
|
|
387
|
+
ForYouContentPreparationNotSupported: string;
|
|
388
|
+
TrendingContentPreparationNotSupported: string;
|
|
382
389
|
};
|
|
383
390
|
export declare class BlazeDataSourceFactory {
|
|
384
391
|
static createLabelsDataSource(params: LabelsDataSourceParams): BlazeDataSourceType;
|
|
385
392
|
static createIdsDataSource(params: IdsDataSourceParams): BlazeDataSourceType;
|
|
393
|
+
static createRecommendationsDataSource(params: RecommendationsDataSourceParams): BlazeDataSourceType;
|
|
386
394
|
static setLabelsPriority(labelsPriority: string | string[] | BlazeWidgetLabel[] | undefined): string;
|
|
387
395
|
}
|
|
388
396
|
export declare class BlazeDataSourceValidations {
|
|
@@ -391,7 +399,7 @@ export declare class BlazeDataSourceValidations {
|
|
|
391
399
|
labels?: string | string[] | BlazeWidgetLabel;
|
|
392
400
|
storyIds?: string[];
|
|
393
401
|
contentIds?: string[];
|
|
394
|
-
}, dataSource?: BlazeDataSourceType): void;
|
|
402
|
+
}, dataSource?: BlazeDataSourceType, contentType?: ContentType): void;
|
|
395
403
|
}
|
|
396
404
|
|
|
397
405
|
export declare function debounce<T extends (...args: any[]) => any>(func: T, delay: number): {
|
|
@@ -1332,7 +1340,9 @@ export interface AppConfiguration {
|
|
|
1332
1340
|
configurations: {
|
|
1333
1341
|
analyticsAddEntitiesInfo?: string;
|
|
1334
1342
|
configRefetchIntervalInMinutes?: number;
|
|
1343
|
+
enableClientPlaybackModification?: 'true' | 'false' | string;
|
|
1335
1344
|
};
|
|
1345
|
+
recommendationsConfigurations?: IRecommendationsConfigurations;
|
|
1336
1346
|
sdkLoggerConfigurations?: ILoggerConfiguration;
|
|
1337
1347
|
}
|
|
1338
1348
|
|
|
@@ -1942,6 +1952,14 @@ export interface ImaAdHandler {
|
|
|
1942
1952
|
provideAdExtraParams?: (contentExtraInfo?: ContentExtraInfo) => ImaExtraParams;
|
|
1943
1953
|
}
|
|
1944
1954
|
|
|
1955
|
+
export interface BeforeContentPlayContext {
|
|
1956
|
+
originalUrl: string;
|
|
1957
|
+
}
|
|
1958
|
+
export interface BeforeContentPlayResult {
|
|
1959
|
+
resultUrl: string;
|
|
1960
|
+
}
|
|
1961
|
+
export type BeforeContentPlayCallback = (context: BeforeContentPlayContext) => Promise<BeforeContentPlayResult> | BeforeContentPlayResult;
|
|
1962
|
+
|
|
1945
1963
|
export interface ISmoothOpenCloseModal {
|
|
1946
1964
|
storyId?: string;
|
|
1947
1965
|
pageIndex: number;
|
|
@@ -1990,9 +2008,11 @@ export interface IButtonPlayerConfig {
|
|
|
1990
2008
|
export interface IDataSourceBuilder {
|
|
1991
2009
|
labels: (params: LabelsDataSourceParams) => BlazeDataSourceType;
|
|
1992
2010
|
ids: (params: IdsDataSourceParams) => BlazeDataSourceType;
|
|
2011
|
+
recommendations: (params: RecommendationsDataSourceParams) => BlazeDataSourceType;
|
|
1993
2012
|
}
|
|
1994
|
-
export type LabelsDataSourceParams = Omit<BlazeDataSourceType, 'sourceType' | 'ids'>;
|
|
1995
|
-
export type IdsDataSourceParams = Omit<BlazeDataSourceType, 'sourceType' | 'labels' | 'labelsPriority' | 'maxItems'>;
|
|
2013
|
+
export type LabelsDataSourceParams = Omit<BlazeDataSourceType, 'sourceType' | 'ids' | 'recommendations'>;
|
|
2014
|
+
export type IdsDataSourceParams = Omit<BlazeDataSourceType, 'sourceType' | 'labels' | 'recommendations' | 'labelsPriority' | 'maxItems'>;
|
|
2015
|
+
export type RecommendationsDataSourceParams = Omit<BlazeDataSourceType, 'sourceType' | 'ids' | 'labels'>;
|
|
1996
2016
|
|
|
1997
2017
|
export interface IDatabase {
|
|
1998
2018
|
init: () => Promise<void>;
|
|
@@ -2091,6 +2111,7 @@ export type BlazeVideoIconsStyle = BaseBlazeIcons & {
|
|
|
2091
2111
|
|
|
2092
2112
|
export * from './accessibility-manager.interface';
|
|
2093
2113
|
export * from './ad-handler.interface';
|
|
2114
|
+
export * from './before-content-play.interface';
|
|
2094
2115
|
export * from './behaviors.interface';
|
|
2095
2116
|
export * from './blaze-sdk.interface';
|
|
2096
2117
|
export * from './button.interface';
|
|
@@ -2108,6 +2129,7 @@ export * from './widget-label-builder.interface';
|
|
|
2108
2129
|
export * from './widget-options.interface';
|
|
2109
2130
|
export * from './widget-view.interface';
|
|
2110
2131
|
export * from './item-click-callback.interface';
|
|
2132
|
+
export * from './recommendations.interface';
|
|
2111
2133
|
export { default as Observable } from './observable';
|
|
2112
2134
|
|
|
2113
2135
|
export interface ItemClickContext {
|
|
@@ -2208,6 +2230,13 @@ export default interface IntersectionObservable {
|
|
|
2208
2230
|
|
|
2209
2231
|
export type ScreenMode = 'Full Screen' | 'Embedded';
|
|
2210
2232
|
|
|
2233
|
+
export interface IRecommendationsConfigurations {
|
|
2234
|
+
enableForYouContentPreparation: boolean;
|
|
2235
|
+
enableTrendingContentPreparation: boolean;
|
|
2236
|
+
supportForYou: boolean;
|
|
2237
|
+
supportTrending: boolean;
|
|
2238
|
+
}
|
|
2239
|
+
|
|
2211
2240
|
export interface IResponse<T = any> {
|
|
2212
2241
|
data?: T;
|
|
2213
2242
|
error?: Error;
|
|
@@ -2353,6 +2382,9 @@ type GetByLabelsOptions = GetOptions & {
|
|
|
2353
2382
|
type GetByIdsOptions = GetOptions & {
|
|
2354
2383
|
ids: string[];
|
|
2355
2384
|
};
|
|
2385
|
+
type GetByRecommendationsOptions = GetOptions & {
|
|
2386
|
+
recommendations: BlazeRecommendations;
|
|
2387
|
+
};
|
|
2356
2388
|
export interface ApiResponse<T> {
|
|
2357
2389
|
assetsExpiryTime: string;
|
|
2358
2390
|
totalItems: number;
|
|
@@ -2395,6 +2427,7 @@ declare abstract class ApiServiceClass extends ApiServiceClass_base implements I
|
|
|
2395
2427
|
error?: Error | undefined;
|
|
2396
2428
|
}>;
|
|
2397
2429
|
getMomentsByLabels(options: GetByLabelsOptions): Promise<import("../interfaces").IHttpResponse<MomentsResponse>>;
|
|
2430
|
+
getMomentsByRecommendations(options: GetByRecommendationsOptions): Promise<import("../interfaces").IHttpResponse<MomentsResponse>>;
|
|
2398
2431
|
updateMomentLikeStatus(options: {
|
|
2399
2432
|
momentId: string;
|
|
2400
2433
|
setLiked: boolean;
|
|
@@ -2427,6 +2460,7 @@ declare abstract class ApiServiceClass extends ApiServiceClass_base implements I
|
|
|
2427
2460
|
private getContentDefaultParams;
|
|
2428
2461
|
private getContentParamsByLabels;
|
|
2429
2462
|
private getContentParamsByIds;
|
|
2463
|
+
private getContentParamsByRecommendations;
|
|
2430
2464
|
}
|
|
2431
2465
|
export declare const ApiService: ApiServiceClass;
|
|
2432
2466
|
|
|
@@ -2447,6 +2481,10 @@ declare abstract class AppConfigurationServiceClass extends AppConfigurationServ
|
|
|
2447
2481
|
}
|
|
2448
2482
|
export declare const AppConfigurationService: AppConfigurationServiceClass;
|
|
2449
2483
|
|
|
2484
|
+
export declare class BeforeContentPlayService {
|
|
2485
|
+
getTokenizedUrl(originalUrl: string): Promise<string>;
|
|
2486
|
+
}
|
|
2487
|
+
|
|
2450
2488
|
declare const ConfigServiceClass_base: {
|
|
2451
2489
|
new (): {};
|
|
2452
2490
|
_instance: ConfigServiceClass;
|
|
@@ -2484,6 +2522,7 @@ declare abstract class ConfigServiceClass extends ConfigServiceClass_base implem
|
|
|
2484
2522
|
private _appContext;
|
|
2485
2523
|
private _disableAutoLoadingContent;
|
|
2486
2524
|
private _onItemClick;
|
|
2525
|
+
private _beforeContentPlayCallback?;
|
|
2487
2526
|
protected constructor();
|
|
2488
2527
|
init(options: IBlazeSDKOptions): Promise<void>;
|
|
2489
2528
|
private readonly _russiaRegionCDN;
|
|
@@ -2545,6 +2584,8 @@ declare abstract class ConfigServiceClass extends ConfigServiceClass_base implem
|
|
|
2545
2584
|
set disableAutoLoadingContent(value: boolean);
|
|
2546
2585
|
get onItemClick(): ItemClickCallback | undefined;
|
|
2547
2586
|
set onItemClick(value: ItemClickCallback | undefined);
|
|
2587
|
+
get beforeContentPlayCallback(): BeforeContentPlayCallback | undefined;
|
|
2588
|
+
set beforeContentPlayCallback(callback: BeforeContentPlayCallback | undefined);
|
|
2548
2589
|
}
|
|
2549
2590
|
export declare const ConfigService: ConfigServiceClass;
|
|
2550
2591
|
|
|
@@ -2648,6 +2689,7 @@ export * from './ad.service';
|
|
|
2648
2689
|
export * from './analytics.service';
|
|
2649
2690
|
export * from './api.service';
|
|
2650
2691
|
export * from './app-configuration.service';
|
|
2692
|
+
export * from './before-content-play.service';
|
|
2651
2693
|
export * from './config.service';
|
|
2652
2694
|
export * from './database.service';
|
|
2653
2695
|
export * from './error.service';
|
|
@@ -3840,6 +3882,7 @@ export * from './action-handler.type';
|
|
|
3840
3882
|
export * from './cc-language.type';
|
|
3841
3883
|
export * from './widget-view-options.type';
|
|
3842
3884
|
export * from './content-item.type';
|
|
3885
|
+
export * from './recommendations.type';
|
|
3843
3886
|
|
|
3844
3887
|
export type EntitiesType = 'playerId' | 'teamId' | 'gameId' | 'roundId';
|
|
3845
3888
|
export type PerItemStyleOverrides = Partial<Record<EntitiesType, Array<{
|
|
@@ -3891,6 +3934,18 @@ export type PrefetchingPolicyType = 'low' | 'default';
|
|
|
3891
3934
|
|
|
3892
3935
|
export type ContentAspectRatio = 'Vertical' | 'Horizontal';
|
|
3893
3936
|
|
|
3937
|
+
type RecommendationsType = {
|
|
3938
|
+
anyLabelFilter?: string[];
|
|
3939
|
+
};
|
|
3940
|
+
export type BlazeRecommendationsForYou = RecommendationsType & {
|
|
3941
|
+
promotedLabels?: string[];
|
|
3942
|
+
};
|
|
3943
|
+
export type BlazeRecommendationsTrending = RecommendationsType;
|
|
3944
|
+
export type BlazeRecommendations = {
|
|
3945
|
+
forYou?: BlazeRecommendationsForYou;
|
|
3946
|
+
trending?: BlazeRecommendationsTrending;
|
|
3947
|
+
};
|
|
3948
|
+
|
|
3894
3949
|
export type ScreenState = 'default_view' | 'full_screen';
|
|
3895
3950
|
export type ScreenChangeState = {
|
|
3896
3951
|
current_state: ScreenState;
|
|
@@ -4744,7 +4799,7 @@ export interface PlaybackStrategy {
|
|
|
4744
4799
|
toggleFullscreen(): void;
|
|
4745
4800
|
seek(time: number): void;
|
|
4746
4801
|
getDuration(): number;
|
|
4747
|
-
loadSource(src: string, bitRate: number, startingTime: number): void
|
|
4802
|
+
loadSource(src: string, bitRate: number, startingTime: number): Promise<void>;
|
|
4748
4803
|
unload(): void;
|
|
4749
4804
|
destroy(): void;
|
|
4750
4805
|
}
|
|
@@ -4757,6 +4812,7 @@ export declare class HLSStrategy implements PlaybackStrategy {
|
|
|
4757
4812
|
private retryCount;
|
|
4758
4813
|
private maxRetries;
|
|
4759
4814
|
private lastTime;
|
|
4815
|
+
private beforeContentPlayService;
|
|
4760
4816
|
private playbackWatchdogTimeout?;
|
|
4761
4817
|
private loaderTimeout?;
|
|
4762
4818
|
private recoveryTimeout?;
|
|
@@ -4771,7 +4827,7 @@ export declare class HLSStrategy implements PlaybackStrategy {
|
|
|
4771
4827
|
private boundOnNativeError;
|
|
4772
4828
|
constructor(video: HTMLVideoElement);
|
|
4773
4829
|
initialize(videoOverlay: BlazeLongFormControlsOverlay): void;
|
|
4774
|
-
loadSource(src: string, initialBitrate: number, startingTime?: number): void
|
|
4830
|
+
loadSource(src: string, initialBitrate: number, startingTime?: number): Promise<void>;
|
|
4775
4831
|
unload(): void;
|
|
4776
4832
|
destroy(): void;
|
|
4777
4833
|
private waitForVideoCondition;
|
|
@@ -4881,6 +4937,7 @@ export declare abstract class WidgetBaseLayout extends BlazeWidgetScrollable imp
|
|
|
4881
4937
|
setContentIds(ids: string[], options?: ISetWidgetOptions): void;
|
|
4882
4938
|
setMaxItemsSize(maxItemsSize?: number, options?: ISetWidgetOptions): void;
|
|
4883
4939
|
setActionHandlers(actionHandlers: ActionHandler[]): void;
|
|
4940
|
+
setRecommendations(recommendations?: BlazeRecommendations, options?: ISetWidgetOptions): void;
|
|
4884
4941
|
protected appendModalToBlazeSDK(modal: BlazeWidgetMomentModal | BlazeWidgetStoryModal | BlazeWidgetVideoModal): void;
|
|
4885
4942
|
updateWidgetsData(): void;
|
|
4886
4943
|
protected abstract reorderWidgetItems(): void;
|
|
@@ -5325,7 +5382,6 @@ export declare class BlazeWidgetLayout extends WidgetBaseLayout {
|
|
|
5325
5382
|
connectWidgets(): void;
|
|
5326
5383
|
get thumbnailShape(): ThumbnailShape;
|
|
5327
5384
|
widgetType(): WidgetType;
|
|
5328
|
-
setPersonalized(personalized?: BlazePersonalized): void;
|
|
5329
5385
|
private setupAccessibility;
|
|
5330
5386
|
private updateAccessibilityLabel;
|
|
5331
5387
|
onKeyDown(e: KeyboardEvent): void;
|
|
@@ -5576,6 +5632,7 @@ export declare class BlazeWidgetVideo extends BlazeWidgetVideoBase {
|
|
|
5576
5632
|
eventRenderBackgroundPercentageTriggered: Array<boolean>;
|
|
5577
5633
|
loaderTimeoutRefAppending: NodeJS.Timeout | undefined;
|
|
5578
5634
|
lastErrorExecutionTime: number;
|
|
5635
|
+
private beforeContentPlayService;
|
|
5579
5636
|
isVideoStartPlaying: boolean;
|
|
5580
5637
|
isError: boolean;
|
|
5581
5638
|
isLoaded: boolean;
|
|
@@ -5594,6 +5651,7 @@ export declare class BlazeWidgetVideo extends BlazeWidgetVideoBase {
|
|
|
5594
5651
|
connectedCallback(): void;
|
|
5595
5652
|
disconnectedCallback(): void;
|
|
5596
5653
|
private getContentType;
|
|
5654
|
+
private getOriginalVideoUrl;
|
|
5597
5655
|
setData(data: IPage): void;
|
|
5598
5656
|
getGoogleIMA(): any;
|
|
5599
5657
|
private isEnableInteractions;
|
|
@@ -5603,7 +5661,7 @@ export declare class BlazeWidgetVideo extends BlazeWidgetVideoBase {
|
|
|
5603
5661
|
display(): void;
|
|
5604
5662
|
hide(): void;
|
|
5605
5663
|
load(loadingType?: LoadingType): Promise<void>;
|
|
5606
|
-
setVideoSource
|
|
5664
|
+
private setVideoSource;
|
|
5607
5665
|
unload(): Promise<void>;
|
|
5608
5666
|
resetVideoState(): void;
|
|
5609
5667
|
removeLoader(): void;
|
|
@@ -5630,6 +5688,7 @@ export declare class BlazeWidgetVideo extends BlazeWidgetVideoBase {
|
|
|
5630
5688
|
onLanguageChange(event: Event): Promise<void>;
|
|
5631
5689
|
handleInteractionEvent(event: CustomEvent<InteractionAnalyticCustomEvent>): void;
|
|
5632
5690
|
private tryToPlayAd;
|
|
5691
|
+
private updateVideoUrlWithBeforeContentPlay;
|
|
5633
5692
|
}
|
|
5634
5693
|
|
|
5635
5694
|
export declare class BlazeWidgetAd extends BlazeWidgetVideoBase {
|
|
@@ -6215,7 +6274,6 @@ export declare class BlazeWidgetStory extends BlazeWidgetContent {
|
|
|
6215
6274
|
switchToPage(newPageIndex: number): void;
|
|
6216
6275
|
startPage(indexToPlay: number): void;
|
|
6217
6276
|
unload(): void;
|
|
6218
|
-
removeFromCache(): void;
|
|
6219
6277
|
displayCurrentStoryPageAndHideTheRest(): void;
|
|
6220
6278
|
load(loadingType?: LoadingType): void;
|
|
6221
6279
|
play(): void;
|