@tivio/sdk-react 9.2.0-alpha.2 → 9.2.0-alpha.4

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.
@@ -659,6 +659,17 @@ export declare interface ButtonOptions {
659
659
  color?: string;
660
660
  padding?: string;
661
661
  maxWidth?: string;
662
+ primary?: ButtonVariantOptions;
663
+ secondary?: ButtonVariantOptions;
664
+ transparent?: ButtonVariantOptions;
665
+ disabled?: ButtonVariantOptions;
666
+ }
667
+
668
+ /**
669
+ * @internal
670
+ */
671
+ export declare interface ButtonVariantOptions {
672
+ border?: string;
662
673
  }
663
674
 
664
675
  /**
@@ -1080,10 +1091,12 @@ export declare interface CreateUserPayload {
1080
1091
  isAnonymous?: boolean;
1081
1092
  }
1082
1093
 
1094
+ export declare type CreateUserProfileRequest = Omit<UserProfile, 'id'>;
1095
+
1083
1096
  /**
1084
1097
  * @public
1085
1098
  */
1086
- export declare type CreateUserWithEmailAndPassword = (email: string, password: string, username?: string, phoneNumber?: string, referralToken?: string) => Promise<string | null>;
1099
+ export declare type CreateUserWithEmailAndPassword = (email: string, password: string, username: string, phoneNumber?: string, referralToken?: string) => Promise<string | null>;
1087
1100
 
