New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

virsical-jssdk

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

virsical-jssdk - npm Package Compare versions

Comparing version 0.3.5 to 0.3.6

2

lib/test.js

@@ -1,1 +0,1 @@

!function(e,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var o=n();for(var t in o)("object"==typeof exports?exports:e)[t]=o[t]}}(this,function(){return function(e){function n(t){if(o[t])return o[t].exports;var r=o[t]={exports:{},id:t,loaded:!1};return e[t].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}var o={};return n.m=e,n.c=o,n.p="",n(0)}([function(e,n,o){"use strict";function t(e){return e&&e.__esModule?e:{default:e}}var r=o(1),i=t(r);console.log("---------test----------"),console.log("Virsical",i.default),console.log("config",r.config),console.log("configReady",window.configReady),console.log("---------end----------")},function(e,n,o){!function(n,o){e.exports=o()}(this,function(){return function(e){function n(t){if(o[t])return o[t].exports;var r=o[t]={exports:{},id:t,loaded:!1};return e[t].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}var o={};return n.m=e,n.c=o,n.p="",n(0)}([function(e,n,o){"use strict";function t(){f(),v&&v()}Object.defineProperty(n,"__esModule",{value:!0});var r=o(2).QWebChannel,i=!1,c=0,a=1,s=2,d=3,l=4,f=function(){return sessionStorage.setItem("configStatus",!0)},u=function(){return!0},p=function(e,n){try{new r(qt.webChannelTransport,function(o){var t=o.objects.content;t.clickConfig(e,n)})}catch(e){throw new Error(e)}},_=function(){var e=navigator.userAgent;return i&&console.log("Virsical: ",e),e.indexOf("Android")>-1||e.indexOf("Adr")>-1?a:e.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)?s:e.match(/Mac OS X/)?d:e.indexOf("QtWebEngine")>-1?l:c},g=function(e){i=e.debug;var n=_();if(n==a)try{window.control?window.control.config(e.debug,e.client_id,e.client_secret):window.location.href="vsk3browser://config?debug="+e.debug+"&clientid="+e.client_id+"&clientsecret="+e.client_secret}catch(e){throw new Error(e)}else if(n==s||n==d)window.location.href="vsk3browser://config?debug="+e.debug+"&clientid="+e.client_id+"&clientsecret="+e.client_secret;else{if(n!=l)throw new Error("Device validation failed, only support for mobile devices");p(e.client_id,e.client_secret)}},v=void 0,w=function(e){return v=e},h=void 0,b=function(e){return h=e},y=function(e,n){return h&&h({msg:e,code:n})},m=void 0,j=void 0,x=void 0,C=function(e){if(!u())return window.console.error("no config, please using Virsical.config(...) to config your app."),void alert("Please config app first");j=e.success,x=e.fail;var n=_();if(n==a)try{window.control?window.control.login():window.location.href="vsk3browser://login"}catch(e){throw new Error(e)}else n==s||n==d?window.location.href="vsk3browser://login":n==l&&new r(qt.webChannelTransport,function(e){var n=e.objects.content;n.login()})},S=function(e,n,o,t){clearTimeout(m),0==e?j&&j({info:n}):x&&x({msg:t,code:o})},k=void 0,P=function(e){return u()?(k=e.successCallback,void(_()==a?window.image.selectOne():_()==s)):void alert("Please config app first")},O=function(e){return k({localIds:e})},E=function(e){return u()?void(_()==a?window.image.show(e.ids):_()==s):void alert("Please config app first")},U=void 0,Q=6e4,R=void 0,I=void 0,M=function(e){return u()?(U=setTimeout("locationTimeout()",Q),R=e.success,I=e.fail,void(_()==a?window.map.location():_()==s)):void alert("Please config app first")},T=function(e,n,o,t,r,i){clearTimeout(U),0==e?R({addr:n,lat:o,lng:t}):I({msg:i,code:r})},A=void 0,N=void 0,q=function(e){if(!u())return void alert("Please config app first");A=e.success,N=e.fail;var n=_();n==a?window.captureqr?window.captureqr.scan():window.location.href="vsk3browser://captureqr":n!=s&&n!=d||(window.location.href="vsk3browser://captureqr")},V=function(e,n,o,t){0==e?A({url:n}):N({msg:t,code:o})},J=function(e){return J=e},W=function(e){J&&J(e)},X=void 0,B=void 0,F=function(e){return u()?(X=e.success,B=e.fail,void(_()==a?window.contacts.loadPhoneContacts(e.refresh):_()==s&&(window.location.href="vsk3browser://loadPhoneContacts?refresh="+e.refresh))):void alert("Please config app first")},L=function(e,n,o,t){0==e?X({result:n}):B({msg:t,code:o})};window.configReady=t,window.configError=y,window.loginResult=S,window.imageResult=O,window.locationResult=T,window.captureQRResult=V,window.phoneContactsResult=L,window.sendMessage=W;var D={config:g,ready:w,login:C,error:b,captureQR:q,selectImage:P,previewImage:E,location:M,messageCallback:J,phoneContacts:F};window.Virsical=D,n.default=D},,function(e,n,o){(function(e){"use strict";function n(e,o,r){function i(e,n){var o=e[0],i=e[1];d[o]={connect:function(e){return"function"!=typeof e?void console.error("Bad callback given to connect to signal "+o):(d.__objectSignals__[i]=d.__objectSignals__[i]||[],d.__objectSignals__[i].push(e),void(n||"destroyed"===o||r.exec({type:t.connectToSignal,object:d.__id__,signal:i})))},disconnect:function(e){if("function"!=typeof e)return void console.error("Bad callback given to disconnect from signal "+o);d.__objectSignals__[i]=d.__objectSignals__[i]||[];var c=d.__objectSignals__[i].indexOf(e);return c===-1?void console.error("Cannot find connection of signal "+o+" to "+e.name):(d.__objectSignals__[i].splice(c,1),void(n||0!==d.__objectSignals__[i].length||r.exec({type:t.disconnectFromSignal,object:d.__id__,signal:i})))}}}function c(e,n){var o=d.__objectSignals__[e];o&&o.forEach(function(e){e.apply(e,n)})}function a(e){var n=e[0],o=e[1];d[n]=function(){for(var e,n=[],i=0;i<arguments.length;++i)"function"==typeof arguments[i]?e=arguments[i]:n.push(arguments[i]);r.exec({type:t.invokeMethod,object:d.__id__,method:o,args:n},function(n){if(void 0!==n){var o=d.unwrapQObject(n);e&&e(o)}})}}function s(e){var n=e[0],o=e[1],c=e[2];d.__propertyCache__[n]=e[3],c&&(1===c[0]&&(c[0]=o+"Changed"),i(c,!0)),Object.defineProperty(d,o,{configurable:!0,get:function(){var e=d.__propertyCache__[n];return void 0===e&&console.warn('Undefined value in property cache for property "'+o+'" in object '+d.__id__),e},set:function(e){return void 0===e?void console.warn("Property setter for "+o+" called with undefined value!"):(d.__propertyCache__[n]=e,void r.exec({type:t.setProperty,object:d.__id__,property:n,value:e}))}})}this.__id__=e,r.objects[e]=this,this.__objectSignals__={},this.__propertyCache__={};var d=this;this.unwrapQObject=function(e){if(e instanceof Array){for(var o=new Array(e.length),t=0;t<e.length;++t)o[t]=d.unwrapQObject(e[t]);return o}if(!e||!e["__QObject*__"]||void 0===e.id)return e;var i=e.id;if(r.objects[i])return r.objects[i];if(!e.data)return void console.error("Cannot unwrap unknown QObject "+i+" without data.");var c=new n(i,e.data,r);return c.destroyed.connect(function(){if(r.objects[i]===c){delete r.objects[i];var e=[];for(var n in c)e.push(n);for(var o in e)delete c[e[o]]}}),c.unwrapProperties(),c},this.unwrapProperties=function(){for(var e in d.__propertyCache__)d.__propertyCache__[e]=d.unwrapQObject(d.__propertyCache__[e])},this.propertyUpdate=function(e,n){for(var o in n){var t=n[o];d.__propertyCache__[o]=t}for(var r in e)c(r,e[r])},this.signalEmitted=function(e,n){c(e,n)},o.methods.forEach(a),o.properties.forEach(s),o.signals.forEach(function(e){i(e,!1)});for(var e in o.enums)d[e]=o.enums[e]}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t={signal:1,propertyUpdate:2,init:3,idle:4,debug:5,invokeMethod:6,connectToSignal:7,disconnectFromSignal:8,setProperty:9,response:10},r=function(e,r){if("object"!==("undefined"==typeof e?"undefined":o(e))||"function"!=typeof e.send)return void console.error("The QWebChannel expects a transport object with a send function and onmessage callback property. Given is: transport: "+("undefined"==typeof e?"undefined":o(e))+", transport.send: "+o(e.send));var i=this;this.transport=e,this.send=function(e){"string"!=typeof e&&(e=JSON.stringify(e)),i.transport.send(e)},this.transport.onmessage=function(e){var n=e.data;switch("string"==typeof n&&(n=JSON.parse(n)),n.type){case t.signal:i.handleSignal(n);break;case t.response:i.handleResponse(n);break;case t.propertyUpdate:i.handlePropertyUpdate(n);break;default:console.error("invalid message received:",e.data)}},this.execCallbacks={},this.execId=0,this.exec=function(e,n){return n?(i.execId===Number.MAX_VALUE&&(i.execId=Number.MIN_VALUE),e.hasOwnProperty("id")?void console.error("Cannot exec message with property id: "+JSON.stringify(e)):(e.id=i.execId++,i.execCallbacks[e.id]=n,void i.send(e))):void i.send(e)},this.objects={},this.handleSignal=function(e){var n=i.objects[e.object];n?n.signalEmitted(e.signal,e.args):console.warn("Unhandled signal: "+e.object+"::"+e.signal)},this.handleResponse=function(e){return e.hasOwnProperty("id")?(i.execCallbacks[e.id](e.data),void delete i.execCallbacks[e.id]):void console.error("Invalid response message received: ",JSON.stringify(e))},this.handlePropertyUpdate=function(e){for(var n in e.data){var o=e.data[n],r=i.objects[o.object];r?r.propertyUpdate(o.signals,o.properties):console.warn("Unhandled property update: "+o.object+"::"+o.signal)}i.exec({type:t.idle})},this.debug=function(e){i.send({type:t.debug,data:e})},i.exec({type:t.init},function(e){for(var o in e)var c=new n(o,e[o],i);for(var o in i.objects)i.objects[o].unwrapProperties();r&&r(i),i.exec({type:t.idle})})};"object"===o(e)&&(e.exports={QWebChannel:r})}).call(n,o(3)(e))},function(e,n){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}}])})}])});
!function(e,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var o=n();for(var t in o)("object"==typeof exports?exports:e)[t]=o[t]}}(this,function(){return function(e){function n(t){if(o[t])return o[t].exports;var i=o[t]={exports:{},id:t,loaded:!1};return e[t].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}var o={};return n.m=e,n.c=o,n.p="",n(0)}([function(e,n,o){"use strict";function t(e){return e&&e.__esModule?e:{default:e}}var i=o(1),r=t(i);console.log("---------test----------"),console.log("Virsical",r.default),console.log("config",i.config),console.log("configReady",window.configReady),console.log("---------end----------")},function(e,n,o){!function(n,o){e.exports=o()}(this,function(){return function(e){function n(t){if(o[t])return o[t].exports;var i=o[t]={exports:{},id:t,loaded:!1};return e[t].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}var o={};return n.m=e,n.c=o,n.p="",n(0)}([function(e,n,o){"use strict";function t(){f(),_&&_()}Object.defineProperty(n,"__esModule",{value:!0});var i=o(2).QWebChannel,r=!1,c=0,a=1,s=2,d=3,l=4,f=function(){return sessionStorage.setItem("configStatus",!0)},u=function(){return!0},p=function(e,n){try{new i(qt.webChannelTransport,function(o){var t=o.objects.content;t.clickConfig(e,n)})}catch(e){throw new Error(e)}},v=function(){var e=navigator.userAgent;return r&&console.log("Virsical: ",e),e.indexOf("Android")>-1||e.indexOf("Adr")>-1?a:e.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)?s:e.match(/Mac OS X/)?d:e.indexOf("QtWebEngine")>-1?l:c},w=function(e){r=e.debug;var n=v();if(n==a)try{window.control?window.control.config(e.debug,e.client_id,e.client_secret):window.location.href="vsk3browser://config?debug="+e.debug+"&clientid="+e.client_id+"&clientsecret="+e.client_secret}catch(e){throw new Error(e)}else if(n==s||n==d)window.location.href="vsk3browser://config?debug="+e.debug+"&clientid="+e.client_id+"&clientsecret="+e.client_secret;else{if(n!=l)throw new Error("Device validation failed, only support for mobile devices");p(e.client_id,e.client_secret)}},_=void 0,g=function(e){return _=e},h=void 0,b=function(e){return h=e},y=function(e,n){return h&&h({msg:e,code:n})},m=void 0,j=void 0,x=void 0,S=function(e){if(!u())return window.console.error("no config, please using Virsical.config(...) to config your app."),void alert("Please config app first");j=e.success,x=e.fail;var n=v();if(n==a)try{window.control?window.control.login():window.location.href="vsk3browser://login"}catch(e){throw new Error(e)}else n==s||n==d?window.location.href="vsk3browser://login":n==l&&new i(qt.webChannelTransport,function(e){var n=e.objects.content;n.login()})},k=function(e,n,o,t){clearTimeout(m),0==e?j&&j({info:n}):x&&x({msg:t,code:o})},C=void 0,O=function(e){return u()?(C=e.successCallback,void(v()==a?window.image.selectOne():v()==s)):void alert("Please config app first")},P=function(e){return C({localIds:e})},E=function(e){return u()?void(v()==a?window.image.show(e.ids):v()==s):void alert("Please config app first")},U=void 0,I=6e4,Q=void 0,R=void 0,T=function(e){return u()?(U=setTimeout("locationTimeout()",I),Q=e.success,R=e.fail,void(v()==a?window.map.location():v()==s)):void alert("Please config app first")},M=function(e,n,o,t,i,r){clearTimeout(U),0==e?Q({addr:n,lat:o,lng:t}):R({msg:r,code:i})},A=void 0,N=void 0,q=function(e){if(!u())return void alert("Please config app first");A=e.success,N=e.fail;var n=v();n==a?window.captureqr?window.captureqr.scan():window.location.href="vsk3browser://captureqr":n!=s&&n!=d||(window.location.href="vsk3browser://captureqr")},B=function(e,n,o,t){0==e?A({url:n}):N({msg:t,code:o})},V=function(e){return V=e},J=function(e){V&&V(e)},W=function(e){var n=v();n==s&&(e?window.location.href="vsk3browser://html5?action=hideBack":window.location.href="vsk3browser://html5?action=showBack")},X=void 0,F=void 0,L=function(e){return u()?(X=e.success,F=e.fail,void(v()==a?window.contacts.loadPhoneContacts(e.refresh):v()==s&&(window.location.href="vsk3browser://loadPhoneContacts?refresh="+e.refresh))):void alert("Please config app first")},D=function(e,n,o,t){0==e?X({result:n}):F({msg:t,code:o})},G=function(e){var n=v();(e||""==e)&&(n!=s&&n!=d||(window.location.href="vsk3browser://updateTitle?title="+e))};window.configReady=t,window.configError=y,window.loginResult=k,window.imageResult=P,window.locationResult=M,window.captureQRResult=B,window.phoneContactsResult=D,window.sendMessage=J,window.setIOSTitle=G;var H={config:w,ready:g,login:S,error:b,captureQR:q,selectImage:O,previewImage:E,location:T,messageCallback:V,phoneContacts:L,setBackButtonHidden4iOS:W,setIOSTitle:G};window.Virsical=H,n.default=H},,function(e,n,o){(function(e){"use strict";function n(e,o,i){function r(e,n){var o=e[0],r=e[1];d[o]={connect:function(e){return"function"!=typeof e?void console.error("Bad callback given to connect to signal "+o):(d.__objectSignals__[r]=d.__objectSignals__[r]||[],d.__objectSignals__[r].push(e),void(n||"destroyed"===o||i.exec({type:t.connectToSignal,object:d.__id__,signal:r})))},disconnect:function(e){if("function"!=typeof e)return void console.error("Bad callback given to disconnect from signal "+o);d.__objectSignals__[r]=d.__objectSignals__[r]||[];var c=d.__objectSignals__[r].indexOf(e);return c===-1?void console.error("Cannot find connection of signal "+o+" to "+e.name):(d.__objectSignals__[r].splice(c,1),void(n||0!==d.__objectSignals__[r].length||i.exec({type:t.disconnectFromSignal,object:d.__id__,signal:r})))}}}function c(e,n){var o=d.__objectSignals__[e];o&&o.forEach(function(e){e.apply(e,n)})}function a(e){var n=e[0],o=e[1];d[n]=function(){for(var e,n=[],r=0;r<arguments.length;++r)"function"==typeof arguments[r]?e=arguments[r]:n.push(arguments[r]);i.exec({type:t.invokeMethod,object:d.__id__,method:o,args:n},function(n){if(void 0!==n){var o=d.unwrapQObject(n);e&&e(o)}})}}function s(e){var n=e[0],o=e[1],c=e[2];d.__propertyCache__[n]=e[3],c&&(1===c[0]&&(c[0]=o+"Changed"),r(c,!0)),Object.defineProperty(d,o,{configurable:!0,get:function(){var e=d.__propertyCache__[n];return void 0===e&&console.warn('Undefined value in property cache for property "'+o+'" in object '+d.__id__),e},set:function(e){return void 0===e?void console.warn("Property setter for "+o+" called with undefined value!"):(d.__propertyCache__[n]=e,void i.exec({type:t.setProperty,object:d.__id__,property:n,value:e}))}})}this.__id__=e,i.objects[e]=this,this.__objectSignals__={},this.__propertyCache__={};var d=this;this.unwrapQObject=function(e){if(e instanceof Array){for(var o=new Array(e.length),t=0;t<e.length;++t)o[t]=d.unwrapQObject(e[t]);return o}if(!e||!e["__QObject*__"]||void 0===e.id)return e;var r=e.id;if(i.objects[r])return i.objects[r];if(!e.data)return void console.error("Cannot unwrap unknown QObject "+r+" without data.");var c=new n(r,e.data,i);return c.destroyed.connect(function(){if(i.objects[r]===c){delete i.objects[r];var e=[];for(var n in c)e.push(n);for(var o in e)delete c[e[o]]}}),c.unwrapProperties(),c},this.unwrapProperties=function(){for(var e in d.__propertyCache__)d.__propertyCache__[e]=d.unwrapQObject(d.__propertyCache__[e])},this.propertyUpdate=function(e,n){for(var o in n){var t=n[o];d.__propertyCache__[o]=t}for(var i in e)c(i,e[i])},this.signalEmitted=function(e,n){c(e,n)},o.methods.forEach(a),o.properties.forEach(s),o.signals.forEach(function(e){r(e,!1)});for(var e in o.enums)d[e]=o.enums[e]}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t={signal:1,propertyUpdate:2,init:3,idle:4,debug:5,invokeMethod:6,connectToSignal:7,disconnectFromSignal:8,setProperty:9,response:10},i=function(e,i){if("object"!==("undefined"==typeof e?"undefined":o(e))||"function"!=typeof e.send)return void console.error("The QWebChannel expects a transport object with a send function and onmessage callback property. Given is: transport: "+("undefined"==typeof e?"undefined":o(e))+", transport.send: "+o(e.send));var r=this;this.transport=e,this.send=function(e){"string"!=typeof e&&(e=JSON.stringify(e)),r.transport.send(e)},this.transport.onmessage=function(e){var n=e.data;switch("string"==typeof n&&(n=JSON.parse(n)),n.type){case t.signal:r.handleSignal(n);break;case t.response:r.handleResponse(n);break;case t.propertyUpdate:r.handlePropertyUpdate(n);break;default:console.error("invalid message received:",e.data)}},this.execCallbacks={},this.execId=0,this.exec=function(e,n){return n?(r.execId===Number.MAX_VALUE&&(r.execId=Number.MIN_VALUE),e.hasOwnProperty("id")?void console.error("Cannot exec message with property id: "+JSON.stringify(e)):(e.id=r.execId++,r.execCallbacks[e.id]=n,void r.send(e))):void r.send(e)},this.objects={},this.handleSignal=function(e){var n=r.objects[e.object];n?n.signalEmitted(e.signal,e.args):console.warn("Unhandled signal: "+e.object+"::"+e.signal)},this.handleResponse=function(e){return e.hasOwnProperty("id")?(r.execCallbacks[e.id](e.data),void delete r.execCallbacks[e.id]):void console.error("Invalid response message received: ",JSON.stringify(e))},this.handlePropertyUpdate=function(e){for(var n in e.data){var o=e.data[n],i=r.objects[o.object];i?i.propertyUpdate(o.signals,o.properties):console.warn("Unhandled property update: "+o.object+"::"+o.signal)}r.exec({type:t.idle})},this.debug=function(e){r.send({type:t.debug,data:e})},r.exec({type:t.init},function(e){for(var o in e)var c=new n(o,e[o],r);for(var o in r.objects)r.objects[o].unwrapProperties();i&&i(r),r.exec({type:t.idle})})};"object"===o(e)&&(e.exports={QWebChannel:i})}).call(n,o(3)(e))},function(e,n){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}}])})}])});

