Skip to content

Commit

Permalink
Merge branch 'release-candidate' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonLantukh committed Jul 25, 2024
2 parents fea9182 + 4255acc commit a5b699f
Show file tree
Hide file tree
Showing 95 changed files with 1,667 additions and 2,913 deletions.
1 change: 1 addition & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ module.exports = {
'tests',
'i18n',
'a11y',
'integrations',
],
],
},
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
## [6.5.0](https://github.com/jwplayer/ott-web-app/compare/v6.4.0...v6.5.0) (2024-07-25)


### Features

* add backClick event support for player ([f29f6dc](https://github.com/jwplayer/ott-web-app/commit/f29f6dcd244f95568b5b2ba1437bc7e39dd0febc))
* add ellipsis to card title ([ab6b2a8](https://github.com/jwplayer/ott-web-app/commit/ab6b2a83d947b163c5a10d8a1701823ee2fcd266))
* implement tile-slider dependency ([d58f1cb](https://github.com/jwplayer/ott-web-app/commit/d58f1cb73696c8f2f64b4bb8d9fcdeec8ffc34b8))
* **integrations:** replace InPlayer SDK with direct API calls to JwPlayer SIMS domain ([#578](https://github.com/jwplayer/ott-web-app/issues/578)) ([0a87a46](https://github.com/jwplayer/ott-web-app/commit/0a87a46af6f0ec4a0e77006ef1fba7b98bcc5cbd))
* **menu:** support more items in header navigation ([15bbce0](https://github.com/jwplayer/ott-web-app/commit/15bbce0fcc1ffdaf8adb8539150701a43f3cb1d9))
* **profiles:** remove all remaining dead code assotiated with profiles ([892f41b](https://github.com/jwplayer/ott-web-app/commit/892f41b5d73f7aaccd2ded141407f35209ed7926))
* **project:** add cancel functions for debounce and throttle utils ([3fd9add](https://github.com/jwplayer/ott-web-app/commit/3fd9add7ec93563fc4ac778090c326263dfde244))
* **project:** add ssai ads for vod ([#583](https://github.com/jwplayer/ott-web-app/issues/583)) ([d3a4750](https://github.com/jwplayer/ott-web-app/commit/d3a4750af29c2cc460e390120ca457620d43bfdb))


### Bug Fixes

* **videodetail:** buttons wrapping ([4b6f524](https://github.com/jwplayer/ott-web-app/commit/4b6f52412c9fff5aa9a1ac997f62b97b95ecf7bc))
* wait for geo status and cache it's value ([6e4d263](https://github.com/jwplayer/ott-web-app/commit/6e4d2634d8a78e731ea39a9689720db8e8be38ef))

## [6.4.0](https://github.com/jwplayer/ott-web-app/compare/v6.3.0...v6.4.0) (2024-07-04)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jwp/ott",
"version": "6.4.0",
"version": "6.5.0",
"private": true,
"license": "Apache-2.0",
"repository": "https://github.com/jwplayer/ott-web-app.git",
Expand Down
2 changes: 1 addition & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"test-watch": "TZ=UTC LC_ALL=en_US.UTF-8 vitest"
},
"dependencies": {
"@inplayer-org/inplayer.js": "^3.13.25",
"@inplayer-org/inplayer.js": "^3.13.28",
"broadcast-channel": "^7.0.0",
"date-fns": "^2.30.0",
"fast-xml-parser": "^4.4.0",
Expand Down
13 changes: 0 additions & 13 deletions packages/common/src/controllers/AccountController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,17 @@ import { INTEGRATION_TYPE } from '../modules/types';
import type { ServiceResponse } from '../../types/service';
import { useAccountStore } from '../stores/AccountStore';
import { useConfigStore } from '../stores/ConfigStore';
import { useProfileStore } from '../stores/ProfileStore';
import { FormValidationError } from '../errors/FormValidationError';
import { logError } from '../logger';

import WatchHistoryController from './WatchHistoryController';
import ProfileController from './ProfileController';
import FavoritesController from './FavoritesController';

@injectable()
export default class AccountController {
private readonly checkoutService: CheckoutService;
private readonly accountService: AccountService;
private readonly subscriptionService: SubscriptionService;
private readonly profileController: ProfileController;
private readonly favoritesController: FavoritesController;
private readonly watchHistoryController: WatchHistoryController;
private readonly features: AccountServiceFeatures;
Expand All @@ -46,7 +43,6 @@ export default class AccountController {
@inject(INTEGRATION_TYPE) integrationType: IntegrationType,
favoritesController: FavoritesController,
watchHistoryController: WatchHistoryController,
profileController: ProfileController,
) {
this.checkoutService = getNamedModule(CheckoutService, integrationType);
this.accountService = getNamedModule(AccountService, integrationType);
Expand All @@ -55,7 +51,6 @@ export default class AccountController {
// @TODO: Controllers shouldn't be depending on other controllers, but we've agreed to keep this as is for now
this.favoritesController = favoritesController;
this.watchHistoryController = watchHistoryController;
this.profileController = profileController;

this.features = integrationType ? this.accountService.features : DEFAULT_FEATURES;
}
Expand Down Expand Up @@ -84,7 +79,6 @@ export default class AccountController {
useAccountStore.setState({ loading: true });
const config = useConfigStore.getState().config;

await this.profileController?.loadPersistedProfile();
await this.accountService.initialize(config, url, this.logout);

// set the accessModel before restoring the user session
Expand Down Expand Up @@ -553,13 +547,6 @@ export default class AccountController {
loading: false,
});

useProfileStore.setState({
profile: null,
selectingProfileAvatar: null,
});

this.profileController.unpersistProfile();

await this.favoritesController.restoreFavorites();
await this.watchHistoryController.restoreWatchHistory();
};
Expand Down
118 changes: 0 additions & 118 deletions packages/common/src/controllers/ProfileController.ts

This file was deleted.

9 changes: 3 additions & 6 deletions packages/common/src/modules/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import SettingsService from '../services/SettingsService';
import WatchHistoryController from '../controllers/WatchHistoryController';
import CheckoutController from '../controllers/CheckoutController';
import AccountController from '../controllers/AccountController';
import ProfileController from '../controllers/ProfileController';
import FavoritesController from '../controllers/FavoritesController';
import AppController from '../controllers/AppController';
import EpgController from '../controllers/EpgController';
Expand All @@ -30,19 +29,18 @@ import JWEpgService from '../services/epg/JWEpgService';
import AccountService from '../services/integrations/AccountService';
import CheckoutService from '../services/integrations/CheckoutService';
import SubscriptionService from '../services/integrations/SubscriptionService';
import ProfileService from '../services/integrations/ProfileService';

// Cleeng integration
import CleengService from '../services/integrations/cleeng/CleengService';
import CleengAccountService from '../services/integrations/cleeng/CleengAccountService';
import CleengCheckoutService from '../services/integrations/cleeng/CleengCheckoutService';
import CleengSubscriptionService from '../services/integrations/cleeng/CleengSubscriptionService';

// InPlayer integration
// JWP integration
import JWPAPIService from '../services/integrations/jwp/JWPAPIService';
import JWPAccountService from '../services/integrations/jwp/JWPAccountService';
import JWPCheckoutService from '../services/integrations/jwp/JWPCheckoutService';
import JWPSubscriptionService from '../services/integrations/jwp/JWPSubscriptionService';
import JWPProfileService from '../services/integrations/jwp/JWPProfileService';
import { getIntegrationType } from './functions/getIntegrationType';
import { isCleengIntegrationType, isJwpIntegrationType } from './functions/calculateIntegrationType';

Expand All @@ -63,7 +61,6 @@ container.bind(EpgController).toSelf();
// Integration controllers
container.bind(AccountController).toSelf();
container.bind(CheckoutController).toSelf();
container.bind(ProfileController).toSelf();

// EPG services
container.bind(EpgService).to(JWEpgService).whenTargetNamed(EPG_TYPE.jwp);
Expand All @@ -81,8 +78,8 @@ container.bind(SubscriptionService).to(CleengSubscriptionService).whenTargetName

// JWP integration
container.bind(DETERMINE_INTEGRATION_TYPE).toConstantValue(isJwpIntegrationType);
container.bind(JWPAPIService).toSelf();
container.bind(JWPEntitlementService).toSelf();
container.bind(AccountService).to(JWPAccountService).whenTargetNamed(INTEGRATION.JWP);
container.bind(CheckoutService).to(JWPCheckoutService).whenTargetNamed(INTEGRATION.JWP);
container.bind(SubscriptionService).to(JWPSubscriptionService).whenTargetNamed(INTEGRATION.JWP);
container.bind(ProfileService).to(JWPProfileService).whenTargetNamed(INTEGRATION.JWP);
7 changes: 0 additions & 7 deletions packages/common/src/paths.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,9 @@ export const PATH_USER_BASE = '/u';
export const PATH_USER = `${PATH_USER_BASE}/*`;

export const RELATIVE_PATH_USER_ACCOUNT = 'my-account';
export const RELATIVE_PATH_USER_MY_PROFILE = 'my-profile/:id';
export const RELATIVE_PATH_USER_FAVORITES = 'favorites';
export const RELATIVE_PATH_USER_PAYMENTS = 'payments';
export const RELATIVE_PATH_USER_PROFILES = 'profiles';

export const PATH_USER_ACCOUNT = `${PATH_USER_BASE}/${RELATIVE_PATH_USER_ACCOUNT}`;
export const PATH_USER_MY_PROFILE = `${PATH_USER_BASE}/${RELATIVE_PATH_USER_MY_PROFILE}`;
export const PATH_USER_FAVORITES = `${PATH_USER_BASE}/${RELATIVE_PATH_USER_FAVORITES}`;
export const PATH_USER_PAYMENTS = `${PATH_USER_BASE}/${RELATIVE_PATH_USER_PAYMENTS}`;
export const PATH_USER_PROFILES = `${PATH_USER_BASE}/${RELATIVE_PATH_USER_PROFILES}`;
export const PATH_USER_PROFILES_CREATE = `${PATH_USER_BASE}/${RELATIVE_PATH_USER_PROFILES}/create`;
export const PATH_USER_PROFILES_EDIT = `${PATH_USER_BASE}/${RELATIVE_PATH_USER_PROFILES}/edit`;
export const PATH_USER_PROFILES_EDIT_PROFILE = `${PATH_USER_BASE}/${RELATIVE_PATH_USER_PROFILES}/edit/:id`;
24 changes: 21 additions & 3 deletions packages/common/src/services/JWPEntitlementService.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
import InPlayer from '@inplayer-org/inplayer.js';
import { injectable } from 'inversify';
import { inject, injectable } from 'inversify';

import type { SignedMediaResponse } from './integrations/jwp/types';
import JWPAPIService from './integrations/jwp/JWPAPIService';

@injectable()
export default class JWPEntitlementService {
private readonly apiService;

constructor(@inject(JWPAPIService) apiService: JWPAPIService) {
this.apiService = apiService;
}

getJWPMediaToken = async (configId: string = '', mediaId: string) => {
try {
const { data } = await InPlayer.Asset.getSignedMediaToken(configId, mediaId);
const data = await this.apiService.get<SignedMediaResponse>(
'v2/items/jw-media/token',
{
withAuthentication: true,
},
{
app_config_id: configId,
media_id: mediaId,
},
);

return data.token;
} catch {
throw new Error('Unauthorized');
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/services/StorageService.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default abstract class StorageService {
abstract initialize(prefix: string): void;

abstract getItem<T>(key: string, parse: boolean): Promise<T | null>;
abstract getItem<T>(key: string, parse: boolean, usePrefix?: boolean): Promise<T | null>;

abstract setItem(key: string, value: string, usePrefix?: boolean): Promise<void>;

Expand Down
15 changes: 0 additions & 15 deletions packages/common/src/services/integrations/ProfileService.ts

This file was deleted.

Loading

0 comments on commit a5b699f

Please sign in to comment.