@jolibox/types 1.2.3 → 1.2.5-beta.3

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.
@@ -10,6 +10,7 @@ import { KeyboardCommandParams } from './native/keyboard';
10
10
  import { LoginCommandParams } from './native/login';
11
11
  import { RouterCommandParams } from './native/navigate';
12
12
  import { RewardsCommandParams } from './rewards';
13
+ import { PaymentCommandParams } from './native/payment';
13
14
  export * from './runtime';
14
15
  export * from './report';
15
16
  export * from './api';
@@ -23,5 +24,6 @@ export * from './native/keyboard';
23
24
  export * from './native/login';
24
25
  export * from './native/navigate';
25
26
  export * from './rewards';
26
- export type CommandParamsMap = RumtimeCommandParams & ReportCommandParams & APICommandParams & AdsCommandParams & LifeCycleCommandParams & HttpCommandParams & StorageCommandParams & KeyboardCommandParams & TaskTrackCommandParams & LoginCommandParams & RouterCommandParams & RewardsCommandParams;
27
+ export * from './native/payment';
28
+ export type CommandParamsMap = RumtimeCommandParams & ReportCommandParams & APICommandParams & AdsCommandParams & LifeCycleCommandParams & HttpCommandParams & StorageCommandParams & KeyboardCommandParams & TaskTrackCommandParams & LoginCommandParams & RouterCommandParams & RewardsCommandParams & PaymentCommandParams;
27
29
  export type CommandType = keyof CommandParamsMap;
@@ -0,0 +1,20 @@
1
+ import { StandardResponse } from '../response';
2
+ export declare const PURCHASE_GEM_IN_APP = "PaymentSDK.purchaseGem";
3
+ export declare const GET_GEM_PRODUCT_INFO = "PaymentSDK.getGemProducts";
4
+ export interface IGemProductInfo {
5
+ productId: string;
6
+ totalAmountStr: string;
7
+ quantity: number;
8
+ appStoreProductId?: string;
9
+ }
10
+ export interface PaymentCommandParams {
11
+ [PURCHASE_GEM_IN_APP]: (params: {
12
+ productId: string;
13
+ }) => Promise<StandardResponse<{
14
+ totalAmount: string;
15
+ } | void, unknown>>;
16
+ [GET_GEM_PRODUCT_INFO]: () => Promise<StandardResponse<{
17
+ products: IGemProductInfo[];
18
+ } | void, unknown>>;
19
+ }
20
+ export type PaymentCommandType = keyof PaymentCommandParams;
@@ -1,4 +1,4 @@
1
- export type TrackEvent = 'jsSdkBegin' | 'onBeforeExit' | 'bootstrapModuleBeginToLoad' | 'bootstrapModuleLoaded' | 'implModuleBeginToLoad' | 'implModuleLoaded' | 'onDocumentReady' | 'joliboxServiceReady' | 'apiInvoked' | 'joliboxSpeedAnalysis' | 'joliboxNetRequestResult' | 'globalJsError' | 'RecommendedGuide' | 'GameItem' | 'loadFinished' | 'unlock_popup_show' | 'coinorder_show' | 'coinorder_click' | 'ad_unlock_click' | 'coin_unlock_click' | 'order_pay_ensure' | 'order_pay_result' | 'mmp_ad_impression' | 'LoginGuideModal' | 'gem_unlock_popup_show' | 'gem_unlock_click' | 'gem_ad_unlock_click' | 'gem_order_show' | 'gem_order_click' | 'gem_pay_ensure' | 'gem_pay_result' | 'gem_ad_unlock_click' | 'GemLoginGuideModal' | 'jolicoin_unlock_success' | 'gem_unlock_success' | 'CallRuntimeLoadFinished' | 'AdBreakJumpOut' | 'AdBreakHide' | 'CallAdsInit' | 'LoadAdsenseCompleted' | 'CallAdConfig' | 'PreventAdsCheating' | 'CallShowAdFn' | 'CallAdBreak' | 'CallAdUnit' | 'CallAdBreakDone' | 'CallBeforeAd' | 'CallAfterAd' | 'CallAdBreakTimeout' | 'CallAFVRequest' | 'CallAFVLoad' | 'CallAFVPlaying' | 'CallAFVCompleted' | 'CallAFVError' | 'AdSenseUnitStatusChanged' | 'OpenGame' | 'OpenGame_2Plus' | 'PlayGame' | 'CloseGame' | 'LevelFinished' | 'LevelUpgrade' | 'GamePlayEnded' | 'GameFCP' | 'GameLCP' | 'GameTTFB';
1
+ export type TrackEvent = 'jsSdkBegin' | 'onBeforeExit' | 'bootstrapModuleBeginToLoad' | 'bootstrapModuleLoaded' | 'implModuleBeginToLoad' | 'implModuleLoaded' | 'onDocumentReady' | 'joliboxServiceReady' | 'apiInvoked' | 'joliboxSpeedAnalysis' | 'joliboxNetRequestResult' | 'globalJsError' | 'RecommendedGuide' | 'GameItem' | 'loadFinished' | 'unlock_popup_show' | 'coinorder_show' | 'coinorder_click' | 'ad_unlock_click' | 'coin_unlock_click' | 'order_pay_ensure' | 'order_pay_result' | 'mmp_ad_impression' | 'LoginGuideModal' | 'gem_unlock_popup_show' | 'gem_unlock_click' | 'gem_ad_unlock_click' | 'gem_order_show' | 'gem_order_click' | 'gem_pay_ensure' | 'gem_pay_result' | 'gem_ad_unlock_click' | 'GemLoginGuideModal' | 'jolicoin_unlock_success' | 'gem_unlock_success' | 'subscription_unlock_success' | 'CallRuntimeLoadFinished' | 'AdBreakJumpOut' | 'AdBreakHide' | 'CallAdsInit' | 'LoadAdsenseCompleted' | 'CallAdConfig' | 'PreventAdsCheating' | 'CallShowAdFn' | 'CallAdBreak' | 'CallAdUnit' | 'CallAdBreakDone' | 'CallBeforeAd' | 'CallAfterAd' | 'CallAdBreakTimeout' | 'CallAFVRequest' | 'CallAFVLoad' | 'CallAFVPlaying' | 'CallAFVCompleted' | 'CallAFVError' | 'AdSenseUnitStatusChanged' | 'OpenGame' | 'OpenGame_2Plus' | 'PlayGame' | 'CloseGame' | 'LevelFinished' | 'LevelUpgrade' | 'GamePlayEnded' | 'GameFCP' | 'GameLCP' | 'GameTTFB';
2
2
  export type PerformanceType = 'bootstrapModuleLoaded' | 'implementModuleLoaded' | 'joliboxGameServiceReady';