@@ -1,1 +0,1 @@

!function(e,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var o=n();for(var t in o)("object"==typeof exports?exports:e)[t]=o[t]}}(this,function(){return function(e){function n(t){if(o[t])return o[t].exports;var i=o[t]={exports:{},id:t,loaded:!1};return e[t].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}var o={};return n.m=e,n.c=o,n.p="",n(0)}([function(e,n,o){"use strict";function t(){f(),w&&w()}Object.defineProperty(n,"__esModule",{value:!0});var i=o(2).QWebChannel,r=!1,c=0,a=1,s=2,d=3,l=4,f=function(){return sessionStorage.setItem("configStatus",!0)},u=function(){return!0},p=function(e,n){try{new i(qt.webChannelTransport,function(o){var t=o.objects.content;t.clickConfig(e,n)})}catch(e){throw new Error(e)}},_=function(){var e=navigator.userAgent;return r&&console.log("Virsical: ",e),e.indexOf("Android")>-1||e.indexOf("Adr")>-1?a:e.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)?s:e.match(/Mac OS X/)?d:e.indexOf("QtWebEngine")>-1?l:c},v=function(e){r=e.debug;var n=_();if(n==a)try{window.control?window.control.config(e.debug,e.client_id,e.client_secret):window.location.href="vsk3browser://config?debug="+e.debug+"&clientid="+e.client_id+"&clientsecret="+e.client_secret}catch(e){throw new Error(e)}else if(n==s||n==d)window.location.href="vsk3browser://config?debug="+e.debug+"&clientid="+e.client_id+"&clientsecret="+e.client_secret;else{if(n!=l)throw new Error("Device validation failed, only support for mobile devices");p(e.client_id,e.client_secret)}},w=void 0,g=function(e){return w=e},h=void 0,b=function(e){return h=e},y=function(e,n){return h&&h({msg:e,code:n})},m=void 0,j=void 0,x=void 0,k=function(e){if(!u())return window.console.error("no config, please using Virsical.config(...) to config your app."),void alert("Please config app first");j=e.success,x=e.fail;var n=_();if(n==a)try{window.control?window.control.login():window.location.href="vsk3browser://login"}catch(e){throw new Error(e)}else n==s||n==d?window.location.href="vsk3browser://login":n==l&&new i(qt.webChannelTransport,function(e){var n=e.objects.content;n.login()})},S=function(e,n,o,t){clearTimeout(m),0==e?j&&j({info:n}):x&&x({msg:t,code:o})},C=void 0,P=function(e){return u()?(C=e.successCallback,void(_()==a?window.image.selectOne():_()==s)):void alert("Please config app first")},O=function(e){return C({localIds:e})},E=function(e){return u()?void(_()==a?window.image.show(e.ids):_()==s):void alert("Please config app first")},U=void 0,Q=6e4,I=void 0,R=void 0,T=function(e){return u()?(U=setTimeout("locationTimeout()",Q),I=e.success,R=e.fail,void(_()==a?window.map.location():_()==s)):void alert("Please config app first")},A=function(e,n,o,t,i,r){clearTimeout(U),0==e?I({addr:n,lat:o,lng:t}):R({msg:r,code:i})},M=void 0,N=void 0,q=function(e){if(!u())return void alert("Please config app first");M=e.success,N=e.fail;var n=_();n==a?window.captureqr?window.captureqr.scan():window.location.href="vsk3browser://captureqr":n!=s&&n!=d||(window.location.href="vsk3browser://captureqr")},B=function(e,n,o,t){0==e?M({url:n}):N({msg:t,code:o})},V=function(e){return V=e},J=function(e){V&&V(e)},W=function(e){var n=_();n==s&&(e?window.location.href="vsk3browser://html5?action=hideBack":window.location.href="vsk3browser://html5?action=showBack")},X=void 0,F=void 0,L=function(e){return u()?(X=e.success,F=e.fail,void(_()==a?window.contacts.loadPhoneContacts(e.refresh):_()==s&&(window.location.href="vsk3browser://loadPhoneContacts?refresh="+e.refresh))):void alert("Please config app first")},D=function(e,n,o,t){0==e?X({result:n}):F({msg:t,code:o})};window.configReady=t,window.configError=y,window.loginResult=S,window.imageResult=O,window.locationResult=A,window.captureQRResult=B,window.phoneContactsResult=D,window.sendMessage=J;var G={config:v,ready:g,login:k,error:b,captureQR:q,selectImage:P,previewImage:E,location:T,messageCallback:V,phoneContacts:L,setBackButtonHidden4iOS:W};window.Virsical=G,n.default=G},,function(e,n,o){(function(e){"use strict";function n(e,o,i){function r(e,n){var o=e[0],r=e[1];d[o]={connect:function(e){return"function"!=typeof e?void console.error("Bad callback given to connect to signal "+o):(d.__objectSignals__[r]=d.__objectSignals__[r]||[],d.__objectSignals__[r].push(e),void(n||"destroyed"===o||i.exec({type:t.connectToSignal,object:d.__id__,signal:r})))},disconnect:function(e){if("function"!=typeof e)return void console.error("Bad callback given to disconnect from signal "+o);d.__objectSignals__[r]=d.__objectSignals__[r]||[];var c=d.__objectSignals__[r].indexOf(e);return c===-1?void console.error("Cannot find connection of signal "+o+" to "+e.name):(d.__objectSignals__[r].splice(c,1),void(n||0!==d.__objectSignals__[r].length||i.exec({type:t.disconnectFromSignal,object:d.__id__,signal:r})))}}}function c(e,n){var o=d.__objectSignals__[e];o&&o.forEach(function(e){e.apply(e,n)})}function a(e){var n=e[0],o=e[1];d[n]=function(){for(var e,n=[],r=0;r<arguments.length;++r)"function"==typeof arguments[r]?e=arguments[r]:n.push(arguments[r]);i.exec({type:t.invokeMethod,object:d.__id__,method:o,args:n},function(n){if(void 0!==n){var o=d.unwrapQObject(n);e&&e(o)}})}}function s(e){var n=e[0],o=e[1],c=e[2];d.__propertyCache__[n]=e[3],c&&(1===c[0]&&(c[0]=o+"Changed"),r(c,!0)),Object.defineProperty(d,o,{configurable:!0,get:function(){var e=d.__propertyCache__[n];return void 0===e&&console.warn('Undefined value in property cache for property "'+o+'" in object '+d.__id__),e},set:function(e){return void 0===e?void console.warn("Property setter for "+o+" called with undefined value!"):(d.__propertyCache__[n]=e,void i.exec({type:t.setProperty,object:d.__id__,property:n,value:e}))}})}this.__id__=e,i.objects[e]=this,this.__objectSignals__={},this.__propertyCache__={};var d=this;this.unwrapQObject=function(e){if(e instanceof Array){for(var o=new Array(e.length),t=0;t<e.length;++t)o[t]=d.unwrapQObject(e[t]);return o}if(!e||!e["__QObject*__"]||void 0===e.id)return e;var r=e.id;if(i.objects[r])return i.objects[r];if(!e.data)return void console.error("Cannot unwrap unknown QObject "+r+" without data.");var c=new n(r,e.data,i);return c.destroyed.connect(function(){if(i.objects[r]===c){delete i.objects[r];var e=[];for(var n in c)e.push(n);for(var o in e)delete c[e[o]]}}),c.unwrapProperties(),c},this.unwrapProperties=function(){for(var e in d.__propertyCache__)d.__propertyCache__[e]=d.unwrapQObject(d.__propertyCache__[e])},this.propertyUpdate=function(e,n){for(var o in n){var t=n[o];d.__propertyCache__[o]=t}for(var i in e)c(i,e[i])},this.signalEmitted=function(e,n){c(e,n)},o.methods.forEach(a),o.properties.forEach(s),o.signals.forEach(function(e){r(e,!1)});for(var e in o.enums)d[e]=o.enums[e]}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t={signal:1,propertyUpdate:2,init:3,idle:4,debug:5,invokeMethod:6,connectToSignal:7,disconnectFromSignal:8,setProperty:9,response:10},i=function(e,i){if("object"!==("undefined"==typeof e?"undefined":o(e))||"function"!=typeof e.send)return void console.error("The QWebChannel expects a transport object with a send function and onmessage callback property. Given is: transport: "+("undefined"==typeof e?"undefined":o(e))+", transport.send: "+o(e.send));var r=this;this.transport=e,this.send=function(e){"string"!=typeof e&&(e=JSON.stringify(e)),r.transport.send(e)},this.transport.onmessage=function(e){var n=e.data;switch("string"==typeof n&&(n=JSON.parse(n)),n.type){case t.signal:r.handleSignal(n);break;case t.response:r.handleResponse(n);break;case t.propertyUpdate:r.handlePropertyUpdate(n);break;default:console.error("invalid message received:",e.data)}},this.execCallbacks={},this.execId=0,this.exec=function(e,n){return n?(r.execId===Number.MAX_VALUE&&(r.execId=Number.MIN_VALUE),e.hasOwnProperty("id")?void console.error("Cannot exec message with property id: "+JSON.stringify(e)):(e.id=r.execId++,r.execCallbacks[e.id]=n,void r.send(e))):void r.send(e)},this.objects={},this.handleSignal=function(e){var n=r.objects[e.object];n?n.signalEmitted(e.signal,e.args):console.warn("Unhandled signal: "+e.object+"::"+e.signal)},this.handleResponse=function(e){return e.hasOwnProperty("id")?(r.execCallbacks[e.id](e.data),void delete r.execCallbacks[e.id]):void console.error("Invalid response message received: ",JSON.stringify(e))},this.handlePropertyUpdate=function(e){for(var n in e.data){var o=e.data[n],i=r.objects[o.object];i?i.propertyUpdate(o.signals,o.properties):console.warn("Unhandled property update: "+o.object+"::"+o.signal)}r.exec({type:t.idle})},this.debug=function(e){r.send({type:t.debug,data:e})},r.exec({type:t.init},function(e){for(var o in e)var c=new n(o,e[o],r);for(var o in r.objects)r.objects[o].unwrapProperties();i&&i(r),r.exec({type:t.idle})})};"object"===o(e)&&(e.exports={QWebChannel:i})}).call(n,o(3)(e))},function(e,n){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}}])});
!function(e,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var o=n();for(var t in o)("object"==typeof exports?exports:e)[t]=o[t]}}(this,function(){return function(e){function n(t){if(o[t])return o[t].exports;var i=o[t]={exports:{},id:t,loaded:!1};return e[t].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}var o={};return n.m=e,n.c=o,n.p="",n(0)}([function(e,n,o){"use strict";function t(){f(),_&&_()}Object.defineProperty(n,"__esModule",{value:!0});var i=o(2).QWebChannel,r=!1,c=0,a=1,s=2,d=3,l=4,f=function(){return sessionStorage.setItem("configStatus",!0)},u=function(){return!0},p=function(e,n){try{new i(qt.webChannelTransport,function(o){var t=o.objects.content;t.clickConfig(e,n)})}catch(e){throw new Error(e)}},v=function(){var e=navigator.userAgent;return r&&console.log("Virsical: ",e),e.indexOf("Android")>-1||e.indexOf("Adr")>-1?a:e.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)?s:e.match(/Mac OS X/)?d:e.indexOf("QtWebEngine")>-1?l:c},w=function(e){r=e.debug;var n=v();if(n==a)try{window.control?window.control.config(e.debug,e.client_id,e.client_secret):window.location.href="vsk3browser://config?debug="+e.debug+"&clientid="+e.client_id+"&clientsecret="+e.client_secret}catch(e){throw new Error(e)}else if(n==s||n==d)window.location.href="vsk3browser://config?debug="+e.debug+"&clientid="+e.client_id+"&clientsecret="+e.client_secret;else{if(n!=l)throw new Error("Device validation failed, only support for mobile devices");p(e.client_id,e.client_secret)}},_=void 0,g=function(e){return _=e},h=void 0,b=function(e){return h=e},y=function(e,n){return h&&h({msg:e,code:n})},m=void 0,j=void 0,x=void 0,S=function(e){if(!u())return window.console.error("no config, please using Virsical.config(...) to config your app."),void alert("Please config app first");j=e.success,x=e.fail;var n=v();if(n==a)try{window.control?window.control.login():window.location.href="vsk3browser://login"}catch(e){throw new Error(e)}else n==s||n==d?window.location.href="vsk3browser://login":n==l&&new i(qt.webChannelTransport,function(e){var n=e.objects.content;n.login()})},k=function(e,n,o,t){clearTimeout(m),0==e?j&&j({info:n}):x&&x({msg:t,code:o})},C=void 0,O=function(e){return u()?(C=e.successCallback,void(v()==a?window.image.selectOne():v()==s)):void alert("Please config app first")},P=function(e){return C({localIds:e})},E=function(e){return u()?void(v()==a?window.image.show(e.ids):v()==s):void alert("Please config app first")},U=void 0,I=6e4,Q=void 0,T=void 0,R=function(e){return u()?(U=setTimeout("locationTimeout()",I),Q=e.success,T=e.fail,void(v()==a?window.map.location():v()==s)):void alert("Please config app first")},A=function(e,n,o,t,i,r){clearTimeout(U),0==e?Q({addr:n,lat:o,lng:t}):T({msg:r,code:i})},M=void 0,N=void 0,q=function(e){if(!u())return void alert("Please config app first");M=e.success,N=e.fail;var n=v();n==a?window.captureqr?window.captureqr.scan():window.location.href="vsk3browser://captureqr":n!=s&&n!=d||(window.location.href="vsk3browser://captureqr")},B=function(e,n,o,t){0==e?M({url:n}):N({msg:t,code:o})},V=function(e){return V=e},J=function(e){V&&V(e)},W=function(e){var n=v();n==s&&(e?window.location.href="vsk3browser://html5?action=hideBack":window.location.href="vsk3browser://html5?action=showBack")},X=void 0,F=void 0,L=function(e){return u()?(X=e.success,F=e.fail,void(v()==a?window.contacts.loadPhoneContacts(e.refresh):v()==s&&(window.location.href="vsk3browser://loadPhoneContacts?refresh="+e.refresh))):void alert("Please config app first")},D=function(e,n,o,t){0==e?X({result:n}):F({msg:t,code:o})},G=function(e){var n=v();(e||""==e)&&(n!=s&&n!=d||(window.location.href="vsk3browser://updateTitle?title="+e))};window.configReady=t,window.configError=y,window.loginResult=k,window.imageResult=P,window.locationResult=A,window.captureQRResult=B,window.phoneContactsResult=D,window.sendMessage=J,window.setIOSTitle=G;var H={config:w,ready:g,login:S,error:b,captureQR:q,selectImage:O,previewImage:E,location:R,messageCallback:V,phoneContacts:L,setBackButtonHidden4iOS:W,setIOSTitle:G};window.Virsical=H,n.default=H},,function(e,n,o){(function(e){"use strict";function n(e,o,i){function r(e,n){var o=e[0],r=e[1];d[o]={connect:function(e){return"function"!=typeof e?void console.error("Bad callback given to connect to signal "+o):(d.__objectSignals__[r]=d.__objectSignals__[r]||[],d.__objectSignals__[r].push(e),void(n||"destroyed"===o||i.exec({type:t.connectToSignal,object:d.__id__,signal:r})))},disconnect:function(e){if("function"!=typeof e)return void console.error("Bad callback given to disconnect from signal "+o);d.__objectSignals__[r]=d.__objectSignals__[r]||[];var c=d.__objectSignals__[r].indexOf(e);return c===-1?void console.error("Cannot find connection of signal "+o+" to "+e.name):(d.__objectSignals__[r].splice(c,1),void(n||0!==d.__objectSignals__[r].length||i.exec({type:t.disconnectFromSignal,object:d.__id__,signal:r})))}}}function c(e,n){var o=d.__objectSignals__[e];o&&o.forEach(function(e){e.apply(e,n)})}function a(e){var n=e[0],o=e[1];d[n]=function(){for(var e,n=[],r=0;r<arguments.length;++r)"function"==typeof arguments[r]?e=arguments[r]:n.push(arguments[r]);i.exec({type:t.invokeMethod,object:d.__id__,method:o,args:n},function(n){if(void 0!==n){var o=d.unwrapQObject(n);e&&e(o)}})}}function s(e){var n=e[0],o=e[1],c=e[2];d.__propertyCache__[n]=e[3],c&&(1===c[0]&&(c[0]=o+"Changed"),r(c,!0)),Object.defineProperty(d,o,{configurable:!0,get:function(){var e=d.__propertyCache__[n];return void 0===e&&console.warn('Undefined value in property cache for property "'+o+'" in object '+d.__id__),e},set:function(e){return void 0===e?void console.warn("Property setter for "+o+" called with undefined value!"):(d.__propertyCache__[n]=e,void i.exec({type:t.setProperty,object:d.__id__,property:n,value:e}))}})}this.__id__=e,i.objects[e]=this,this.__objectSignals__={},this.__propertyCache__={};var d=this;this.unwrapQObject=function(e){if(e instanceof Array){for(var o=new Array(e.length),t=0;t<e.length;++t)o[t]=d.unwrapQObject(e[t]);return o}if(!e||!e["__QObject*__"]||void 0===e.id)return e;var r=e.id;if(i.objects[r])return i.objects[r];if(!e.data)return void console.error("Cannot unwrap unknown QObject "+r+" without data.");var c=new n(r,e.data,i);return c.destroyed.connect(function(){if(i.objects[r]===c){delete i.objects[r];var e=[];for(var n in c)e.push(n);for(var o in e)delete c[e[o]]}}),c.unwrapProperties(),c},this.unwrapProperties=function(){for(var e in d.__propertyCache__)d.__propertyCache__[e]=d.unwrapQObject(d.__propertyCache__[e])},this.propertyUpdate=function(e,n){for(var o in n){var t=n[o];d.__propertyCache__[o]=t}for(var i in e)c(i,e[i])},this.signalEmitted=function(e,n){c(e,n)},o.methods.forEach(a),o.properties.forEach(s),o.signals.forEach(function(e){r(e,!1)});for(var e in o.enums)d[e]=o.enums[e]}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t={signal:1,propertyUpdate:2,init:3,idle:4,debug:5,invokeMethod:6,connectToSignal:7,disconnectFromSignal:8,setProperty:9,response:10},i=function(e,i){if("object"!==("undefined"==typeof e?"undefined":o(e))||"function"!=typeof e.send)return void console.error("The QWebChannel expects a transport object with a send function and onmessage callback property. Given is: transport: "+("undefined"==typeof e?"undefined":o(e))+", transport.send: "+o(e.send));var r=this;this.transport=e,this.send=function(e){"string"!=typeof e&&(e=JSON.stringify(e)),r.transport.send(e)},this.transport.onmessage=function(e){var n=e.data;switch("string"==typeof n&&(n=JSON.parse(n)),n.type){case t.signal:r.handleSignal(n);break;case t.response:r.handleResponse(n);break;case t.propertyUpdate:r.handlePropertyUpdate(n);break;default:console.error("invalid message received:",e.data)}},this.execCallbacks={},this.execId=0,this.exec=function(e,n){return n?(r.execId===Number.MAX_VALUE&&(r.execId=Number.MIN_VALUE),e.hasOwnProperty("id")?void console.error("Cannot exec message with property id: "+JSON.stringify(e)):(e.id=r.execId++,r.execCallbacks[e.id]=n,void r.send(e))):void r.send(e)},this.objects={},this.handleSignal=function(e){var n=r.objects[e.object];n?n.signalEmitted(e.signal,e.args):console.warn("Unhandled signal: "+e.object+"::"+e.signal)},this.handleResponse=function(e){return e.hasOwnProperty("id")?(r.execCallbacks[e.id](e.data),void delete r.execCallbacks[e.id]):void console.error("Invalid response message received: ",JSON.stringify(e))},this.handlePropertyUpdate=function(e){for(var n in e.data){var o=e.data[n],i=r.objects[o.object];i?i.propertyUpdate(o.signals,o.properties):console.warn("Unhandled property update: "+o.object+"::"+o.signal)}r.exec({type:t.idle})},this.debug=function(e){r.send({type:t.debug,data:e})},r.exec({type:t.init},function(e){for(var o in e)var c=new n(o,e[o],r);for(var o in r.objects)r.objects[o].unwrapProperties();i&&i(r),r.exec({type:t.idle})})};"object"===o(e)&&(e.exports={QWebChannel:i})}).call(n,o(3)(e))},function(e,n){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}}])});
{
"name": "virsical-jssdk",
"version": "0.3.5",
"version": "0.3.6",
"description": "Virsical 3.0 JS SDK",

@@ -5,0 +5,0 @@ "main": "lib/virsical.js",

@@ -291,2 +291,12 @@ let QWebChannel = require("./qwebchannel").QWebChannel;

//通过web修改ios端页面title
const setIOSTitle = (title) => {
const platform = getPlatform();
if (title || title == '') {
if (platform == _platform_ios || platform == _platform_mac) {
window.location.href = 'vsk3browser://updateTitle?title=' + title;
}
}
};
window.configReady = configReady;

@@ -300,2 +310,3 @@ window.configError = configError;

window.sendMessage = sendMessage;
window.setIOSTitle = setIOSTitle;

@@ -313,3 +324,4 @@ const Virsical = {

phoneContacts: phoneContacts,
setBackButtonHidden4iOS: setBackButtonHidden4iOS
setBackButtonHidden4iOS: setBackButtonHidden4iOS,
setIOSTitle: setIOSTitle
};

@@ -316,0 +328,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc