@jolibox/implement 1.1.14-beta.2 → 1.1.15

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.
@@ -1,9 +1,9 @@
1
1
  Invoking: npm run clean && npm run build:esm && tsc
2
2
 
3
- > @jolibox/implement@1.1.14-beta.2 clean
3
+ > @jolibox/implement@1.1.15 clean
4
4
  > rimraf ./dist
5
5
 
6
6
 
7
- > @jolibox/implement@1.1.14-beta.2 build:esm
7
+ > @jolibox/implement@1.1.15 build:esm
8
8
  > BUILD_VERSION=$(node -p "require('./package.json').version") node esbuild.config.js --format=esm
9
9
 
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@jolibox/implement",
3
3
  "description": "This project is Jolibox JS-SDk implement for Native && H5",
4
- "version": "1.1.14-beta.2",
4
+ "version": "1.1.15",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
7
7
  "license": "MIT",
8
8
  "dependencies": {
9
- "@jolibox/common": "1.1.14-beta.2",
10
- "@jolibox/types": "1.1.14-beta.2",
11
- "@jolibox/native-bridge": "1.1.14-beta.2",
9
+ "@jolibox/common": "1.1.15",
10
+ "@jolibox/types": "1.1.15",
11
+ "@jolibox/native-bridge": "1.1.15",
12
12
  "localforage": "1.10.0",
13
13
  "@jolibox/ui": "1.0.0",
14
14
  "web-vitals": "4.2.4"
@@ -1,9 +1,9 @@
1
1
  import { IHttpClient } from '@/common/http';
2
2
  import { context } from '@/common/context';
3
3
  import { uuidv4 } from '@jolibox/common';
4
- import { canUseJolicoin } from './utils';
5
4
  import { unlockOptionsEmitter, UnlockOptionsEventName, IUnlockOptionsEvent } from '..';
6
5
  import { IAdBreakParams } from '@/common/ads';
6
+ import { canUseJolicoin } from './utils';
7
7
 
8
8
  interface IJolicoinUnlockRes {
9
9
  code: 'SUCCESS' | 'BALANCE_NOT_ENOUGH' | 'EPISODE_LOCK_JUMP' | 'EPISODE_UNLOCK_ALREADY';
@@ -44,20 +44,9 @@ const closePageSync = createSyncAPI('closePageSync', {
44
44
  }
45
45
  });
46
46
 
47
- const openSystemBrowserSync = createSyncAPI('openSystemBrowserSync', {
48
- paramsSchema: t.tuple(t.string()),
49
- implement: (url) => {
50
- const { errNo, errMsg } = invokeNative('openSystemBrowserSync', { url });
51
- if (errNo !== 0) {
52
- throw new UserCustomError(errMsg, errNo);
53
- }
54
- }
55
- });
56
-
57
47
  commands.registerCommand('RouterSDK.openSchema', openSchemaSync);
58
48
  commands.registerCommand('RouterSDK.openPage', openPageSync);
59
49
  commands.registerCommand('RouterSDK.closePage', closePageSync);
60
- commands.registerCommand('RouterSDK.openSystemBrowser', openSystemBrowserSync);
61
50
 
62
51
  registerCanIUse('router.openSchema', {
63
52
  version: '1.1.10'
@@ -70,7 +59,3 @@ registerCanIUse('router.openPage', {
70
59
  registerCanIUse('router.closePage', {
71
60
  version: '1.1.10'
72
61
  });
73
-
74
- registerCanIUse('router.openSystemBrowser', {
75
- version: '1.1.13'
76
- });
@@ -50,11 +50,10 @@ const openGameSchema = (game: IGame) => {
50
50
  // Parse the original URL to preserve its structure
51
51
 
52
52
  const url = new URL(data.schema);
53
- const originalPath = url.pathname;
54
53
  const originalSearch = new URLSearchParams(url.search);
55
54
 
56
55
  // Set or replace gameId and joliSource parameters
57
- originalSearch.set('gameId', context.mpId);
56
+ originalSearch.set('gameId', game.gameId);
58
57
  originalSearch.set(
59
58
  'joliSource',
60
59
  context.encodeJoliSourceQuery({
@@ -65,7 +64,7 @@ const openGameSchema = (game: IGame) => {
65
64
 
66
65
  const host = `https://${game.gameId}.content.jolibox.com/`;
67
66
  // Construct the final schema URL
68
- const schema = `${host}${originalPath}?${originalSearch.toString()}`;
67
+ const schema = `${host}index.html?${originalSearch.toString()}`;
69
68
 
70
69
  invokeNative('openSchemaSync', {
71
70
  schema