1088
1101
  export declare interface CreatorsWithVoucherSubscriptions {
1089
1102
  id: string;
@@ -1249,6 +1262,7 @@ export declare interface Customizations {
1249
1262
  playVideoButton?: {
1250
1263
  backgroundColor?: string;
1251
1264
  color?: string;
1265
+ border?: string;
1252
1266
  };
1253
1267
  logo?: {
1254
1268
  height: string;
@@ -1289,6 +1303,7 @@ export declare interface Customizations {
1289
1303
  CenteredMenu?: {
1290
1304
  backgroundColor: string;
1291
1305
  menuLinkColor: string;
1306
+ border?: string;
1292
1307
  };
1293
1308
  Footer: {
1294
1309
  backgroundColor: string;
@@ -1392,6 +1407,12 @@ export declare interface Customizations {
1392
1407
  background: string;
1393
1408
  backgroundMobile: string;
1394
1409
  };
1410
+ Feed?: {
1411
+ backgroundColor?: string;
1412
+ Description?: {
1413
+ color?: string;
1414
+ };
1415
+ };
1395
1416
  }
1396
1417
 
1397
1418
  export declare interface CustomScript {
@@ -1924,6 +1945,10 @@ export declare interface GetSourceUrlRequest {
1924
1945
  * Start time in ms, for live streams. Will return manifest with desired start.
1925
1946
  */
1926
1947
  startTimeMs?: number;
1948
+ /**
1949
+ * Parameters related to ads.
1950
+ */
1951
+ adParams?: Record<string, string | number | undefined>;
1927
1952
  }
1928
1953
 
1929
1954
  export declare interface GetSourceUrlResponse {
@@ -5836,20 +5861,27 @@ export declare type TivioAnalytics = {
5836
5861
  */
5837
5862
  export declare interface TivioAuth {
5838
5863
  /**
5864
+ * Create and sign up new user with given email and password.
5839
5865
  * @param email
5840
5866
  * @param password
5867
+ * @returns {string} - uid of newly created and signed-up user
5841
5868
  */
5842
5869
  createUserWithEmailAndPassword: CreateUserWithEmailAndPassword;
5843
5870
  /**
5844
- * Sign in the user and starts listening on his purchases
5871
+ * Sign in the user with given email and password and start listening on their purchases.
5845
5872
  * @param email
5846
5873
  * @param password
5874
+ * @returns {string} - uid of signed-in user.
5847
5875
  */
5848
5876
  signInWithEmailAndPassword: (email: string, password: string) => Promise<string | null>;
5849
5877
  signInWithCustomToken: (token: string) => Promise<string | null>;
5878
+ /**
5879
+ * Signs out currently signed-in user.
5880
+ */
5850
5881
  signOut: () => Promise<void>;
5851
5882
  /**
5852
- * Used for reset forgotten password by user
5883
+ * Resets password for given user email.
5884
+ * @param email
5853
5885
  */
5854
5886
  resetPassword: (email: string) => Promise<void>;
5855
5887
  }
@@ -5992,13 +6024,13 @@ export declare type TivioGetters = {
5992
6024
  /**
5993
6025
  * Get video by its id.
5994
6026
  * @param videoId - video id
5995
- * @returns {Promise<Video | null>} video or null if video does not exists
6027
+ * @returns {Promise<Video | null>} video or null if video does not exist
5996
6028
  */
5997
6029
  getVideoById: (videoId: string) => Promise<Video | null>;
5998
6030
  /**
5999
6031
  * Get screen by its id.
6000
6032
  * @param screenId - screen id
6001
- * @returns {Promise<Screen | null>} screen or null if screen does not exists
6033
+ * @returns {Promise<Screen | null>} screen or null if screen does not exist
6002
6034
  */
6003
6035
  getScreenById: (screenId: string, cb?: (error: Error | null, data: Screen_2 | null, disposer?: Disposer_2) => void) => Promise<Screen_2 | null>;
6004
6036
  /**
@@ -6006,6 +6038,11 @@ export declare type TivioGetters = {
6006
6038
  * @returns PlayerCapability[]
6007
6039
  */
6008
6040
  getPlayerCapabilities: () => PlayerCapability[];
6041
+ /**
6042
+ * Get currently logged-in user. If no user is logged in, returns `null`.
6043
+ * @returns User
6044
+ */
6045
+ getUser: () => User | null;
6009
6046
  };
6010
6047
 
6011
6048
  /**
@@ -6209,7 +6246,7 @@ export declare type TivioJsBundleExposedApi = {
6209
6246
  getTagById: (tagId: string) => Promise<Tag | null>;
6210
6247
  createPlayerWrapper: (playerImplementation: PlayerInterfaceForPlayerWrapper) => TivioPlayerWrapper;
6211
6248
  destroy: () => Promise<void>;
6212
- } & Pick<TivioGetters, 'getVideoById' | 'getScreenById' | 'organization'> & Pick<TivioSubscriptions, 'subscribeToVideo' | 'subscribeToItemsInRow' | 'subscribeToRowsInScreen'> & Pick<TivioAuth, 'createUserWithEmailAndPassword' | 'signInWithEmailAndPassword'> & Pick<TivioSetters, 'setBundleVersion' | 'setUser' | 'setLanguage' | 'setStorageManager'>;
6249
+ } & Pick<TivioGetters, 'getVideoById' | 'getScreenById' | 'organization' | 'getUser'> & Pick<TivioSubscriptions, 'subscribeToVideo' | 'subscribeToItemsInRow' | 'subscribeToRowsInScreen'> & Pick<TivioAuth, 'createUserWithEmailAndPassword' | 'signInWithEmailAndPassword' | 'resetPassword' | 'signOut'> & Pick<TivioSetters, 'setBundleVersion' | 'setUser' | 'setLanguage' | 'setStorageManager'>;
6213
6250
 
6214
6251
  /**
6215
6252
  * @public
@@ -6851,18 +6888,45 @@ export declare type User = {
6851
6888
  isPurchasesInitialized: boolean;
6852
6889
  isSignedIn: boolean;
6853
6890
  isReady: boolean;
6891
+ /**
6892
+ * Email of this user.
6893
+ */
6854
6894
  email?: string;
6855
6895
  type?: UserType;
6856
6896
  photoURL: string | null;
6897
+ /**
6898
+ * Name of this user - typically first and last name combined, or any other nickname chosen by user.
6899
+ */
6857
6900
  name?: string;
6858
6901
  /**
6859
6902
  * Authentication id differs from {@link id}.
6860
6903
  */
6861
6904
  authUserId?: string;
6905
+ /**
6906
+ * List of content (e.g. videos / series) that user marked as their favorite.
6907
+ * Changes based on currently {@link activeUserProfileId}
6908
+ */
6862
6909
  favorites: any[];
6910
+ /**
6911
+ * List of content (e.g. videos / series) that user watched recently with precise time position where they last left watching.
6912
+ * Number of entries in the list is limited by constant number (i.e. older entries are deleted when limit is reached).
6913
+ * In some cases entries are actively removed even if they are new, for example when user watched video to the end.
6914
+ * Changes based on currently {@link activeUserProfileId}.
6915
+ */
6863
6916
  watchedPositions: any[];
6917
+ /**
6918
+ * Similar to {@link watchedPositions}, but has higher limit for number of entries,
6919
+ * and they never actively deleted (e.g. when user watched video to the end)
6920
+ * Changes based on currently {@link activeUserProfileId}.
6921
+ */
6864
6922
  watchHistory: any[];
6865
- profiles: any[];
6923
+ /**
6924
+ * List of profiles for this user.
6925
+ */
6926
+ profiles: UserProfile[];
6927
+ /**
6928
+ * Currently active user profile id.
6929
+ */
6866
6930
  activeUserProfileId: string | null;
6867
6931
  patreon?: PatreonUserAuth;
6868
6932
  subscriptionIdsToShow: string[] | null;
@@ -6870,9 +6934,22 @@ export declare type User = {
6870
6934
  isAnonymous: boolean;
6871
6935
  isDiscordConnected: boolean;
6872
6936
  disconnectDiscord: () => Promise<void>;
6873
- createUserProfile: (request: any) => Promise<void>;
6937
+ /**
6938
+ * Create new profile for this user.
6939
+ * @param request
6940
+ */
6941
+ createUserProfile: (request: CreateUserProfileRequest) => Promise<void>;
6942
+ /**
6943
+ * Delete given profile from this user.
6944
+ * @param profileId
6945
+ */
6874
6946
  deleteUserProfile: (profileId: string) => Promise<void>;
6875
- setActiveUserProfileId: (id: string) => void;
6947
+ /**
6948
+ * Activate given profile for this user.
6949
+ * After activation {@link favorites}, {@link watchedPositions} and {@link watchHistory} of given profile will be used.
6950
+ * @param profileId
6951
+ */
6952
+ setActiveUserProfileId: (profileId: string) => void;
6876
6953
  getFollowedOrganizations: () => Promise<Array<FollowedOrganizationData | undefined>>;
6877
6954
  sendFinalizeRegistrationEmail: (email: string) => Promise<void>;
6878
6955
  isUserAlreadyRegisteredByTenant: (email: string) => Promise<boolean>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tivio/sdk-react",
3
- "version": "9.2.0-alpha.2",
3
+ "version": "9.2.0-alpha.4",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
6
6
  "source": "src/index.ts",
@@ -38,7 +38,7 @@
38
38
  "@material-ui/core": "^4.11.2",
39
39
  "@material-ui/icons": "^4.11.2",
40
40
  "@sentry/browser": "^6.1.0",
41
- "@tivio/common": "1.1.129",
41
+ "@tivio/common": "1.1.130",
42
42
  "dayjs": "^1.11.0",
43
43
  "es7-object-polyfill": "^1.0.1",
44
44
  "firebase": "8.10.1",