@series-inc/venus-sdk 2.4.1 → 2.6.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/README.md +264 -204
- package/dist/{AdsApi-Cz0XgLM8.d.mts → AdsApi-C_GcWmfO.d.mts} +178 -84
- package/dist/{AdsApi-Cz0XgLM8.d.ts → AdsApi-C_GcWmfO.d.ts} +178 -84
- package/dist/{chunk-MWUS3A7C.mjs → chunk-W7IPHM67.mjs} +22 -3
- package/dist/chunk-W7IPHM67.mjs.map +1 -0
- package/dist/{chunk-KQZIPQLJ.mjs → chunk-YDXFZ2A2.mjs} +363 -49
- package/dist/chunk-YDXFZ2A2.mjs.map +1 -0
- package/dist/core-R3FHW62G.mjs +3 -0
- package/dist/{core-RDMPQV6U.mjs.map → core-R3FHW62G.mjs.map} +1 -1
- package/dist/index.cjs +343 -45
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +110 -9
- package/dist/index.d.ts +110 -9
- package/dist/index.mjs +6 -2
- package/dist/index.mjs.map +1 -1
- package/dist/venus-api/index.cjs +579 -1366
- 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 +159 -1270
- package/dist/venus-api/index.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-KQZIPQLJ.mjs.map +0 -1
- package/dist/chunk-MWUS3A7C.mjs.map +0 -1
- package/dist/core-RDMPQV6U.mjs +0 -3
|
@@ -1,4 +1,219 @@
|
|
|
1
|
-
import { __publicField, createMockDelay, MOCK_DELAYS, isWebPlatform } from './chunk-
|
|
1
|
+
import { __esm, __export, __publicField, createMockDelay, MOCK_DELAYS, isWebPlatform } from './chunk-W7IPHM67.mjs';
|
|
2
|
+
|
|
3
|
+
// src/rooms/VenusRoom.ts
|
|
4
|
+
var VenusRoom;
|
|
5
|
+
var init_VenusRoom = __esm({
|
|
6
|
+
"src/rooms/VenusRoom.ts"() {
|
|
7
|
+
VenusRoom = class {
|
|
8
|
+
constructor(roomData) {
|
|
9
|
+
__publicField(this, "id");
|
|
10
|
+
__publicField(this, "name");
|
|
11
|
+
__publicField(this, "players");
|
|
12
|
+
__publicField(this, "maxPlayers");
|
|
13
|
+
__publicField(this, "gameType");
|
|
14
|
+
__publicField(this, "appId");
|
|
15
|
+
__publicField(this, "type");
|
|
16
|
+
__publicField(this, "createdBy");
|
|
17
|
+
__publicField(this, "createdAt");
|
|
18
|
+
__publicField(this, "updatedAt");
|
|
19
|
+
__publicField(this, "isPrivate");
|
|
20
|
+
__publicField(this, "currentPlayers");
|
|
21
|
+
__publicField(this, "status");
|
|
22
|
+
__publicField(this, "customMetadata");
|
|
23
|
+
__publicField(this, "admins");
|
|
24
|
+
__publicField(this, "roomCode");
|
|
25
|
+
__publicField(this, "description");
|
|
26
|
+
__publicField(this, "data");
|
|
27
|
+
__publicField(this, "version");
|
|
28
|
+
__publicField(this, "_subscriptions", /* @__PURE__ */ new Map());
|
|
29
|
+
this.id = roomData.id;
|
|
30
|
+
this.name = roomData.name;
|
|
31
|
+
this.players = roomData.currentPlayers || [];
|
|
32
|
+
this.maxPlayers = roomData.maxPlayers;
|
|
33
|
+
this.gameType = roomData.gameType;
|
|
34
|
+
this.appId = roomData.appId;
|
|
35
|
+
this.type = roomData.type;
|
|
36
|
+
this.createdBy = roomData.createdBy;
|
|
37
|
+
this.createdAt = roomData.createdAt;
|
|
38
|
+
this.updatedAt = roomData.updatedAt;
|
|
39
|
+
this.isPrivate = roomData.isPrivate;
|
|
40
|
+
this.currentPlayers = roomData.currentPlayers || [];
|
|
41
|
+
this.status = roomData.status;
|
|
42
|
+
this.customMetadata = roomData.customMetadata || {};
|
|
43
|
+
this.admins = roomData.admins || [];
|
|
44
|
+
this.roomCode = roomData.roomCode;
|
|
45
|
+
this.description = roomData.description;
|
|
46
|
+
this.data = roomData.data || {};
|
|
47
|
+
this.version = roomData.version;
|
|
48
|
+
console.log(`VenusRoom: Created room object for ${this.id}`, {
|
|
49
|
+
hasCustomMetadata: !!this.customMetadata,
|
|
50
|
+
hasGameState: !!this.customMetadata?.rules?.gameState,
|
|
51
|
+
gamePhase: this.customMetadata?.rules?.gameState?.phase,
|
|
52
|
+
currentPlayer: this.customMetadata?.rules?.gameState?.currentPlayer
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
updateFromRoomData(newRoomData) {
|
|
56
|
+
if (newRoomData.id === this.id) {
|
|
57
|
+
this.name = newRoomData.name || this.name;
|
|
58
|
+
this.players = newRoomData.currentPlayers || this.players;
|
|
59
|
+
this.maxPlayers = newRoomData.maxPlayers || this.maxPlayers;
|
|
60
|
+
this.gameType = newRoomData.gameType || this.gameType;
|
|
61
|
+
this.currentPlayers = newRoomData.currentPlayers || this.currentPlayers;
|
|
62
|
+
this.customMetadata = newRoomData.customMetadata || this.customMetadata;
|
|
63
|
+
this.data = newRoomData.data || this.data;
|
|
64
|
+
this.status = newRoomData.status || this.status;
|
|
65
|
+
this.updatedAt = newRoomData.updatedAt || this.updatedAt;
|
|
66
|
+
console.log(`VenusRoom: Updated room object ${this.id} with fresh data`, {
|
|
67
|
+
hasCustomMetadata: !!this.customMetadata,
|
|
68
|
+
hasGameState: !!this.customMetadata?.rules?.gameState,
|
|
69
|
+
gamePhase: this.customMetadata?.rules?.gameState?.phase,
|
|
70
|
+
currentPlayer: this.customMetadata?.rules?.gameState?.currentPlayer
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
// src/rooms/RoomsApi.ts
|
|
79
|
+
var init_RoomsApi = __esm({
|
|
80
|
+
"src/rooms/RoomsApi.ts"() {
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
// src/rooms/index.ts
|
|
85
|
+
var rooms_exports = {};
|
|
86
|
+
__export(rooms_exports, {
|
|
87
|
+
VenusRoom: () => VenusRoom,
|
|
88
|
+
initializeRoomsApi: () => initializeRoomsApi,
|
|
89
|
+
setupRoomNotifications: () => setupRoomNotifications
|
|
90
|
+
});
|
|
91
|
+
function bindMethod(target, targetKey, source, sourceKey) {
|
|
92
|
+
const key = sourceKey ?? targetKey;
|
|
93
|
+
const fn = source?.[key];
|
|
94
|
+
if (typeof fn === "function") {
|
|
95
|
+
target[targetKey] = fn.bind(source);
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
function setupRoomNotifications(transport, getSubscriptions) {
|
|
101
|
+
console.log("[Venus Rooms] Setting up room notification listeners");
|
|
102
|
+
return transport.onVenusMessage((message) => {
|
|
103
|
+
const subscriptions = getSubscriptions();
|
|
104
|
+
if (!subscriptions) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (message.type === "H5_ROOM_DATA_UPDATED") {
|
|
108
|
+
const messageData = message.data;
|
|
109
|
+
const { roomId, roomData } = messageData;
|
|
110
|
+
if (!roomId) return;
|
|
111
|
+
const callbacks = subscriptions.data?.[roomId] || [];
|
|
112
|
+
const allEventsCallbacks = subscriptions.allEvents?.[roomId] || [];
|
|
113
|
+
console.log(`[Venus Rooms] \u{1F514} Room data updated for ${roomId}, notifying ${callbacks.length} callbacks`, roomData);
|
|
114
|
+
callbacks.forEach((callback) => {
|
|
115
|
+
try {
|
|
116
|
+
callback(roomData);
|
|
117
|
+
} catch (error) {
|
|
118
|
+
console.error("[Venus Rooms] Error in room data callback:", error);
|
|
119
|
+
throw error;
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
allEventsCallbacks.forEach((callback) => {
|
|
123
|
+
try {
|
|
124
|
+
callback({ type: message.type, ...messageData });
|
|
125
|
+
} catch (error) {
|
|
126
|
+
console.error("[Venus Rooms] Error in allEvents callback:", error);
|
|
127
|
+
throw error;
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
if (message.type === "H5_ROOM_MESSAGE_RECEIVED" || message.type === "H5_ROOM_MESSAGE_UPDATED" || message.type === "H5_ROOM_MESSAGE_DELETED") {
|
|
132
|
+
const messageData = message.data;
|
|
133
|
+
const { roomId } = messageData;
|
|
134
|
+
if (!roomId) return;
|
|
135
|
+
const callbacks = subscriptions.messages?.[roomId] || [];
|
|
136
|
+
const allEventsCallbacks = subscriptions.allEvents?.[roomId] || [];
|
|
137
|
+
console.log(`[Venus Rooms] \u{1F514} Room message event for ${roomId}, notifying ${callbacks.length} callbacks`);
|
|
138
|
+
callbacks.forEach((callback) => {
|
|
139
|
+
try {
|
|
140
|
+
callback(messageData);
|
|
141
|
+
} catch (error) {
|
|
142
|
+
console.error("[Venus Rooms] Error in room message callback:", error);
|
|
143
|
+
throw error;
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
allEventsCallbacks.forEach((callback) => {
|
|
147
|
+
try {
|
|
148
|
+
callback({ type: message.type, ...messageData });
|
|
149
|
+
} catch (error) {
|
|
150
|
+
console.error("[Venus Rooms] Error in allEvents callback:", error);
|
|
151
|
+
throw error;
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
if (message.type === "app:h5:proposedMoveValidationUpdated") {
|
|
156
|
+
const messageData = message.data;
|
|
157
|
+
const { roomId } = messageData;
|
|
158
|
+
if (!roomId) return;
|
|
159
|
+
const callbacks = subscriptions.gameEvents?.[roomId] || [];
|
|
160
|
+
const allEventsCallbacks = subscriptions.allEvents?.[roomId] || [];
|
|
161
|
+
console.log(`[Venus Rooms] \u{1F514} Proposed move validation updated for ${roomId}, notifying ${callbacks.length} callbacks`);
|
|
162
|
+
callbacks.forEach((callback) => {
|
|
163
|
+
try {
|
|
164
|
+
callback(messageData);
|
|
165
|
+
} catch (error) {
|
|
166
|
+
console.error("[Venus Rooms] Error in game event callback:", error);
|
|
167
|
+
throw error;
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
allEventsCallbacks.forEach((callback) => {
|
|
171
|
+
try {
|
|
172
|
+
callback({ type: message.type, ...messageData });
|
|
173
|
+
} catch (error) {
|
|
174
|
+
console.error("[Venus Rooms] Error in allEvents callback:", error);
|
|
175
|
+
throw error;
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
function initializeRoomsApi(venusApi, host) {
|
|
182
|
+
const roomsApi = host?.rooms;
|
|
183
|
+
if (!roomsApi) {
|
|
184
|
+
console.warn(
|
|
185
|
+
"[Venus SDK] Host did not provide a rooms implementation. Rooms API will be unavailable."
|
|
186
|
+
);
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
const venus = venusApi;
|
|
190
|
+
const existingNamespace = venus.rooms || {};
|
|
191
|
+
const roomsNamespace = Object.assign({}, existingNamespace);
|
|
192
|
+
const namespaceBindings = [
|
|
193
|
+
["create", "createRoom"],
|
|
194
|
+
["joinOrCreate", "joinOrCreateRoom"],
|
|
195
|
+
["joinByCode", "joinRoomByCode"],
|
|
196
|
+
["list", "getUserRooms"],
|
|
197
|
+
["subscribeToRoom", "subscribe"],
|
|
198
|
+
["updateRoomData", "updateData"],
|
|
199
|
+
["getRoomData", "getData"],
|
|
200
|
+
["sendRoomMessage", "sendMessage"],
|
|
201
|
+
["leaveRoom", "leave"],
|
|
202
|
+
["startRoomGame", "startGame"],
|
|
203
|
+
["proposeMove"],
|
|
204
|
+
["validateMove"]
|
|
205
|
+
];
|
|
206
|
+
namespaceBindings.forEach(([targetKey, sourceKey]) => {
|
|
207
|
+
bindMethod(roomsNamespace, targetKey, roomsApi, sourceKey);
|
|
208
|
+
});
|
|
209
|
+
venus.rooms = roomsNamespace;
|
|
210
|
+
}
|
|
211
|
+
var init_rooms = __esm({
|
|
212
|
+
"src/rooms/index.ts"() {
|
|
213
|
+
init_RoomsApi();
|
|
214
|
+
init_VenusRoom();
|
|
215
|
+
}
|
|
216
|
+
});
|
|
2
217
|
|
|
3
218
|
// src/VenusMessageId.ts
|
|
4
219
|
var VenusMessageId = /* @__PURE__ */ ((VenusMessageId2) => {
|
|
@@ -115,6 +330,10 @@ var VenusMessageId = /* @__PURE__ */ ((VenusMessageId2) => {
|
|
|
115
330
|
VenusMessageId2["H5_ROOM_ELIMINATE_PLAYER"] = "H5_ROOM_ELIMINATE_PLAYER";
|
|
116
331
|
VenusMessageId2["H5_ROOM_PROMOTE_TO_SPECTATOR"] = "H5_ROOM_PROMOTE_TO_SPECTATOR";
|
|
117
332
|
VenusMessageId2["H5_LOAD_EMBEDDED_ASSET"] = "H5_LOAD_EMBEDDED_ASSET";
|
|
333
|
+
VenusMessageId2["H5_SHOW_LOAD_SCREEN"] = "H5_SHOW_LOAD_SCREEN";
|
|
334
|
+
VenusMessageId2["H5_HIDE_LOAD_SCREEN"] = "H5_HIDE_LOAD_SCREEN";
|
|
335
|
+
VenusMessageId2["H5_SET_LOADER_TEXT"] = "H5_SET_LOADER_TEXT";
|
|
336
|
+
VenusMessageId2["H5_SET_LOADER_PROGRESS"] = "H5_SET_LOADER_PROGRESS";
|
|
118
337
|
VenusMessageId2["H5_IAP_OPEN_STORE"] = "H5_IAP_OPEN_STORE";
|
|
119
338
|
VenusMessageId2["H5_IAP_GET_CURRENCY_ICON"] = "H5_IAP_GET_CURRENCY_ICON";
|
|
120
339
|
return VenusMessageId2;
|
|
@@ -136,7 +355,11 @@ var RpcAdsApi = class {
|
|
|
136
355
|
return response.shown;
|
|
137
356
|
}
|
|
138
357
|
async isRewardedAdReadyAsync() {
|
|
139
|
-
|
|
358
|
+
console.log(`[Venus SDK] [RpcAdsApi] isRewardedAdReadyAsync`);
|
|
359
|
+
const response = await this.rpcClient.call(
|
|
360
|
+
"H5_IS_REWARDED_AD_READY" /* IS_REWARDED_AD_READY */
|
|
361
|
+
);
|
|
362
|
+
return response.ready;
|
|
140
363
|
}
|
|
141
364
|
async showRewardedAdAsync() {
|
|
142
365
|
console.log("[Venus SDK] [RpcAdsApi] showRewardedAdAsync");
|
|
@@ -173,6 +396,8 @@ var MockAdsApi = class {
|
|
|
173
396
|
}
|
|
174
397
|
async showInterstitialAd() {
|
|
175
398
|
this.log(`[MockAdsApi] showInterstitialAd`);
|
|
399
|
+
await this.mockOverlay.showAdOverlay();
|
|
400
|
+
this.log("[MockAdsApi] interstitial ad shown");
|
|
176
401
|
return true;
|
|
177
402
|
}
|
|
178
403
|
log(message, ...args) {
|
|
@@ -1537,7 +1762,7 @@ var MockNotificationsApi = class {
|
|
|
1537
1762
|
__publicField(this, "venusApi");
|
|
1538
1763
|
this.venusApi = venusApi;
|
|
1539
1764
|
}
|
|
1540
|
-
async
|
|
1765
|
+
async cancelNotification(notificationId) {
|
|
1541
1766
|
const venusApi = this.venusApi;
|
|
1542
1767
|
if (isWebPlatform()) {
|
|
1543
1768
|
console.log(
|
|
@@ -1578,16 +1803,16 @@ var MockNotificationsApi = class {
|
|
|
1578
1803
|
const isEnabled = venusApi._mock.notificationsEnabled !== false;
|
|
1579
1804
|
return isEnabled;
|
|
1580
1805
|
}
|
|
1581
|
-
async
|
|
1806
|
+
async scheduleAsync(options) {
|
|
1582
1807
|
if (isWebPlatform()) {
|
|
1583
1808
|
console.log(
|
|
1584
1809
|
"[Venus Mock] Notifications not supported on web platform, simulating success"
|
|
1585
1810
|
);
|
|
1586
1811
|
console.info(
|
|
1587
1812
|
"\u{1F514} [Venus Mock] Notification would be scheduled:",
|
|
1588
|
-
title || "Untitled",
|
|
1813
|
+
options.title || "Untitled",
|
|
1589
1814
|
"\n Body:",
|
|
1590
|
-
body || "No body",
|
|
1815
|
+
options.body || "No body",
|
|
1591
1816
|
"\n This is a simulation - real notifications require a native platform."
|
|
1592
1817
|
);
|
|
1593
1818
|
const mockId = `mock-web-notification-${Date.now()}`;
|
|
@@ -1608,9 +1833,11 @@ var MockNotificationsApi = class {
|
|
|
1608
1833
|
venusApi._mock.scheduledNotifications = {};
|
|
1609
1834
|
}
|
|
1610
1835
|
venusApi._mock.scheduledNotifications[notificationId] = {
|
|
1611
|
-
...options,
|
|
1612
1836
|
id: notificationId,
|
|
1613
|
-
|
|
1837
|
+
title: options.title,
|
|
1838
|
+
body: options.body,
|
|
1839
|
+
payload: options.payload,
|
|
1840
|
+
trigger: options.trigger
|
|
1614
1841
|
};
|
|
1615
1842
|
setTimeout(() => {
|
|
1616
1843
|
resolve(notificationId);
|
|
@@ -1633,36 +1860,76 @@ var MockNotificationsApi = class {
|
|
|
1633
1860
|
}
|
|
1634
1861
|
};
|
|
1635
1862
|
|
|
1636
|
-
// src/notifications/
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
const
|
|
1652
|
-
|
|
1653
|
-
|
|
1863
|
+
// src/notifications/RpcNotificationsApi.ts
|
|
1864
|
+
var RpcNotificationsApi = class {
|
|
1865
|
+
constructor(rpcClient) {
|
|
1866
|
+
__publicField(this, "rpcClient");
|
|
1867
|
+
this.rpcClient = rpcClient;
|
|
1868
|
+
}
|
|
1869
|
+
async scheduleAsync(options) {
|
|
1870
|
+
const request = {
|
|
1871
|
+
title: options.title,
|
|
1872
|
+
body: options.body,
|
|
1873
|
+
data: options.payload,
|
|
1874
|
+
key: options.groupId,
|
|
1875
|
+
priority: options.priority || 1,
|
|
1876
|
+
trigger: options.trigger
|
|
1877
|
+
};
|
|
1878
|
+
const response = await this.rpcClient.call(
|
|
1879
|
+
"H5_SCHEDULE_LOCAL_NOTIFICATION" /* SCHEDULE_LOCAL_NOTIFICATION */,
|
|
1880
|
+
request
|
|
1881
|
+
);
|
|
1882
|
+
if (response.scheduled) {
|
|
1883
|
+
return response.id;
|
|
1884
|
+
}
|
|
1885
|
+
return null;
|
|
1886
|
+
}
|
|
1887
|
+
async cancelNotification(id) {
|
|
1888
|
+
const result = await this.rpcClient.call(
|
|
1889
|
+
"H5_CANCEL_LOCAL_NOTIFICATION" /* CANCEL_LOCAL_NOTIFICATION */,
|
|
1654
1890
|
{
|
|
1655
|
-
|
|
1656
|
-
priority: options.priority,
|
|
1657
|
-
groupId: options.groupId,
|
|
1658
|
-
payload: options.payload
|
|
1891
|
+
id
|
|
1659
1892
|
}
|
|
1660
1893
|
);
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1894
|
+
return result.canceled;
|
|
1895
|
+
}
|
|
1896
|
+
async getAllScheduledLocalNotifications() {
|
|
1897
|
+
const response = await this.rpcClient.call(
|
|
1898
|
+
"H5_GET_ALL_SCHEDULED_LOCAL_NOTIFICATIONS" /* GET_ALL_SCHEDULED_LOCAL_NOTIFICATIONS */,
|
|
1899
|
+
{}
|
|
1900
|
+
);
|
|
1901
|
+
const notifications = response.notifications.map((notif) => {
|
|
1902
|
+
return {
|
|
1903
|
+
id: notif.identifier,
|
|
1904
|
+
title: notif.content.title,
|
|
1905
|
+
body: notif.content.body,
|
|
1906
|
+
payload: notif.content.data,
|
|
1907
|
+
trigger: notif.trigger
|
|
1908
|
+
};
|
|
1909
|
+
});
|
|
1910
|
+
return notifications;
|
|
1911
|
+
}
|
|
1912
|
+
async isLocalNotificationsEnabled() {
|
|
1913
|
+
const response = await this.rpcClient.call(
|
|
1914
|
+
"H5_IS_LOCAL_NOTIFICATIONS_ENABLED" /* IS_LOCAL_NOTIFICATIONS_ENABLED */,
|
|
1915
|
+
{}
|
|
1916
|
+
);
|
|
1917
|
+
return response.enabled;
|
|
1918
|
+
}
|
|
1919
|
+
async setLocalNotificationsEnabled(enabled) {
|
|
1920
|
+
const response = await this.rpcClient.call(
|
|
1921
|
+
"H5_SET_LOCAL_NOTIFICATIONS_ENABLED" /* SET_LOCAL_NOTIFICATIONS_ENABLED */,
|
|
1922
|
+
{
|
|
1923
|
+
enabled
|
|
1924
|
+
}
|
|
1925
|
+
);
|
|
1926
|
+
return response.enabled;
|
|
1927
|
+
}
|
|
1928
|
+
};
|
|
1929
|
+
|
|
1930
|
+
// src/notifications/index.ts
|
|
1931
|
+
function initializeLocalNotifications(venusApi, host) {
|
|
1932
|
+
venusApi.notifications = host.notifications;
|
|
1666
1933
|
}
|
|
1667
1934
|
|
|
1668
1935
|
// src/popups/RpcPopupsApi.ts
|
|
@@ -1810,17 +2077,22 @@ function initializePopups(venusApi, host) {
|
|
|
1810
2077
|
// src/profile/HostProfileApi.ts
|
|
1811
2078
|
var HostProfileApi = class {
|
|
1812
2079
|
getCurrentProfile() {
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
2080
|
+
const profile = window.venus?.profile;
|
|
2081
|
+
if (!profile) {
|
|
2082
|
+
throw new Error(
|
|
2083
|
+
"[Venus SDK] Host profile handshake did not complete. Await VenusAPI.initializeAsync() so INIT_SDK can deliver the profile before calling profile APIs."
|
|
2084
|
+
);
|
|
2085
|
+
}
|
|
2086
|
+
if (!profile.id || !profile.username) {
|
|
2087
|
+
throw new Error(
|
|
2088
|
+
"[Venus SDK] INIT_SDK returned an incomplete profile (missing id/username). The host must supply real credentials before rooms APIs are used."
|
|
2089
|
+
);
|
|
1819
2090
|
}
|
|
1820
2091
|
return {
|
|
1821
|
-
id:
|
|
1822
|
-
|
|
1823
|
-
|
|
2092
|
+
id: profile.id,
|
|
2093
|
+
username: profile.username,
|
|
2094
|
+
avatarUrl: profile.avatarUrl,
|
|
2095
|
+
isAnonymous: profile.isAnonymous
|
|
1824
2096
|
};
|
|
1825
2097
|
}
|
|
1826
2098
|
};
|
|
@@ -1831,7 +2103,8 @@ var MockProfileApi = class {
|
|
|
1831
2103
|
return {
|
|
1832
2104
|
id: "mock_profile_123",
|
|
1833
2105
|
name: "Mock User",
|
|
1834
|
-
username: "mockuser"
|
|
2106
|
+
username: "mockuser",
|
|
2107
|
+
isAnonymous: false
|
|
1835
2108
|
};
|
|
1836
2109
|
}
|
|
1837
2110
|
};
|
|
@@ -3276,7 +3549,7 @@ function initializeTime(venusApi, host) {
|
|
|
3276
3549
|
}
|
|
3277
3550
|
|
|
3278
3551
|
// src/version.ts
|
|
3279
|
-
var SDK_VERSION = "2.
|
|
3552
|
+
var SDK_VERSION = "2.6.2";
|
|
3280
3553
|
|
|
3281
3554
|
// src/shared-assets/consts.ts
|
|
3282
3555
|
var BurgerTimeAssetsCdnPath = "burger-time/Core.stow";
|
|
@@ -3347,6 +3620,47 @@ var MockSharedAssetsApi = class {
|
|
|
3347
3620
|
}
|
|
3348
3621
|
};
|
|
3349
3622
|
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3623
|
+
// src/game-preloader/MockPreloaderApi.ts
|
|
3624
|
+
var MockPreloaderApi = class {
|
|
3625
|
+
async showLoadScreen() {
|
|
3626
|
+
console.log("showLoadScreen");
|
|
3627
|
+
}
|
|
3628
|
+
async hideLoadScreen() {
|
|
3629
|
+
console.log("hideLoadScreen");
|
|
3630
|
+
}
|
|
3631
|
+
async setLoaderText(text) {
|
|
3632
|
+
console.log("setLoaderText", text);
|
|
3633
|
+
}
|
|
3634
|
+
async setLoaderProgress(progress) {
|
|
3635
|
+
console.log("setLoaderProgress", progress);
|
|
3636
|
+
}
|
|
3637
|
+
};
|
|
3638
|
+
|
|
3639
|
+
// src/game-preloader/RpcPreloaderApi.ts
|
|
3640
|
+
var RpcPreloaderApi = class {
|
|
3641
|
+
constructor(rpcClient) {
|
|
3642
|
+
__publicField(this, "rpcClient");
|
|
3643
|
+
this.rpcClient = rpcClient;
|
|
3644
|
+
}
|
|
3645
|
+
async showLoadScreen() {
|
|
3646
|
+
await this.rpcClient.call("H5_SHOW_LOAD_SCREEN" /* H5_SHOW_LOAD_SCREEN */);
|
|
3647
|
+
}
|
|
3648
|
+
async hideLoadScreen() {
|
|
3649
|
+
await this.rpcClient.call("H5_HIDE_LOAD_SCREEN" /* H5_HIDE_LOAD_SCREEN */);
|
|
3650
|
+
}
|
|
3651
|
+
async setLoaderText(text) {
|
|
3652
|
+
await this.rpcClient.call("H5_SET_LOADER_TEXT" /* H5_SET_LOADER_TEXT */, { text });
|
|
3653
|
+
}
|
|
3654
|
+
async setLoaderProgress(progress) {
|
|
3655
|
+
await this.rpcClient.call("H5_SET_LOADER_PROGRESS" /* H5_SET_LOADER_PROGRESS */, { progress });
|
|
3656
|
+
}
|
|
3657
|
+
};
|
|
3658
|
+
|
|
3659
|
+
// src/game-preloader/index.ts
|
|
3660
|
+
function initializePreloader(venusApi, host) {
|
|
3661
|
+
venusApi.preloader = host.preloader;
|
|
3662
|
+
}
|
|
3663
|
+
|
|
3664
|
+
export { HapticFeedbackStyle, HostCdnApi, HostProfileApi, HostTimeApi, MockAdsApi, MockAiApi, MockAnalyticsApi, MockAvatarApi, MockCdnApi, MockFeaturesApi, MockHapticsApi, MockIapApi, MockLifecycleApi, MockLoggingApi, MockNavigationApi, MockNotificationsApi, MockPopupsApi, MockPreloaderApi, MockProfileApi, MockSharedAssetsApi, MockSimulationApi, MockStorageApi, MockTimeApi, RpcAdsApi, RpcAiApi, RpcAnalyticsApi, RpcAvatarApi, RpcClient, RpcFeaturesApi, RpcHapticsApi, RpcIapApi, RpcLifecycleApi, RpcLoggingApi, RpcNavigationApi, RpcNotificationsApi, RpcPopupsApi, RpcPreloaderApi, RpcSharedAssetsApi, RpcSimulationApi, RpcStorageApi, SDK_VERSION, VenusMessageId, VenusRoom, createMockStorageApi, init_VenusRoom, init_rooms, initializeAds, initializeAi, initializeAnalytics, initializeAvatar3d, initializeCdn, initializeFeaturesApi, initializeHaptics, initializeIap, initializeLifecycleApi, initializeLocalNotifications, initializeLoggingApi, initializePopups, initializePreloader, initializeProfile, initializeRoomsApi, initializeSimulation, initializeStackNavigation, initializeStorage, initializeTime, isPacificDaylightTime, rooms_exports, setupRoomNotifications };
|
|
3665
|
+
//# sourceMappingURL=chunk-YDXFZ2A2.mjs.map
|
|
3666
|
+
//# sourceMappingURL=chunk-YDXFZ2A2.mjs.map
|