@idosgames/core 0.26.1 → 0.26.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.
- package/dist/{VoiceController-DpMCYqPG.d.cts → VoiceController-CEs7dzqz.d.cts} +67 -2
- package/dist/{VoiceController-BD33ZRHg.d.ts → VoiceController-jjr1_vwJ.d.ts} +67 -2
- package/dist/{chunk-YSPGQWAB.js → chunk-4VTWZXB4.js} +2 -2
- package/dist/{index-DMmtsWR2.d.cts → index-BCY6F_tf.d.cts} +10 -1
- package/dist/{index-BKjfSSxG.d.ts → index-YNXpT5ol.d.ts} +10 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/platform/index.cjs +2 -2
- package/dist/platform/index.d.cts +1 -1
- package/dist/platform/index.d.ts +1 -1
- package/dist/platform/index.js +1 -1
- package/dist/realtime/index.d.cts +2 -2
- package/dist/realtime/index.d.ts +2 -2
- package/package.json +1 -1
package/dist/platform/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var f=class{getString(e){if(typeof localStorage>"u")return null;try{return localStorage.getItem(e)}catch{return null}}setString(e,r){if(!(typeof localStorage>"u"))try{localStorage.setItem(e,r);}catch{}}remove(e){if(!(typeof localStorage>"u"))try{localStorage.removeItem(e);}catch{}}},g=class{map=new Map;getString(e){return this.map.get(e)??null}setString(e,r){this.map.set(e,r);}remove(e){this.map.delete(e);}};function n(){return globalThis.Telegram?.WebApp??null}function M(){return crypto.randomUUID()}var
|
|
2
|
-
exports.BrowserPlatformAdapter=w;exports.BrowserStorage=f;exports.MemoryStorage=g;exports.NoopPlatformAdapter=P;exports.PLATFORM_BRIDGE_ACK=
|
|
1
|
+
'use strict';var f=class{getString(e){if(typeof localStorage>"u")return null;try{return localStorage.getItem(e)}catch{return null}}setString(e,r){if(!(typeof localStorage>"u"))try{localStorage.setItem(e,r);}catch{}}remove(e){if(!(typeof localStorage>"u"))try{localStorage.removeItem(e);}catch{}}},g=class{map=new Map;getString(e){return this.map.get(e)??null}setString(e,r){this.map.set(e,r);}remove(e){this.map.delete(e);}};function n(){return globalThis.Telegram?.WebApp??null}function M(){return crypto.randomUUID()}var v="idos_device_id",w=class{storage;constructor(e=new f){this.storage=e;}getPlatform(){return n()?.platform??"Web"}getFullURL(){return typeof location<"u"?location.href:""}getStartParameter(){let e=n()?.initDataUnsafe?.start_param;return typeof e=="string"?e:null}getReferrer(){if(typeof document>"u")return null;let e=document.referrer;return e&&e.length>0?e:null}getTelegramInitDataRaw(){let e=n()?.initData;return e&&e.length>0?e:null}getDeviceID(){let e=this.storage.getString(v);return e||(e=M(),this.storage.setString(v,e)),e}getDeviceModel(){return typeof navigator<"u"&&navigator.userAgent?navigator.userAgent:"Web"}shareLink(e){let r=n();if(r?.openTelegramLink){r.openTelegramLink(e);return}typeof window<"u"&&window.open(e,"_blank");}openInvoice(e){let r=n();if(r?.openInvoice){r.openInvoice(e);return}typeof window<"u"&&window.open(e,"_blank");}async showAd(e){let r=globalThis;typeof r.showAd=="function"&&await r.showAd(e);}async copyToClipboard(e){typeof navigator<"u"&&navigator.clipboard&&await navigator.clipboard.writeText(e);}};var h="idos_device_id",P=class{storage;constructor(e=new g){this.storage=e;}getPlatform(){return "Web"}getFullURL(){return ""}getStartParameter(){return null}getTelegramInitDataRaw(){return null}getDeviceID(){let e=this.storage.getString(h);return e||(e="noop-device",this.storage.setString(h,e)),e}getDeviceModel(){return "Noop"}shareLink(){}openInvoice(){}async showAd(){}async copyToClipboard(){}};var s=["https://idosgames.com","https://www.idosgames.com"],u="https://platform.idosgames.com",U=/^[a-z0-9]{8}-preview\.idos\.games$/;function I(t){return t==="localhost"||t==="127.0.0.1"||t==="[::1]"||t.endsWith(".localhost")}function x(){if(typeof window>"u")return false;let t=window.location.hostname.toLowerCase();return U.test(t)?true:I(t)&&globalThis.__IDOS_PREVIEW__!=null}function p(t){if(typeof window<"u"&&U.test(window.location.hostname.toLowerCase()))return t===u;if(s.includes(t))return true;if(typeof window>"u"||!I(window.location.hostname))return false;try{return I(new URL(t).hostname)}catch{return false}}var L="IDOS_PLATFORM_WALLET_ACK",C="PLATFORM_WALLET_UNAVAILABLE",N=5e3,F=18e4;function W(){if(p(u))return [u];let t=[...s],e=window.location.ancestorOrigins?.[0];return e&&!t.includes(e)&&p(e)&&t.push(e),t}function G(){return `wallet-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function i(t,e,r,l={}){let c={ok:false,error:C,data:{}};if(typeof window>"u"||window.self===window.top)return Promise.resolve(c);let y=window.parent;if(!y)return Promise.resolve(c);let E=G(),k=l.answerTimeoutMs??F;return new Promise(b=>{let D=false,m,d=a=>{D||(D=true,window.removeEventListener("message",O),clearTimeout(m),b(a));},O=a=>{if(!p(a.origin))return;let o=a.data;if(!(!o||o.requestId!==E)){if(o.type===L){clearTimeout(m),m=setTimeout(()=>d({ok:false,error:"TIMEOUT",data:{}}),k);return}o.type===e&&d({ok:o.ok===true,error:typeof o.error=="string"?o.error:void 0,data:o});}};m=setTimeout(()=>d(c),N),window.addEventListener("message",O);for(let a of W())try{y.postMessage({type:t,requestId:E,...r},a);}catch{}})}var S={request:"IDOS_PLATFORM_TOPUP_REQUEST",response:"IDOS_PLATFORM_TOPUP_RESPONSE"},V=15*6e4,K=/^[a-z0-9]{8}-preview\.idos\.games$/;function T(){if(typeof window>"u")return false;try{if(window.self===window.top||window.parent!==window.top)return !1}catch{return false}return !K.test(window.location.hostname.toLowerCase())}async function q(t){let e=await i(S.request,S.response,{titleID:t.titleID,userID:t.userID,currencyID:t.currencyID,amount:t.amount},{answerTimeoutMs:V});return e.ok?{ok:true}:{ok:false,error:e.error}}var _={request:"IDOS_PLATFORM_AUTH_REQUEST",response:"IDOS_PLATFORM_AUTH_RESPONSE"},B=30*6e4,A="idos:platformSignIn:declined:";function H(){if(typeof window>"u")return false;try{if(window.self===window.top||window.parent!==window.top)return !1}catch{return false}if(x())return false;let t=window.location.ancestorOrigins?.[0];if(t&&!s.includes(t))try{let e=new URL(t).hostname;if(e!=="localhost"&&e!=="127.0.0.1")return !1}catch{return false}return true}async function $(t){let e=await i(_.request,_.response,{titleID:t,supports:["pgs"]},{answerTimeoutMs:B}),r=e.data.ticket;if(e.ok&&typeof r=="string"&&r.length>0)return {ticket:r};let l=e.data.code;return e.ok&&typeof l=="string"&&l.length>0?{code:l}:{error:e.error??"no_code"}}function Q(t){try{window.localStorage.setItem(A+t,"1");}catch{}}function Y(t){try{window.localStorage.removeItem(A+t);}catch{}}function z(t){try{return window.localStorage.getItem(A+t)==="1"}catch{return false}}var R={request:"IDOS_PLATFORM_CREDITS_CONFIRM_REQUEST",response:"IDOS_PLATFORM_CREDITS_CONFIRM_RESPONSE"},X=10*6e4;function j(){let t=globalThis.navigator?.userAgent??"";if(!/\biDosGamesApp\/(?:player|studio)\//.test(t))return true;let e=/\biDosGamesPlatform\/(ios|android)\b/.exec(t);return (e?e[1]:/\bAndroid\b/.test(t)?"android":"ios")!=="ios"}function J(){return T()}async function Z(t){let e=await i(R.request,R.response,{titleID:t.titleID,confirmationID:t.confirmationID},{answerTimeoutMs:X});return e.ok?{ok:true}:{ok:false,error:e.error}}
|
|
2
|
+
exports.BrowserPlatformAdapter=w;exports.BrowserStorage=f;exports.MemoryStorage=g;exports.NoopPlatformAdapter=P;exports.PLATFORM_BRIDGE_ACK=L;exports.PLATFORM_CREDITS_CONFIRM_MESSAGES=R;exports.PLATFORM_ORIGINS=s;exports.PLATFORM_PAGE_UNAVAILABLE=C;exports.PLATFORM_SIGN_IN_MESSAGES=_;exports.PLATFORM_TOPUP_MESSAGES=S;exports.askPlatformPage=i;exports.canPayWithPlatformCredits=j;exports.canUsePlatformCreditsConfirm=J;exports.canUsePlatformSignIn=H;exports.canUsePlatformTopUp=T;exports.clearPlatformSignInDeclined=Y;exports.getTelegramWebApp=n;exports.isPlatformParentOrigin=p;exports.isPlatformSignInDeclined=z;exports.markPlatformSignInDeclined=Q;exports.requestPlatformCreditsConfirm=Z;exports.requestPlatformSignIn=$;exports.requestPlatformTopUp=q;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { K as KeyValueStorage, P as PlatformAdapter } from '../PlatformAdapter-DU_8HalI.cjs';
|
|
2
|
-
export { B as BrowserPlatformAdapter, a as BrowserStorage, M as MemoryStorage, N as NoopPlatformAdapter, P as PLATFORM_BRIDGE_ACK, b as PLATFORM_CREDITS_CONFIRM_MESSAGES, c as PLATFORM_ORIGINS, d as PLATFORM_PAGE_UNAVAILABLE, e as PLATFORM_SIGN_IN_MESSAGES, f as PLATFORM_TOPUP_MESSAGES, g as PlatformCreditsConfirmResult, h as PlatformPageAnswer, i as PlatformSignInAnswer, j as PlatformTopUpRequest, k as PlatformTopUpResult, T as TelegramInitDataUnsafe, l as TelegramWebApp, m as askPlatformPage, n as
|
|
2
|
+
export { B as BrowserPlatformAdapter, a as BrowserStorage, M as MemoryStorage, N as NoopPlatformAdapter, P as PLATFORM_BRIDGE_ACK, b as PLATFORM_CREDITS_CONFIRM_MESSAGES, c as PLATFORM_ORIGINS, d as PLATFORM_PAGE_UNAVAILABLE, e as PLATFORM_SIGN_IN_MESSAGES, f as PLATFORM_TOPUP_MESSAGES, g as PlatformCreditsConfirmResult, h as PlatformPageAnswer, i as PlatformSignInAnswer, j as PlatformTopUpRequest, k as PlatformTopUpResult, T as TelegramInitDataUnsafe, l as TelegramWebApp, m as askPlatformPage, n as canPayWithPlatformCredits, o as canUsePlatformCreditsConfirm, p as canUsePlatformSignIn, q as canUsePlatformTopUp, s as clearPlatformSignInDeclined, z as getTelegramWebApp, t as isPlatformParentOrigin, u as isPlatformSignInDeclined, v as markPlatformSignInDeclined, w as requestPlatformCreditsConfirm, x as requestPlatformSignIn, y as requestPlatformTopUp } from '../index-BCY6F_tf.cjs';
|
package/dist/platform/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { K as KeyValueStorage, P as PlatformAdapter } from '../PlatformAdapter-DU_8HalI.js';
|
|
2
|
-
export { B as BrowserPlatformAdapter, a as BrowserStorage, M as MemoryStorage, N as NoopPlatformAdapter, P as PLATFORM_BRIDGE_ACK, b as PLATFORM_CREDITS_CONFIRM_MESSAGES, c as PLATFORM_ORIGINS, d as PLATFORM_PAGE_UNAVAILABLE, e as PLATFORM_SIGN_IN_MESSAGES, f as PLATFORM_TOPUP_MESSAGES, g as PlatformCreditsConfirmResult, h as PlatformPageAnswer, i as PlatformSignInAnswer, j as PlatformTopUpRequest, k as PlatformTopUpResult, T as TelegramInitDataUnsafe, l as TelegramWebApp, m as askPlatformPage, n as
|
|
2
|
+
export { B as BrowserPlatformAdapter, a as BrowserStorage, M as MemoryStorage, N as NoopPlatformAdapter, P as PLATFORM_BRIDGE_ACK, b as PLATFORM_CREDITS_CONFIRM_MESSAGES, c as PLATFORM_ORIGINS, d as PLATFORM_PAGE_UNAVAILABLE, e as PLATFORM_SIGN_IN_MESSAGES, f as PLATFORM_TOPUP_MESSAGES, g as PlatformCreditsConfirmResult, h as PlatformPageAnswer, i as PlatformSignInAnswer, j as PlatformTopUpRequest, k as PlatformTopUpResult, T as TelegramInitDataUnsafe, l as TelegramWebApp, m as askPlatformPage, n as canPayWithPlatformCredits, o as canUsePlatformCreditsConfirm, p as canUsePlatformSignIn, q as canUsePlatformTopUp, s as clearPlatformSignInDeclined, z as getTelegramWebApp, t as isPlatformParentOrigin, u as isPlatformSignInDeclined, v as markPlatformSignInDeclined, w as requestPlatformCreditsConfirm, x as requestPlatformSignIn, y as requestPlatformTopUp } from '../index-YNXpT5ol.js';
|
package/dist/platform/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{e as BrowserPlatformAdapter,a as BrowserStorage,b as MemoryStorage,
|
|
1
|
+
export{e as BrowserPlatformAdapter,a as BrowserStorage,b as MemoryStorage,y as NoopPlatformAdapter,h as PLATFORM_BRIDGE_ACK,u as PLATFORM_CREDITS_CONFIRM_MESSAGES,f as PLATFORM_ORIGINS,i as PLATFORM_PAGE_UNAVAILABLE,k as PLATFORM_SIGN_IN_MESSAGES,r as PLATFORM_TOPUP_MESSAGES,j as askPlatformPage,v as canPayWithPlatformCredits,w as canUsePlatformCreditsConfirm,l as canUsePlatformSignIn,s as canUsePlatformTopUp,p as clearPlatformSignInDeclined,c as getTelegramWebApp,g as isPlatformParentOrigin,q as isPlatformSignInDeclined,o as markPlatformSignInDeclined,x as requestPlatformCreditsConfirm,n as requestPlatformSignIn,t as requestPlatformTopUp}from'../chunk-4VTWZXB4.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as IceServer } from '../VoiceController-
|
|
2
|
-
export { C as ChannelName, M as MemberLeftKind, a as MicMode, R as RealtimeClient, b as RealtimeSession, c as RealtimeSessionEvents, d as RealtimeSessionOptions, V as VoiceController, e as VoiceControllerEvents, f as VoiceControllerOptions } from '../VoiceController-
|
|
1
|
+
import { I as IceServer } from '../VoiceController-CEs7dzqz.cjs';
|
|
2
|
+
export { C as ChannelName, M as MemberLeftKind, a as MicMode, R as RealtimeClient, b as RealtimeSession, c as RealtimeSessionEvents, d as RealtimeSessionOptions, V as VoiceController, e as VoiceControllerEvents, f as VoiceControllerOptions } from '../VoiceController-CEs7dzqz.cjs';
|
|
3
3
|
import 'zod';
|
|
4
4
|
import '../PlatformAdapter-DU_8HalI.cjs';
|
|
5
5
|
import 'decimal.js';
|
package/dist/realtime/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as IceServer } from '../VoiceController-
|
|
2
|
-
export { C as ChannelName, M as MemberLeftKind, a as MicMode, R as RealtimeClient, b as RealtimeSession, c as RealtimeSessionEvents, d as RealtimeSessionOptions, V as VoiceController, e as VoiceControllerEvents, f as VoiceControllerOptions } from '../VoiceController-
|
|
1
|
+
import { I as IceServer } from '../VoiceController-jjr1_vwJ.js';
|
|
2
|
+
export { C as ChannelName, M as MemberLeftKind, a as MicMode, R as RealtimeClient, b as RealtimeSession, c as RealtimeSessionEvents, d as RealtimeSessionOptions, V as VoiceController, e as VoiceControllerEvents, f as VoiceControllerOptions } from '../VoiceController-jjr1_vwJ.js';
|
|
3
3
|
import 'zod';
|
|
4
4
|
import '../PlatformAdapter-DU_8HalI.js';
|
|
5
5
|
import 'decimal.js';
|