@wscsports/blaze-web-sdk 0.6.0 → 0.7.1

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.6.0",
3
+ "version": "0.7.1",
4
4
  "main": "publish/index",
5
5
  "types": "publish/index",
6
6
  "files": [
@@ -148,6 +148,7 @@ export declare class ReferringEventInfo {
148
148
  'story_source': string;
149
149
  }
150
150
  export declare class AnalyticsEvent {
151
+ 'sdk_event_session_counter': number;
151
152
  'sdk_event_id': string;
152
153
  'timestamp_utc': string;
153
154
  'timestamp_user_tz': string;
@@ -208,6 +209,8 @@ export declare class StoryEvent {
208
209
  'custom_action_button_name': string;
209
210
  'enrichment_layer_id': string;
210
211
  'enrichment_layer_url': string;
212
+ 'story_page_parent_id': string;
213
+ 'story_composition_type': string;
211
214
  }
212
215
  export declare class MomentEvent {
213
216
  'moments_session_id': string;
@@ -355,6 +358,7 @@ export interface BlazeDataSourceType {
355
358
  orderType?: OrderType;
356
359
  maxItems?: number;
357
360
  advancedOrdering?: AdvancedOrdering;
361
+ personalized?: BlazePersonalized;
358
362
  }
359
363
  export declare const BlazeInternalError: {
360
364
  LabelExpressionMustNotBeEmpty: string;
@@ -666,7 +670,7 @@ export declare class BlazeButton extends BaseWidget {
666
670
  isAnimationOnDesktopInitialized: boolean;
667
671
  get refElement(): ShadowRoot | this;
668
672
  constructor();
669
- static get observedAttributes(): ("height" | "order" | "width" | "icon-color" | "disabled" | "blaze-btn-visible" | "blaze-btn-hidden" | "button-desktop-animation")[];
673
+ static get observedAttributes(): ("height" | "order" | "width" | "icon-color" | "blaze-btn-visible" | "disabled" | "blaze-btn-hidden" | "button-desktop-animation")[];
670
674
  private onMouseEnter;
671
675
  private onMouseLeave;
672
676
  private onClick;
@@ -1149,6 +1153,7 @@ export interface IContentPage extends IBasePage {
1149
1153
  thumbnail: IThumbnail;
1150
1154
  baseLayer: ILayer;
1151
1155
  cta: ICta;
1156
+ parentStoryId?: string;
1152
1157
  shouldShowImaAd?: boolean;
1153
1158
  adInfo?: IAdInfo;
1154
1159
  interaction?: Interaction;
@@ -1173,6 +1178,7 @@ export interface IStory extends IContent {
1173
1178
  isLive: boolean;
1174
1179
  pages: IPage[];
1175
1180
  adInfo?: IAdInfo;
1181
+ compositionType?: string;
1176
1182
  }
1177
1183
 
1178
1184
  export interface IThumbnail {
@@ -1646,6 +1652,7 @@ export interface IWidgetView extends HTMLElement {
1646
1652
  updateOverrideStyles: (perItemStyleOverrides: PerItemStyleOverrides) => void;
1647
1653
  setId: (id: string) => void;
1648
1654
  updateDataSource: (dataSource: BlazeDataSourceType) => void;
1655
+ setPersonalized: (personalized: BlazePersonalized) => void;
1649
1656
  setLabels: (labels: string | string[] | BlazeWidgetLabel, options?: ISetWidgetOptions) => void;
1650
1657
  setLabelsPriority: (labelsPriority: string | string[] | BlazeWidgetLabel[], options?: ISetWidgetOptions) => void;
1651
1658
  setContentIds: (storyIds: string[], options?: ISetWidgetOptions) => void;
@@ -1679,6 +1686,7 @@ declare const AnalyticsServiceClass_base: {
1679
1686
  declare abstract class AnalyticsServiceClass extends AnalyticsServiceClass_base implements IService {
1680
1687
  events: AnalyticsEvent[];
1681
1688
  uaParsed?: IDevice;
1689
+ eventSessionCounter: number;
1682
1690
  init(): Promise<void>;
1683
1691
  sendAnalyticsData(): Promise<void>;
1684
1692
  bulkEvent(body: Partial<AnalyticsEvent>[]): Promise<any>;
@@ -1694,6 +1702,17 @@ declare abstract class AnalyticsServiceClass extends AnalyticsServiceClass_base
1694
1702
  }
1695
1703
  export declare const AnalyticsService: AnalyticsServiceClass;
1696
1704
 
1705
+ type GetOptions = {
1706
+ orderType?: OrderType;
1707
+ };
1708
+ type GetByLabelsOptions = GetOptions & {
1709
+ labels: string;
1710
+ maxItems?: number;
1711
+ labelsPriority?: string;
1712
+ };
1713
+ type GetByIdsOptions = GetOptions & {
1714
+ ids: string[];
1715
+ };
1697
1716
  export interface ApiResponse<T> {
1698
1717
  assetsExpiryTime: string;
1699
1718
  totalItems: number;
@@ -1712,45 +1731,41 @@ declare abstract class ApiServiceClass extends ApiServiceClass_base implements I
1712
1731
  api: API;
1713
1732
  init(): Promise<void>;
1714
1733
  private setAdsOnStories;
1715
- getStoriesByIds(options: {
1716
- storyIds: string[];
1717
- orderType?: OrderType;
1734
+ getStoriesByIds(options: GetByIdsOptions & {
1718
1735
  showLiveFirst?: boolean;
1736
+ personalized?: BlazePersonalized;
1719
1737
  }): Promise<{
1720
1738
  result: IStory[];
1721
1739
  httpStatus?: number | undefined;
1722
1740
  data?: StoriesResponse | undefined;
1723
1741
  error?: Error | undefined;
1724
1742
  }>;
1725
- getStoriesByLabels(options: {
1726
- labels: string;
1727
- orderType?: OrderType;
1728
- maxItems?: number;
1729
- labelsPriority?: string;
1743
+ getStoriesByLabels(options: GetByLabelsOptions & {
1730
1744
  showLiveFirst?: boolean;
1745
+ personalized?: BlazePersonalized;
1731
1746
  }): Promise<{
1732
1747
  result: IStory[];
1733
1748
  httpStatus?: number | undefined;
1734
1749
  data?: StoriesResponse | undefined;
1735
1750
  error?: Error | undefined;
1736
1751
  }>;
1737
- getMomentByIds(ids: string[], orderType?: OrderType): Promise<{
1752
+ getMomentByIds(options: GetByIdsOptions): Promise<{
1738
1753
  httpStatus?: number | undefined;
1739
1754
  data?: MomentsResponse | undefined;
1740
1755
  error?: Error | undefined;
1741
1756
  }>;
1742
- getMomentsByLabels(labels: string, orderType?: OrderType, maxItems?: number): Promise<import("../interfaces").IHttpResponse<MomentsResponse>>;
1757
+ getMomentsByLabels(options: GetByLabelsOptions): Promise<import("../interfaces").IHttpResponse<MomentsResponse>>;
1743
1758
  updateMomentLikeStatus(options: {
1744
1759
  momentId: string;
1745
1760
  setLiked: boolean;
1746
1761
  }): Promise<void>;
1747
1762
  getStaticStories(): Promise<IStory | null>;
1748
- getVideosByIds(ids: string[], orderType?: OrderType): Promise<{
1763
+ getVideosByIds(options: GetByIdsOptions): Promise<{
1749
1764
  httpStatus?: number | undefined;
1750
1765
  data?: VideosResponse | undefined;
1751
1766
  error?: Error | undefined;
1752
1767
  }>;
1753
- getVideosByLabels(labels: string, orderType?: OrderType, maxItems?: number, labelsPriority?: string): Promise<{
1768
+ getVideosByLabels(options: GetByLabelsOptions): Promise<{
1754
1769
  httpStatus?: number | undefined;
1755
1770
  data?: VideosResponse | undefined;
1756
1771
  error?: Error | undefined;
@@ -1759,10 +1774,6 @@ declare abstract class ApiServiceClass extends ApiServiceClass_base implements I
1759
1774
  videoId: string;
1760
1775
  setLiked: boolean;
1761
1776
  }): Promise<void>;
1762
- preview(storyId: string, publishedOnly?: boolean): Promise<import("../interfaces").IHttpResponse<IStory & {
1763
- status: number;
1764
- }>>;
1765
- preivewMoment(momentId: string, publishedOnly?: boolean): Promise<IResponse<any>>;
1766
1777
  sendAnaltyicsEvents(body: Partial<AnalyticsEvent>[]): Promise<import("../interfaces").IHttpResponse<unknown>>;
1767
1778
  sendInteractionResponse(options: {
1768
1779
  interactionId: Interaction['id'];
@@ -1772,6 +1783,9 @@ declare abstract class ApiServiceClass extends ApiServiceClass_base implements I
1772
1783
  getUserToken(body: GetUserTokenRequest): Promise<import("../interfaces").IHttpResponse<TokenData>>;
1773
1784
  refreshUserToken(body: RefreshUserTokenRequest): Promise<import("../interfaces").IHttpResponse<TokenData>>;
1774
1785
  getAppConfigurations(): Promise<import("../interfaces").IHttpResponse<AppConfiguration>>;
1786
+ private getContentDefaultParams;
1787
+ private getContentParamsByLabels;
1788
+ private getContentParamsByIds;
1775
1789
  }
1776
1790
  export declare const ApiService: ApiServiceClass;
1777
1791
 
@@ -3064,7 +3078,7 @@ export type ComponentsElementType = 'blaze-alert' | 'blaze-chip' | 'blaze-image'
3064
3078
  export type WidgetElementType = 'blaze-sdk';
3065
3079
  export type ElementType = WidgetElementType | ComponentsElementType;
3066
3080
 
3067
- export type EnvironmentType = 'prod' | 'uat';
3081
+ export type EnvironmentType = 'prod' | 'uat' | 'local';
3068
3082
 
3069
3083
  export type StoryGestureType = 'Swipe Up' | 'CTA Click';
3070
3084
  export type MomentGestureType = 'CTA Click';
@@ -3085,6 +3099,7 @@ export * from './item.type';
3085
3099
  export * from './label.type';
3086
3100
  export * from './locale.type';
3087
3101
  export * from './order.type';
3102
+ export * from './personalized.type';
3088
3103
  export * from './platform.type';
3089
3104
  export * from './play.type';
3090
3105
  export * from './player-layout.type';
@@ -3121,6 +3136,18 @@ export type LocaleDirectionType = 'LTR' | 'RTL';
3121
3136
  export type OrderType = 'Manual' | 'AtoZ' | 'ZtoA' | 'RecentlyUpdatedFirst' | 'RecentlyUpdatedLast' | 'RecentlyCreatedFirst' | 'RecentlyCreatedLast';
3122
3137
  export type ContentOrderType = 'LIVE_CHIP' | 'STORY_TITLE' | 'PUBLISHED_DATE';
3123
3138
 
3139
+ type BlazePersonalizedIds = {
3140
+ type: 'ids';
3141
+ teams?: Array<string>;
3142
+ players?: Array<string>;
3143
+ };
3144
+ type BlazePersonalizedLabels = {
3145
+ type: 'labels';
3146
+ labelsFilterExpression: string | string[] | BlazeWidgetLabel;
3147
+ labelsPriority: string | string[] | BlazeWidgetLabel[];
3148
+ };
3149
+ export type BlazePersonalized = BlazePersonalizedIds | BlazePersonalizedLabels;
3150
+
3124
3151
  export type Platform = 'mobile' | 'tablet' | 'desktop';
3125
3152
 
3126
3153
  export declare const PlayTypeArray: readonly ["Widget", "Share", "SingleContent", "AutoAdvance"];
@@ -3244,11 +3271,29 @@ export * from './common.utils';
3244
3271
  export * from './country-location.utils';
3245
3272
  export * from './guard.utils';
3246
3273
  export * from './helper';
3274
+ export * from './personalized.utils';
3247
3275
  export * from './regex.utils';
3248
3276
  export * from './stopwatch';
3249
3277
  export * from './position.utils';
3250
3278
  export * from './ad-info.utils';
3251
3279
 
3280
+ export declare function getPersonalizedParamsForRequest(personalized?: BlazePersonalized): {
3281
+ PersonalPlayers?: undefined;
3282
+ PersonalTeams?: undefined;
3283
+ PersonalLabelFilterExpression?: undefined;
3284
+ PersonalLabelPriority?: undefined;
3285
+ } | {
3286
+ PersonalPlayers: string[] | undefined;
3287
+ PersonalTeams: string[] | undefined;
3288
+ PersonalLabelFilterExpression?: undefined;
3289
+ PersonalLabelPriority?: undefined;
3290
+ } | {
3291
+ PersonalLabelFilterExpression: string | string[] | import("../classes").BlazeWidgetLabel;
3292
+ PersonalLabelPriority: string | string[] | import("../classes").BlazeWidgetLabel[];
3293
+ PersonalPlayers?: undefined;
3294
+ PersonalTeams?: undefined;
3295
+ };
3296
+
3252
3297
  export declare function calculatePosition(statusIndicatorPosition: PositionType): {
3253
3298
  isOutside: boolean;
3254
3299
  isInside: boolean;
@@ -4052,6 +4097,7 @@ export declare class BlazeWidgetEmbeddedStory extends BaseWidget implements IWid
4052
4097
  bindedOnPlayerDismissed: (e: Event) => void;
4053
4098
  private get theme();
4054
4099
  constructor();
4100
+ setPersonalized(personalized: BlazePersonalized): void;
4055
4101
  static get observedAttributes(): string[];
4056
4102
  connectedCallback(): void;
4057
4103
  disconnectedCallback(): void;
@@ -4204,6 +4250,7 @@ export declare class BlazeWidgetLayout extends BlazeWidgetScrollable implements
4204
4250
  onResizeEvent: (this: Window, ev: UIEvent) => void;
4205
4251
  shouldReloadWhenPlayerIsClosed: boolean;
4206
4252
  shouldReloadData: boolean;
4253
+ private personalized?;
4207
4254
  get refElement(): ShadowRoot | BlazeWidgetLayout;
4208
4255
  constructor();
4209
4256
  connectedCallback(): void;
@@ -4298,6 +4345,7 @@ export declare class BlazeWidgetLayout extends BlazeWidgetScrollable implements
4298
4345
  connectWidgets(): void;
4299
4346
  get thumbnailShape(): ThumbnailShape;
4300
4347
  widgetType(): WidgetType;
4348
+ setPersonalized(personalized?: BlazePersonalized): void;
4301
4349
  }
4302
4350
 
4303
4351
  export declare class BlazeWidgetModal extends BaseWidget {