@series-inc/venus-sdk 3.1.2-beta.0 → 3.1.2
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/dist/{AdsApi-xw-M1AEl.d.mts → AdsApi-CNGRf6j0.d.mts} +293 -501
- package/dist/{AdsApi-xw-M1AEl.d.ts → AdsApi-CNGRf6j0.d.ts} +293 -501
- package/dist/{chunk-QQTWO5KS.mjs → chunk-PXWCNWJ6.mjs} +1525 -1380
- package/dist/chunk-PXWCNWJ6.mjs.map +1 -0
- package/dist/{chunk-QABXMFND.mjs → chunk-W7IPHM67.mjs} +26 -3
- package/dist/chunk-W7IPHM67.mjs.map +1 -0
- package/dist/core-R3FHW62G.mjs +3 -0
- package/dist/{core-62LWDHN7.mjs.map → core-R3FHW62G.mjs.map} +1 -1
- package/dist/index.cjs +1531 -1406
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +92 -280
- package/dist/index.d.ts +92 -280
- package/dist/index.mjs +6 -4
- package/dist/index.mjs.map +1 -1
- package/dist/venus-api/index.cjs +2012 -1548
- package/dist/venus-api/index.cjs.map +1 -1
- package/dist/venus-api/index.d.mts +2 -2
- package/dist/venus-api/index.d.ts +2 -2
- package/dist/venus-api/index.mjs +391 -92
- package/dist/venus-api/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-NSSMTXJJ.mjs +0 -7
- package/dist/chunk-NSSMTXJJ.mjs.map +0 -1
- package/dist/chunk-QABXMFND.mjs.map +0 -1
- package/dist/chunk-QQTWO5KS.mjs.map +0 -1
- package/dist/chunk-UXY5CKKG.mjs +0 -12
- package/dist/chunk-UXY5CKKG.mjs.map +0 -1
- package/dist/core-62LWDHN7.mjs +0 -4
- package/dist/vite/index.cjs +0 -534
- package/dist/vite/index.cjs.map +0 -1
- package/dist/vite/index.mjs +0 -527
- package/dist/vite/index.mjs.map +0 -1
- package/dist/webview/index.cjs +0 -15
- package/dist/webview/index.cjs.map +0 -1
- package/dist/webview/index.d.mts +0 -15
- package/dist/webview/index.d.ts +0 -15
- package/dist/webview/index.mjs +0 -4
- package/dist/webview/index.mjs.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
export { WEBVIEW_LIBRARY_SHIM_SOURCE, getWebviewLibraryShimSource } from './webview/index.js';
|
|
1
|
+
import { A as AnalyticsApi, R as RpcRequest, a as RpcResponse, b as RpcNotification, c as RpcClient, V as VenusAPI, H as Host, S as StorageApi, N as NavigationApi, Q as QuitOptions, d as NavigationStackInfo, P as PushAppOptions, e as NotificationsApi, f as ScheduleLocalNotification, g as ScheduleNotificationOptions, h as PopupsApi, i as ActionSheetItem, j as ShowActionSheetOptions, k as ShowAlertOptions, l as ShowConfirmOptions, m as ShowToastOptions, n as ShowInterstitialAdOptions, o as ShowRewardedAdOptions, p as ProfileApi, q as Profile, C as CdnApi, r as SubPath, F as FetchBlobOptions, T as TimeApi, s as ServerTimeData, G as GetFutureTimeOptions, t as AiApi, u as AiChatCompletionRequest, v as AiChatCompletionData, w as HapticsApi, x as HapticFeedbackStyle, y as FeaturesApi, E as Experiment, L as LifecycleApi, z as SleepCallback, B as Subscription, D as AwakeCallback, I as PauseCallback, J as ResumeCallback, K as QuitCallback, M as SimulationApi, O as VenusSimulationConfig, U as ExecuteRecipeOptions, W as CollectRecipeResult, X as GetActiveRunsOptions, Y as ExecuteScopedRecipeResult, Z as GetAvailableRecipesOptions, _ as GetAvailableRecipesResult, $ as Recipe, a0 as GetBatchRecipeRequirements, a1 as TriggerRecipeChainOptions, a2 as RecipeRequirementResult, a3 as VenusTransport, a4 as LoggingApi, a5 as IapApi, a6 as SpendCurrencyOptions, a7 as LoadEmbeddedAssetsResponse, a8 as SharedAssetsApi, a9 as LeaderboardApi, aa as StartRunResult, ab as SubmitScoreOptions, ac as SubmitScoreResult, ad as GetLeaderboardOptions, ae as LeaderboardResponse, af as PlayerStatsOptions, ag as PlayerStats, ah as LeaderboardHighlightOptions, ai as LeaderboardHighlightResponse, aj as PreloaderApi, ak as SocialApi, al as ShareMetadata, am as ShareLinkResult, an as SocialQRCodeOptions, ao as QRCodeResult, ap as Avatar3dApi, aq as AssetManifest, ar as Avatar3dConfig, as as ShowEditorOptions, at as Avatar3dEdits, au as AdsApi, av as PostApi, aw as RoomsApi, ax as InitializationOptions, ay as InitializationContext, az as HudInsets } from './AdsApi-CNGRf6j0.js';
|
|
2
|
+
export { aA as AiMessage, aB as Asset, aC as Category, aL as CreateRoomOptions, aR as ExecuteScopedRecipeOptions, aM as JoinOrCreateResult, aY as LeaderboardAntiCheatConfig, a_ as LeaderboardConfig, aZ as LeaderboardDisplaySettings, a$ as LeaderboardEntry, b0 as LeaderboardHighlightContext, aV as LeaderboardModeConfig, aX as LeaderboardPeriodConfig, aW as LeaderboardPeriodType, aU as LoadEmbeddedAssetsRequest, aD as MockAvatarApi, aF as NotificationTriggerInput, aI as OnNotificationCallback, aG as OnRequestCallback, aH as OnResponseCallback, aO as ProposeMovePayload, aP as ProposeMoveResult, aS as RecipeInfo, aN as RoomSubscriptionOptions, aT as RpcSharedAssetsApi, aJ as RpcTransport, aE as TimeIntervalTriggerInput, aQ as ValidateMoveResult, aK as VenusRoom, b1 as createHost } from './AdsApi-CNGRf6j0.js';
|
|
4
3
|
|
|
5
4
|
declare class MockAnalyticsApi implements AnalyticsApi {
|
|
6
5
|
recordCustomEvent(eventName: string, payload: Record<string, any>): Promise<void>;
|
|
@@ -161,77 +160,15 @@ declare class MockPopupsApi implements PopupsApi {
|
|
|
161
160
|
declare function initializePopups(venusApi: VenusAPI, host: Host): void;
|
|
162
161
|
|
|
163
162
|
declare class HostProfileApi implements ProfileApi {
|
|
164
|
-
private readonly venusApi;
|
|
165
|
-
constructor(venusApi: VenusAPI);
|
|
166
163
|
getCurrentProfile(): Profile;
|
|
167
164
|
}
|
|
168
165
|
|
|
169
166
|
declare class MockProfileApi implements ProfileApi {
|
|
170
|
-
private readonly venusApi;
|
|
171
|
-
constructor(venusApi: VenusAPI);
|
|
172
167
|
getCurrentProfile(): Profile;
|
|
173
168
|
}
|
|
174
169
|
|
|
175
170
|
declare function initializeProfile(venusApi: VenusAPI, host: Host): void;
|
|
176
171
|
|
|
177
|
-
declare class HostDeviceApi implements DeviceApi {
|
|
178
|
-
private readonly venusApi;
|
|
179
|
-
constructor(venusApi: VenusAPI);
|
|
180
|
-
getDevice(): DeviceInfo;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
declare class MockDeviceApi implements DeviceApi {
|
|
184
|
-
private readonly venusApi;
|
|
185
|
-
constructor(venusApi: VenusAPI);
|
|
186
|
-
getDevice(): DeviceInfo;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
declare class HostEnvironmentApi implements EnvironmentApi {
|
|
190
|
-
private readonly venusApi;
|
|
191
|
-
constructor(venusApi: VenusAPI);
|
|
192
|
-
getEnvironment(): EnvironmentInfo;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
declare class MockEnvironmentApi implements EnvironmentApi {
|
|
196
|
-
private readonly venusApi;
|
|
197
|
-
constructor(venusApi: VenusAPI);
|
|
198
|
-
getEnvironment(): EnvironmentInfo;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* Host implementation of SystemApi that delegates to device and environment APIs.
|
|
203
|
-
* Acts as a facade combining both system-level information sources.
|
|
204
|
-
*/
|
|
205
|
-
declare class HostSystemApi implements SystemApi {
|
|
206
|
-
private readonly deviceApi;
|
|
207
|
-
private readonly environmentApi;
|
|
208
|
-
private readonly venusApi;
|
|
209
|
-
constructor(deviceApi: DeviceApi, environmentApi: EnvironmentApi, venusApi: VenusAPI);
|
|
210
|
-
getDevice(): DeviceInfo;
|
|
211
|
-
getEnvironment(): EnvironmentInfo;
|
|
212
|
-
getSafeArea(): SafeArea;
|
|
213
|
-
isMobile(): boolean;
|
|
214
|
-
isWeb(): boolean;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* Mock implementation of SystemApi for local development.
|
|
219
|
-
* Delegates to mock device and environment APIs.
|
|
220
|
-
*/
|
|
221
|
-
declare class MockSystemApi implements SystemApi {
|
|
222
|
-
private readonly deviceApi;
|
|
223
|
-
private readonly environmentApi;
|
|
224
|
-
private readonly venusApi;
|
|
225
|
-
constructor(deviceApi: DeviceApi, environmentApi: EnvironmentApi, venusApi: VenusAPI);
|
|
226
|
-
getDevice(): DeviceInfo;
|
|
227
|
-
getEnvironment(): EnvironmentInfo;
|
|
228
|
-
getSafeArea(): SafeArea;
|
|
229
|
-
isMobile(): boolean;
|
|
230
|
-
isWeb(): boolean;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
declare function initializeSystem(venusApi: VenusAPI, host: Host): void;
|
|
234
|
-
|
|
235
172
|
declare class HostCdnApi implements CdnApi {
|
|
236
173
|
private readonly baseUrl;
|
|
237
174
|
constructor(baseUrl: string);
|
|
@@ -244,10 +181,8 @@ declare class HostCdnApi implements CdnApi {
|
|
|
244
181
|
}
|
|
245
182
|
|
|
246
183
|
declare class MockCdnApi implements CdnApi {
|
|
247
|
-
private readonly
|
|
248
|
-
constructor(
|
|
249
|
-
private get baseUrl();
|
|
250
|
-
private get forceRemoteCdn();
|
|
184
|
+
private readonly baseUrl;
|
|
185
|
+
constructor();
|
|
251
186
|
fetchBlob(path: SubPath, options?: FetchBlobOptions): Promise<Blob>;
|
|
252
187
|
getAssetCdnBaseUrl(): string;
|
|
253
188
|
resolveAssetUrl(subPath: string): string;
|
|
@@ -260,8 +195,7 @@ declare function initializeCdn(venusApi: VenusAPI, host: Host): void;
|
|
|
260
195
|
|
|
261
196
|
declare class HostTimeApi implements TimeApi {
|
|
262
197
|
private readonly rpcClient;
|
|
263
|
-
|
|
264
|
-
constructor(rpcClient: RpcClient, venusApi: VenusAPI);
|
|
198
|
+
constructor(rpcClient: RpcClient);
|
|
265
199
|
requestTimeAsync(): Promise<ServerTimeData>;
|
|
266
200
|
formatTime(timestamp: number, options?: any): string;
|
|
267
201
|
formatNumber(value: number, options?: Intl.NumberFormatOptions): string;
|
|
@@ -277,6 +211,7 @@ declare class MockTimeApi implements TimeApi {
|
|
|
277
211
|
formatTime(timestamp: number, options?: any): string;
|
|
278
212
|
getFutureTimeAsync(options?: GetFutureTimeOptions): Promise<number>;
|
|
279
213
|
requestTimeAsync(): Promise<ServerTimeData>;
|
|
214
|
+
private getLocale;
|
|
280
215
|
}
|
|
281
216
|
|
|
282
217
|
declare function initializeTime(venusApi: VenusAPI, host: Host): void;
|
|
@@ -358,41 +293,69 @@ declare function initializeLifecycleApi(venusApi: VenusAPI, host: Host): void;
|
|
|
358
293
|
declare class RpcSimulationApi implements SimulationApi {
|
|
359
294
|
private readonly rpcClient;
|
|
360
295
|
private _simulationConfig;
|
|
361
|
-
private readonly subscriptionCallbacks;
|
|
362
296
|
constructor(rpcClient: RpcClient);
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
getStateAsync(roomId?: string): Promise<SimulationState>;
|
|
297
|
+
validateSlotAssignmentAsync(containerId: string, slotId: string, itemId: string): Promise<any>;
|
|
298
|
+
sumContributions(contributions: Record<string, any>): Record<string, number>;
|
|
299
|
+
executeBatchOperationsAsync(operations: Array<any>, validateOnly?: boolean): Promise<any>;
|
|
300
|
+
getAvailableItemsAsync(containerId: string, slotId: string): Promise<Array<any>>;
|
|
301
|
+
calculatePowerPreviewAsync(containerId: string, slotId: string, candidateItemId: string): Promise<any>;
|
|
302
|
+
assignItemToSlotAsync(containerId: string, slotId: string, itemId: string): Promise<any>;
|
|
303
|
+
removeItemFromSlotAsync(containerId: string, slotId: string): Promise<any>;
|
|
304
|
+
getSlotContainersAsync(): Promise<any>;
|
|
305
|
+
getSlotAssignmentsAsync(containerId: string): Promise<any>;
|
|
306
|
+
getStateAsync(roomId?: string): Promise<any>;
|
|
374
307
|
getConfigAsync(roomId?: string): Promise<VenusSimulationConfig>;
|
|
375
|
-
executeRecipeAsync(recipeId: string, inputs?:
|
|
308
|
+
executeRecipeAsync(recipeId: string, inputs?: any, options?: ExecuteRecipeOptions): Promise<any>;
|
|
376
309
|
collectRecipeAsync(runId: string): Promise<CollectRecipeResult>;
|
|
377
|
-
getActiveRunsAsync(options?: GetActiveRunsOptions): Promise<
|
|
378
|
-
executeScopedRecipeAsync(recipeId: string, entity: string, inputs?:
|
|
310
|
+
getActiveRunsAsync(options?: GetActiveRunsOptions): Promise<any>;
|
|
311
|
+
executeScopedRecipeAsync(recipeId: string, entity: string, inputs?: any, options?: any): Promise<ExecuteScopedRecipeResult>;
|
|
312
|
+
getAvailableRecipesAsync(options?: GetAvailableRecipesOptions): Promise<GetAvailableRecipesResult>;
|
|
313
|
+
getRecipeRequirementsAsync(recipe: Recipe): Promise<any>;
|
|
314
|
+
getBatchRecipeRequirementsAsync(recipes: Recipe[]): Promise<GetBatchRecipeRequirements>;
|
|
315
|
+
triggerRecipeChainAsync(recipeId: string, options?: TriggerRecipeChainOptions): Promise<any>;
|
|
316
|
+
getEntityMetadataAsync(entityId: string): Promise<any>;
|
|
317
|
+
resolveFieldValueAsync(entityId: string, fieldPath: string, entity?: string): Promise<any>;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
declare class MockSimulationApi implements SimulationApi {
|
|
321
|
+
private readonly mockSimulationConfigs;
|
|
322
|
+
private readonly mockSimulationStates;
|
|
323
|
+
private readonly mockActiveTimers;
|
|
324
|
+
private readonly appId;
|
|
325
|
+
private readonly providedSimulationConfig;
|
|
326
|
+
constructor(simulationConfig?: VenusSimulationConfig | null);
|
|
327
|
+
sumContributions(contributions: Record<string, any>): Record<string, number>;
|
|
328
|
+
validateSlotAssignmentAsync(containerId: string, slotId: string, itemId: string): Promise<any>;
|
|
329
|
+
executeBatchOperationsAsync(operations: Array<any>, validateOnly?: boolean): Promise<any>;
|
|
330
|
+
getAvailableItemsAsync(containerId: string, slotId: string): Promise<Array<any>>;
|
|
331
|
+
calculatePowerPreviewAsync(containerId: string, slotId: string, candidateItemId: string): Promise<any>;
|
|
332
|
+
getSlotContainersAsync(): Promise<any>;
|
|
333
|
+
getSlotAssignmentsAsync(containerId: string): Promise<any>;
|
|
334
|
+
resolveFieldValueAsync(entityId: string, fieldPath: string, entity?: string): Promise<any>;
|
|
335
|
+
getEntityMetadataAsync(entityId: string): Promise<any>;
|
|
336
|
+
collectRecipeAsync(runId: string): Promise<CollectRecipeResult>;
|
|
337
|
+
executeRecipeAsync(recipeId: string, inputs?: any, options?: ExecuteRecipeOptions): Promise<any>;
|
|
338
|
+
executeScopedRecipeAsync(recipeId: string, entity: string, inputs?: any, options?: any): Promise<ExecuteScopedRecipeResult>;
|
|
339
|
+
getActiveRunsAsync(options?: GetActiveRunsOptions): Promise<any>;
|
|
379
340
|
getAvailableRecipesAsync(options?: GetAvailableRecipesOptions): Promise<GetAvailableRecipesResult>;
|
|
380
|
-
getRecipeRequirementsAsync(recipe: Recipe): Promise<RecipeRequirementResult>;
|
|
381
341
|
getBatchRecipeRequirementsAsync(recipes: Recipe[]): Promise<GetBatchRecipeRequirements>;
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
private
|
|
386
|
-
private
|
|
342
|
+
getRecipeRequirementsAsync(recipe: Recipe): Promise<RecipeRequirementResult>;
|
|
343
|
+
triggerRecipeChainAsync(recipeId: string, options?: TriggerRecipeChainOptions): Promise<any>;
|
|
344
|
+
private log;
|
|
345
|
+
private executeRecipe;
|
|
346
|
+
private initializeSimulationState;
|
|
347
|
+
private generateRunId;
|
|
348
|
+
private completeRun;
|
|
349
|
+
private createSeededRandom;
|
|
350
|
+
private applyEffects;
|
|
351
|
+
getConfigAsync(): Promise<any>;
|
|
352
|
+
getStateAsync(roomId?: string): Promise<any>;
|
|
353
|
+
assignItemToSlotAsync(containerId: string, slotId: string, itemId: string): Promise<any>;
|
|
354
|
+
removeItemFromSlotAsync(containerId: string, slotId: string): Promise<any>;
|
|
387
355
|
}
|
|
388
356
|
|
|
389
357
|
declare function initializeSimulation(venusApi: VenusAPI, host: Host): void;
|
|
390
358
|
|
|
391
|
-
interface RoomNotificationSubscriptionState {
|
|
392
|
-
data: Record<string, Array<(event: RoomDataUpdate) => void>>;
|
|
393
|
-
messages: Record<string, Array<(event: RoomMessageEvent) => void>>;
|
|
394
|
-
gameEvents: Record<string, Array<(event: ProposedMoveEvent) => void>>;
|
|
395
|
-
}
|
|
396
359
|
/**
|
|
397
360
|
* Set up room notification listeners using the transport's onVenusMessage hook.
|
|
398
361
|
* This routes host-sent room notifications (H5_ROOM_DATA_UPDATED, etc.) to the
|
|
@@ -400,34 +363,7 @@ interface RoomNotificationSubscriptionState {
|
|
|
400
363
|
* @param transport The Venus transport to listen for messages
|
|
401
364
|
* @param getSubscriptions Function to retrieve subscription state from RoomsApi
|
|
402
365
|
*/
|
|
403
|
-
declare function setupRoomNotifications(transport: VenusTransport, getSubscriptions: () =>
|
|
404
|
-
|
|
405
|
-
declare class RpcRoomsApi implements RoomsApi {
|
|
406
|
-
private readonly rpcClient;
|
|
407
|
-
private readonly subscriptions;
|
|
408
|
-
constructor(rpcClient: RpcClient);
|
|
409
|
-
/**
|
|
410
|
-
* Get the subscription state for external access (used by setupRoomNotifications)
|
|
411
|
-
*/
|
|
412
|
-
getSubscriptions(): RoomNotificationSubscriptionState;
|
|
413
|
-
/**
|
|
414
|
-
* Set up room notification routing from the transport
|
|
415
|
-
*/
|
|
416
|
-
setupNotifications(transport: VenusTransport): void;
|
|
417
|
-
createRoomAsync(options: CreateRoomOptions): Promise<VenusRoom>;
|
|
418
|
-
joinOrCreateRoomAsync(options: JoinOrCreateRoomOptions): Promise<JoinOrCreateResult>;
|
|
419
|
-
joinRoomByCodeAsync(roomCode: string): Promise<VenusRoom>;
|
|
420
|
-
getUserRoomsAsync(options?: ListRoomsOptions): Promise<VenusRoom[]>;
|
|
421
|
-
updateRoomDataAsync(room: VenusRoom, updates: Record<string, unknown>, options?: UpdateRoomDataOptions): Promise<void>;
|
|
422
|
-
getRoomDataAsync(room: VenusRoom): Promise<Record<string, unknown>>;
|
|
423
|
-
sendRoomMessageAsync(venusRoom: VenusRoom, request: RoomMessageRequest): Promise<string>;
|
|
424
|
-
leaveRoomAsync(room: VenusRoom): Promise<void>;
|
|
425
|
-
startRoomGameAsync(room: VenusRoom, options?: StartRoomGameOptions): Promise<void>;
|
|
426
|
-
proposeMoveAsync(room: VenusRoom, proposalPayload: ProposeMoveRequest): Promise<ProposeMoveResult>;
|
|
427
|
-
validateMoveAsync(_room: VenusRoom, moveId: string, verdict: ValidateMoveVerdict): Promise<ValidateMoveResult>;
|
|
428
|
-
subscribeAsync(room: VenusRoom, options?: RoomSubscriptionOptions): Promise<() => void>;
|
|
429
|
-
}
|
|
430
|
-
|
|
366
|
+
declare function setupRoomNotifications(transport: VenusTransport, getSubscriptions: () => any): Subscription;
|
|
431
367
|
declare function initializeRoomsApi(venusApi: VenusAPI, host: Host): void;
|
|
432
368
|
|
|
433
369
|
declare class MockLoggingApi implements LoggingApi {
|
|
@@ -459,61 +395,9 @@ declare class RpcIapApi implements IapApi {
|
|
|
459
395
|
declare class MockSharedAssetsApi implements SharedAssetsApi {
|
|
460
396
|
private readonly venusApi;
|
|
461
397
|
constructor(venusApi: VenusAPI);
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
type ModuleSpecifierMatch = 'exact' | 'prefix';
|
|
467
|
-
interface ModuleSpecifierConfig {
|
|
468
|
-
match: ModuleSpecifierMatch;
|
|
469
|
-
value: string;
|
|
470
|
-
behavior?: 'default' | 'react-jsx-runtime' | 'react-jsx-dev-runtime' | 'namespace';
|
|
471
|
-
}
|
|
472
|
-
interface EmbeddedLibraryDefinition {
|
|
473
|
-
libraryKey: string;
|
|
474
|
-
assetKey: string;
|
|
475
|
-
packageName: string;
|
|
476
|
-
version: string;
|
|
477
|
-
globalVar: string;
|
|
478
|
-
cdnPath: string;
|
|
479
|
-
moduleSpecifiers: ModuleSpecifierConfig[];
|
|
480
|
-
loadStage: number;
|
|
481
|
-
enabled: boolean;
|
|
482
|
-
}
|
|
483
|
-
declare const DEFAULT_SHARED_LIB_CDN_BASE = "https://venus-static-01293ak.web.app/libs";
|
|
484
|
-
declare const EMBEDDED_LIBRARIES: EmbeddedLibraryDefinition[];
|
|
485
|
-
declare const EMBEDDED_LIBRARY_BY_KEY: Record<string, EmbeddedLibraryDefinition>;
|
|
486
|
-
declare const MODULE_TO_LIBRARY_SPECIFIERS: {
|
|
487
|
-
libraryKey: string;
|
|
488
|
-
match: ModuleSpecifierMatch;
|
|
489
|
-
value: string;
|
|
490
|
-
behavior?: "default" | "react-jsx-runtime" | "react-jsx-dev-runtime" | "namespace";
|
|
491
|
-
}[];
|
|
492
|
-
/**
|
|
493
|
-
* Get library definition by key, throwing if not found.
|
|
494
|
-
* @param libraryKey - Library key (e.g., 'phaser@3.90.0')
|
|
495
|
-
* @returns Library definition
|
|
496
|
-
* @throws Error if library key is not found
|
|
497
|
-
*/
|
|
498
|
-
declare function getLibraryDefinition(libraryKey: string): EmbeddedLibraryDefinition;
|
|
499
|
-
|
|
500
|
-
/**
|
|
501
|
-
* Base64 encoding/decoding utilities for embedded assets and libraries.
|
|
502
|
-
*
|
|
503
|
-
* These utilities handle base64 data received from the Venus host via RPC,
|
|
504
|
-
* converting it to ArrayBuffer or UTF-8 strings with appropriate fallbacks
|
|
505
|
-
* for different JavaScript environments.
|
|
506
|
-
*/
|
|
507
|
-
/**
|
|
508
|
-
* Convert base64 string to ArrayBuffer.
|
|
509
|
-
* Uses native atob() when available for best performance.
|
|
510
|
-
*/
|
|
511
|
-
declare function base64ToArrayBuffer(base64: string): ArrayBuffer;
|
|
512
|
-
/**
|
|
513
|
-
* Convert base64 string to UTF-8 string.
|
|
514
|
-
* Tries multiple decoding strategies for maximum compatibility.
|
|
515
|
-
*/
|
|
516
|
-
declare function base64ToUtf8(base64: string): string;
|
|
398
|
+
loadBurgerTimeAssetsBundle(): Promise<ArrayBuffer>;
|
|
399
|
+
loadCharactersBundle(): Promise<ArrayBuffer>;
|
|
400
|
+
}
|
|
517
401
|
|
|
518
402
|
declare class MockIapApi implements IapApi {
|
|
519
403
|
private _hardCurrency;
|
|
@@ -529,96 +413,35 @@ declare function initializeIap(venusApiInstance: VenusAPI, host: Host): void;
|
|
|
529
413
|
|
|
530
414
|
declare class RpcLeaderboardApi implements LeaderboardApi {
|
|
531
415
|
private readonly rpcClient;
|
|
532
|
-
/** Cache of score tokens for automatic hash computation */
|
|
533
|
-
private tokenCache;
|
|
534
416
|
constructor(rpcClient: RpcClient);
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
* @returns Score token with sealing data if enabled
|
|
541
|
-
*/
|
|
542
|
-
createScoreToken(mode?: string): Promise<ScoreToken>;
|
|
543
|
-
/**
|
|
544
|
-
* Submit a score to the leaderboard.
|
|
545
|
-
* Automatically computes hash if score sealing is enabled and token was created via createScoreToken().
|
|
546
|
-
*
|
|
547
|
-
* @param params - Score submission parameters
|
|
548
|
-
* @returns Submission result with acceptance status and rank
|
|
549
|
-
* @throws Error if token not found in cache
|
|
550
|
-
*/
|
|
551
|
-
submitScore(params: SubmitScoreParams): Promise<SubmitScoreResult>;
|
|
552
|
-
getPagedScores(options?: GetPagedScoresOptions): Promise<PagedScoresResponse>;
|
|
553
|
-
getMyRank(options?: PlayerRankOptions): Promise<PlayerRankResult>;
|
|
554
|
-
getPodiumScores(options?: GetPodiumScoresOptions): Promise<PodiumScoresResponse>;
|
|
417
|
+
startRun(mode?: string): Promise<StartRunResult>;
|
|
418
|
+
submitScore(sessionId: string, score: number, durationSec: number, options?: SubmitScoreOptions): Promise<SubmitScoreResult>;
|
|
419
|
+
getLeaderboard(options?: GetLeaderboardOptions): Promise<LeaderboardResponse>;
|
|
420
|
+
getPlayerStats(options?: PlayerStatsOptions): Promise<PlayerStats>;
|
|
421
|
+
getLeaderboardHighlight(options?: LeaderboardHighlightOptions): Promise<LeaderboardHighlightResponse>;
|
|
555
422
|
}
|
|
556
423
|
|
|
557
424
|
declare class MockLeaderboardApi implements LeaderboardApi {
|
|
558
|
-
private
|
|
559
|
-
/** Cache of score tokens for automatic hash computation */
|
|
560
|
-
private tokenCache;
|
|
425
|
+
private sessions;
|
|
561
426
|
private entriesByMode;
|
|
562
|
-
private
|
|
563
|
-
private
|
|
564
|
-
private scoreSealingSecret;
|
|
427
|
+
private sessionCounter;
|
|
428
|
+
private requiresHash;
|
|
565
429
|
constructor(options?: {
|
|
566
|
-
|
|
567
|
-
scoreSealingSecret?: string;
|
|
430
|
+
requiresHash?: boolean;
|
|
568
431
|
});
|
|
569
|
-
/**
|
|
570
|
-
* Configure mock leaderboard settings
|
|
571
|
-
*
|
|
572
|
-
* @param options - Configuration options
|
|
573
|
-
*/
|
|
574
432
|
configure(options: {
|
|
575
|
-
|
|
576
|
-
scoreSealingSecret?: string;
|
|
433
|
+
requiresHash?: boolean;
|
|
577
434
|
}): void;
|
|
578
435
|
private generateNonce;
|
|
579
436
|
private getModeKey;
|
|
580
437
|
private getEntriesForMode;
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
* @returns Score token with sealing data if enabled
|
|
587
|
-
*/
|
|
588
|
-
createScoreToken(mode?: string): Promise<ScoreToken>;
|
|
589
|
-
/**
|
|
590
|
-
* Submit a mock score to the leaderboard.
|
|
591
|
-
* Automatically computes hash if score sealing is enabled and token was created via createScoreToken().
|
|
592
|
-
*
|
|
593
|
-
* @param params - Score submission parameters
|
|
594
|
-
* @returns Submission result with acceptance status and rank
|
|
595
|
-
* @throws Error if token not found in cache or validation fails
|
|
596
|
-
*/
|
|
597
|
-
submitScore(params: SubmitScoreParams): Promise<SubmitScoreResult>;
|
|
598
|
-
getPagedScores(options?: GetPagedScoresOptions): Promise<PagedScoresResponse>;
|
|
599
|
-
getMyRank(_options?: PlayerRankOptions): Promise<PlayerRankResult>;
|
|
600
|
-
getPodiumScores(options?: GetPodiumScoresOptions): Promise<PodiumScoresResponse>;
|
|
438
|
+
startRun(mode?: string): Promise<StartRunResult>;
|
|
439
|
+
submitScore(sessionId: string, score: number, durationSec: number, options?: SubmitScoreOptions): Promise<SubmitScoreResult>;
|
|
440
|
+
getLeaderboard(options?: GetLeaderboardOptions): Promise<LeaderboardResponse>;
|
|
441
|
+
getPlayerStats(_options?: PlayerStatsOptions): Promise<PlayerStats>;
|
|
442
|
+
getLeaderboardHighlight(options?: LeaderboardHighlightOptions): Promise<LeaderboardHighlightResponse>;
|
|
601
443
|
}
|
|
602
444
|
|
|
603
|
-
/**
|
|
604
|
-
* Hash algorithm used for score sealing
|
|
605
|
-
*/
|
|
606
|
-
declare const HASH_ALGORITHM_WEB_CRYPTO = "SHA-256";
|
|
607
|
-
declare const HASH_ALGORITHM_NODE = "sha256";
|
|
608
|
-
/**
|
|
609
|
-
* Compute HMAC-SHA256 hash for score sealing.
|
|
610
|
-
* Hash always includes: score, duration, token
|
|
611
|
-
* Matches server-side hash computation exactly.
|
|
612
|
-
*
|
|
613
|
-
* @param score - The score value
|
|
614
|
-
* @param duration - Duration in seconds
|
|
615
|
-
* @param token - Score token
|
|
616
|
-
* @param sealingNonce - One-time nonce for this submission
|
|
617
|
-
* @param sealingSecret - Secret key for HMAC
|
|
618
|
-
* @returns Hex-encoded hash string
|
|
619
|
-
*/
|
|
620
|
-
declare function computeScoreHash(score: number, duration: number, token: string, sealingNonce: string, sealingSecret: string): Promise<string>;
|
|
621
|
-
|
|
622
445
|
declare function initializeLeaderboard(venusApiInstance: VenusAPI, host: Host): void;
|
|
623
446
|
|
|
624
447
|
declare class MockPreloaderApi implements PreloaderApi {
|
|
@@ -748,6 +571,10 @@ declare enum VenusMessageId {
|
|
|
748
571
|
CONFIRM_DIALOG = "H5_CONFIRM_DIALOG",
|
|
749
572
|
ACTION_SHEET_SHOW = "H5_ACTION_SHEET_SHOW",
|
|
750
573
|
REQUEST_SERVER_TIME = "H5_REQUEST_SERVER_TIME",
|
|
574
|
+
GET_POST_INTERACTIONS = "H5_GET_POST_INTERACTIONS",
|
|
575
|
+
TOGGLE_LIKE = "H5_TOGGLE_LIKE",
|
|
576
|
+
OPEN_COMMENTS = "H5_OPEN_COMMENTS",// For opening comments with callback support
|
|
577
|
+
TOGGLE_FOLLOW = "H5_TOGGLE_FOLLOW",
|
|
751
578
|
SHARE_LINK = "H5_SHARE_LINK",
|
|
752
579
|
CREATE_SHARE_QRCODE = "H5_CREATE_SHARE_QRCODE",
|
|
753
580
|
AI_CHAT_COMPLETION = "H5_AI_CHAT_COMPLETION",
|
|
@@ -792,14 +619,11 @@ declare enum VenusMessageId {
|
|
|
792
619
|
H5_SIMULATION_GET_AVAILABLE_ITEMS = "H5_SIMULATION_GET_AVAILABLE_ITEMS",
|
|
793
620
|
H5_SIMULATION_VALIDATE_ASSIGNMENT = "H5_SIMULATION_VALIDATE_ASSIGNMENT",
|
|
794
621
|
H5_SIMULATION_BATCH_OPERATIONS = "H5_SIMULATION_BATCH_OPERATIONS",
|
|
795
|
-
|
|
796
|
-
H5_SIMULATION_UNSUBSCRIBE = "H5_SIMULATION_UNSUBSCRIBE",
|
|
797
|
-
H5_SIMULATION_UPDATE = "H5_SIMULATION_UPDATE",
|
|
798
|
-
H5_LEADERBOARD_CREATE_SCORE_TOKEN = "H5_LEADERBOARD_CREATE_SCORE_TOKEN",
|
|
622
|
+
H5_LEADERBOARD_START_RUN = "H5_LEADERBOARD_START_RUN",
|
|
799
623
|
H5_LEADERBOARD_SUBMIT_SCORE = "H5_LEADERBOARD_SUBMIT_SCORE",
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
624
|
+
H5_LEADERBOARD_GET = "H5_LEADERBOARD_GET",
|
|
625
|
+
H5_LEADERBOARD_GET_HIGHLIGHT = "H5_LEADERBOARD_GET_HIGHLIGHT",
|
|
626
|
+
H5_LEADERBOARD_GET_PLAYER_STATS = "H5_LEADERBOARD_GET_PLAYER_STATS",
|
|
803
627
|
H5_ROOM_CREATE = "H5_ROOM_CREATE",
|
|
804
628
|
H5_ROOM_JOIN = "H5_ROOM_JOIN",
|
|
805
629
|
H5_ROOM_JOIN_OR_CREATE = "H5_ROOM_JOIN_OR_CREATE",
|
|
@@ -842,9 +666,9 @@ declare class RemoteHost implements Host {
|
|
|
842
666
|
readonly notifications: NotificationsApi;
|
|
843
667
|
readonly popups: PopupsApi;
|
|
844
668
|
readonly profile: ProfileApi;
|
|
845
|
-
readonly system: SystemApi;
|
|
846
669
|
readonly cdn: CdnApi;
|
|
847
670
|
readonly time: TimeApi;
|
|
671
|
+
readonly post: PostApi;
|
|
848
672
|
readonly ai: AiApi;
|
|
849
673
|
readonly haptics: HapticsApi;
|
|
850
674
|
readonly features: FeaturesApi;
|
|
@@ -867,26 +691,14 @@ declare class RemoteHost implements Host {
|
|
|
867
691
|
interface InitResponse {
|
|
868
692
|
initializeAsleep: boolean;
|
|
869
693
|
instanceId: string;
|
|
870
|
-
profile
|
|
694
|
+
profile?: {
|
|
871
695
|
id: string;
|
|
872
696
|
username: string;
|
|
873
697
|
avatarUrl?: string | null;
|
|
874
698
|
isAnonymous?: boolean;
|
|
875
699
|
};
|
|
876
|
-
|
|
877
|
-
launchParams
|
|
878
|
-
environment: EnvironmentInfo;
|
|
879
|
-
device: DeviceInfo;
|
|
880
|
-
locale: string;
|
|
881
|
-
languageCode: string;
|
|
882
|
-
rooms?: {
|
|
883
|
-
gameType?: string;
|
|
884
|
-
rulesPreset?: string;
|
|
885
|
-
matchmaking?: Record<string, any>;
|
|
886
|
-
createOptions?: Record<string, any>;
|
|
887
|
-
privateMatchDefaults?: Record<string, any>;
|
|
888
|
-
[key: string]: any;
|
|
889
|
-
};
|
|
700
|
+
hudInsets?: HudInsets;
|
|
701
|
+
launchParams?: Record<string, string>;
|
|
890
702
|
}
|
|
891
703
|
|
|
892
|
-
export { ActionSheetItem, AdsApi, AiApi, AiChatCompletionData, AiChatCompletionRequest, AnalyticsApi, AssetManifest, Avatar3dApi, Avatar3dConfig, Avatar3dEdits, AwakeCallback, CdnApi, CollectRecipeResult,
|
|
704
|
+
export { ActionSheetItem, AdsApi, AiApi, AiChatCompletionData, AiChatCompletionRequest, AnalyticsApi, AssetManifest, Avatar3dApi, Avatar3dConfig, Avatar3dEdits, AwakeCallback, CdnApi, CollectRecipeResult, ExecuteRecipeOptions, ExecuteScopedRecipeResult, Experiment, FeaturesApi, FetchBlobOptions, GetActiveRunsOptions, GetAvailableRecipesOptions, GetAvailableRecipesResult, GetBatchRecipeRequirements, GetFutureTimeOptions, GetLeaderboardOptions, HapticFeedbackStyle, HapticsApi, Host, HostCdnApi, HostProfileApi, HostTimeApi, HudInsets, IapApi, type InitResponse, InitializationContext, InitializationOptions, LeaderboardApi, LeaderboardHighlightOptions, LeaderboardHighlightResponse, LeaderboardResponse, LifecycleApi, LoadEmbeddedAssetsResponse, LoggingApi, type MethodIds, MockAdsApi, MockAiApi, MockAnalyticsApi, MockCdnApi, MockFeaturesApi, MockHapticsApi, MockIapApi, MockLeaderboardApi, MockLifecycleApi, MockLoggingApi, MockNavigationApi, MockNotificationsApi, MockPopupsApi, MockPreloaderApi, MockProfileApi, MockSharedAssetsApi, MockSimulationApi, MockSocialApi, MockStorageApi, MockTimeApi, NavigationApi, NavigationStackInfo, type NotificationContent, NotificationsApi, PauseCallback, PlayerStats, PlayerStatsOptions, PopupsApi, PreloaderApi, ProfileApi, PushAppOptions, QRCodeResult, QuitCallback, QuitOptions, Recipe, RemoteHost, ResumeCallback, RoomsApi, RpcAdsApi, RpcAiApi, RpcAnalyticsApi, RpcAvatarApi, RpcClient, RpcFeaturesApi, RpcHapticsApi, RpcIapApi, RpcLeaderboardApi, RpcLifecycleApi, RpcLoggingApi, type RpcMessage, RpcNavigationApi, RpcNotification, RpcNotificationsApi, RpcPopupsApi, RpcPreloaderApi, RpcRequest, RpcResponse, RpcSimulationApi, RpcSocialApi, RpcStorageApi, SDK_VERSION, ScheduleLocalNotification, ScheduleNotificationOptions, ServerTimeData, ShareLinkResult, ShareMetadata, SharedAssetsApi, ShowActionSheetOptions, ShowAlertOptions, ShowConfirmOptions, ShowEditorOptions, ShowInterstitialAdOptions, ShowRewardedAdOptions, ShowToastOptions, type ShowToastResponse, SimulationApi, SleepCallback, SocialApi, SocialQRCodeOptions, SpendCurrencyOptions, StartRunResult, StorageApi, type StorageType, SubPath, SubmitScoreOptions, SubmitScoreResult, Subscription, TimeApi, TriggerRecipeChainOptions, VenusMessageId, createMockStorageApi, initializeAds, initializeAi, initializeAnalytics, initializeAvatar3d, initializeCdn, initializeFeaturesApi, initializeHaptics, initializeIap, initializeLeaderboard, initializeLifecycleApi, initializeLocalNotifications, initializeLoggingApi, initializePopups, initializePreloader, initializeProfile, initializeRoomsApi, initializeSimulation, initializeSocial, initializeStackNavigation, initializeStorage, initializeTime, isPacificDaylightTime, setupRoomNotifications };
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
import './chunk-
|
|
4
|
-
|
|
1
|
+
import { init_rooms } from './chunk-PXWCNWJ6.mjs';
|
|
2
|
+
export { HapticFeedbackStyle, HostCdnApi, HostProfileApi, HostTimeApi, MockAdsApi, MockAiApi, MockAnalyticsApi, MockAvatarApi, MockCdnApi, MockFeaturesApi, MockHapticsApi, MockIapApi, MockLeaderboardApi, MockLifecycleApi, MockLoggingApi, MockNavigationApi, MockNotificationsApi, MockPopupsApi, MockPreloaderApi, MockProfileApi, MockSharedAssetsApi, MockSimulationApi, MockSocialApi, MockStorageApi, MockTimeApi, RemoteHost, RpcAdsApi, RpcAiApi, RpcAnalyticsApi, RpcAvatarApi, RpcClient, RpcFeaturesApi, RpcHapticsApi, RpcIapApi, RpcLeaderboardApi, RpcLifecycleApi, RpcLoggingApi, RpcNavigationApi, RpcNotificationsApi, RpcPopupsApi, RpcPreloaderApi, RpcSharedAssetsApi, RpcSimulationApi, RpcSocialApi, RpcStorageApi, SDK_VERSION, VenusMessageId, VenusRoom, createHost, createMockStorageApi, initializeAds, initializeAi, initializeAnalytics, initializeAvatar3d, initializeCdn, initializeFeaturesApi, initializeHaptics, initializeIap, initializeLeaderboard, initializeLifecycleApi, initializeLocalNotifications, initializeLoggingApi, initializePopups, initializePreloader, initializeProfile, initializeRoomsApi, initializeSimulation, initializeSocial, initializeStackNavigation, initializeStorage, initializeTime, isPacificDaylightTime, setupRoomNotifications } from './chunk-PXWCNWJ6.mjs';
|
|
3
|
+
import './chunk-W7IPHM67.mjs';
|
|
4
|
+
|
|
5
|
+
// src/index.ts
|
|
6
|
+
init_rooms();
|
|
5
7
|
//# sourceMappingURL=index.mjs.map
|
|
6
8
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.mjs"}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAeA,UAAA,EAAA","file":"index.mjs","sourcesContent":["export * from './ads'\r\nexport * from './ai'\r\nexport * from './analytics'\r\nexport * from './avatar3d'\r\nexport * from './cdn'\r\nexport * from './features'\r\nexport * from './haptics'\r\nexport * from './iap'\r\nexport * from './lifecycles'\r\nexport * from './logging'\r\nexport * from './navigation'\r\nexport * from './notifications'\r\nexport * from './popups'\r\nexport * from './profile'\r\nexport * from './rpc'\r\nexport * from './rooms'\r\nexport * from './storage'\r\nexport * from './simulation'\r\nexport * from './time'\r\nexport * from './version'\r\nexport * from './shared-assets'\r\nexport * from './VenusMessageId'\r\nexport * from './leaderboard'\r\nexport * from './game-preloader'\r\nexport * from './Host'\r\nexport * from './RemoteHost'\r\nexport * from './social'\r\n"]}
|