3
3
  export declare const REPORT_SYSTEM_TIMELINE = "ReportSDK.traceSystemTimeline";
4
4
  export declare const REPORT_SYSTEM_LOG = "ReportSDK.traceSystem";
@@ -10,6 +10,7 @@ export declare const REWARDS_USE_PAYMENT_GEM = "Rewards.JOLI_GEM.usePayment";
10
10
  export declare const REWARDS_USE_GEM_ADS = "Rewards.ADS-JOLI_GEM.useJolicoin";
11
11
  export declare const REWARDS_USE_UNLOGIN_MODAL_GEM_ADS = "Rewards.ADS-JOLI_GEM.useUnloginModal";
12
12
  export declare const REWARDS_USE_PAYMENT_GEM_ADS = "Rewards.ADS-JOLI_GEM.usePayment";
13
+ export declare const REWARDS_USE_SUBSCRIPTION = "Rewards.subscription";
13
14
  type IRewardsResult<T> = Promise<{
14
15
  result: 'SUCCESS' | 'FAILED' | 'CONTINUE';
15
16
  data?: T;
@@ -33,6 +34,7 @@ export interface RewardsCommandParams {
33
34
  [REWARDS_USE_GEM_ADS]: () => IRewardsResult<void>;
34
35
  [REWARDS_USE_UNLOGIN_MODAL_GEM_ADS]: () => IRewardsResult<void>;
35
36
  [REWARDS_USE_PAYMENT_GEM_ADS]: () => IRewardsResult<void>;
37
+ [REWARDS_USE_SUBSCRIPTION]: () => IRewardsResult<void>;
36
38
  }
37
39
  export type RewardsCommandType = keyof RewardsCommandParams;
38
40
  export {};
package/dist/env.d.ts CHANGED
@@ -31,6 +31,11 @@ export interface Env {
31
31
  uid?: string;
32
32
  isLogin: boolean;
33
33
  token?: string;
34
+ isSubUser?: boolean;
35
+ };
36
+ mpInfo?: {
37
+ mpName: string;
38
+ mpVersion?: string;
34
39
  };
35
40
  schema: string;
36
41
  platform: 'ios' | 'android' | 'h5';
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ export * from './sdks/task-tracker';
5
5
  export * from './sdks/native/keyboard';
6
6
  export * from './sdks/router';
7
7
  export * from './sdks/ads';
8
+ export * from './sdks/payment';
8
9
  export * from './events';
9
10
  export * from './commands';
10
11
  export * from './common';
@@ -0,0 +1,13 @@
1
+ import { IGemProductInfo, StandardResponse } from '../commands';
2
+ type GemProductInfo = Omit<IGemProductInfo, 'appStoreProductId'>;
3
+ export interface Payment {
4
+ purchaseGem: (params: {
5
+ productId: string;
6
+ }) => Promise<StandardResponse<{
7
+ totalAmount: string;
8
+ } | void, unknown>>;
9
+ getGemProducts: () => Promise<StandardResponse<{
10
+ products: GemProductInfo[];
11
+ } | void, unknown>>;
12
+ }
13
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jolibox/types",
3
3
  "description": "This project is common types used for JS-SDk interfere & implement",
4
- "version": "1.2.3",
4
+ "version": "1.2.5-beta.3",
5
5
  "typings": "dist/index.d.ts",
6
6
  "license": "MIT",
7
7
  "files": [
@@ -10,7 +10,7 @@
10
10
  ],
11
11
  "devDependencies": {
12
12
  "typescript": "5.7.3",
13
- "@jolibox/eslint-config": "1.0.0",
13
+ "@jolibox/eslint-config": "1.0.1-beta.11",
14
14
  "rimraf": "6.0.1"
15
15
  },
16
16
  "typedocOptions": {