HEX
Server: Apache/2.4.63 (Unix)
System: Linux Synopilou92 4.4.302+ #72806 SMP Mon Jul 21 23:16:00 CST 2025 x86_64
User: pilou92 (1026)
PHP: 8.0.30
Disabled: NONE
Upload Files
File: /volume1/@appstore/SynologyApplicationService/ui/browser_pair/js/webapi.js
!function(e){SYNO=e.SYNO||{},STRINGS={},SYNO.Request=function(e,t,n){return new Promise((function(o,s){var i=new XMLHttpRequest;i.open(e,t),i.onload=function(){this.status>=200&&this.status<300?o(i.response):s({status:this.status,statusText:i.statusText})},i.onerror=function(){s({status:this.status,statusText:i.statusText})},n&&""!==n?i.send(n):i.send()}))},SYNO.EscapeKeys=["ds_id","auth","p256dh","public_key","browser_key"],SYNO.UrlEncode=function(e,t){var n="",o="boolean"!=typeof t||t;if(e)for(key in e)n+=""===n?"":"&",n="string"==typeof e[key]&&o&&SYNO.EscapeKeys.indexOf(key)>=0?n+encodeURIComponent(key)+'="'+encodeURIComponent(e[key])+'"':n+encodeURIComponent(key)+"="+encodeURIComponent(e[key]);return n},SYNO.APIRequest=function(e,t,n,o,s){var i="boolean"!=typeof s||s,r=window.location.pathname.replace("/webman/3rdparty/SynologyApplicationService/browser_pair/pair.html","/webapi/entry.cgi"),u=window.location.origin+r,a=Object.assign(o,{api:e,method:t,version:n});return new Promise((function(e,t){SYNO.Request("POST",u,SYNO.UrlEncode(a,i)).then((function(n){try{var o=JSON.parse(n);e(o)}catch(e){t({success:!1,error:"network"})}})).catch((function(e){t({success:!1,error:"network"})}))}))},SYNO.GetStrings=function(e){return SYNO.Request("GET","../texts/"+e+"/strings").then((function(e){var t;e.match(/[^\r\n]+/g).forEach((function(e){if("#"!=e[0]){var n=e.match(/\[(.*?)\]/);if(null!==n&&2==n.length)return t=n[1],void(STRINGS[t]={});var o=e.match(/\s*(.*?)\s*=\s*"(.*)"\s*/);null!==o&&3==o.length&&(STRINGS[t][o[1]]=o[2])}}))}))},SYNO.GetDSIDRequest=function(e){return SYNO.APIRequest("SYNO.Personal.Notification.Identifier","get","1",e)},SYNO.GetTokenRequest=function(e){return SYNO.APIRequest("SYNO.Personal.Notification.Token","get","1",e)},SYNO.SendPairRequest=function(e){return SYNO.APIRequest("SYNO.Personal.Notification.Mobile","pair","1",e)},SYNO.GetVapidPKeyRequest=function(e){return SYNO.APIRequest("SYNO.Personal.Notification.VapidPublicKey","get","1",e)},SYNO.SendEncryptStatusRequest=function(e){return SYNO.APIRequest("SYNO.SAS.Encryption","status","1",e)},SYNO.SendEncryptExchangeRequest=function(e){return SYNO.APIRequest("SYNO.SAS.Encryption","exchange","1",e)},SYNO.GetGDPRSettingRequest=function(e){return SYNO.APIRequest("SYNO.Personal.Notification.GDPR","get","1",e)},SYNO.SetGDPRSettingRequest=function(e){return SYNO.APIRequest("SYNO.Personal.Notification.GDPR","set","1",e)},"undefined"!=typeof module&&module.exports?module.exports=SYNO:e.SYNO||(e.SYNO=SYNO)}(this);