Socket
Socket
Sign inDemoInstall

@cloudbase/adapter-qq_game

Package Overview
Dependencies
3
Maintainers
8
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.0 to 0.2.0

7

dist/esm/index.js

@@ -101,3 +101,3 @@ var __assign = (this && this.__assign) || function () {

var adapter = {
root: {},
root: qq,
reqClass: QQRequest,

@@ -115,3 +115,8 @@ wsClass: QQGameWebSocket,

};
try {
qq.adapter = adapter;
qq.tcbAdapterQQGame = adapter;
}
catch (e) { }
export { adapter };
export default adapter;

2

dist/index.js

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

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("tcbAdapterWxMp",[],e):"object"==typeof exports?exports.tcbAdapterWxMp=e():t.tcbAdapterWxMp=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=1)}([function(t,e,n){"use strict";var r;n.r(e),function(t){t.local="local",t.none="none",t.session="session"}(r||(r={}));var o=function(){},u=function(){};function a(t,e,n){void 0===n&&(n={});var r=/\?/.test(e),o="";for(var u in n)""===o?!r&&(e+="?"):o+="&",o+=u+"="+encodeURIComponent(n[u]);return/^http(s)?\:\/\//.test(e+=o)?e:""+t+e}n.d(e,"StorageType",(function(){return r})),n.d(e,"AbstractSDKRequest",(function(){return o})),n.d(e,"AbstractStorage",(function(){return u})),n.d(e,"formatUrl",(function(){return a}))},function(t,e,n){t.exports=n(2)},function(t,e,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var o=n(3),u=n(0);var a=function(t,e){void 0===e&&(e={});var n=0,o=1,u=2,a=3,c=n,i=qq.connectSocket(r({url:t},e));return{set onopen(t){i.onOpen((function(e){c=o,t&&t(e)}))},set onmessage(t){i.onMessage(t)},set onclose(t){i.onClose((function(e){c=a,t&&t(e)}))},set onerror(t){i.onError(t)},send:function(t){return i.send({data:t})},close:function(t,e){return i.close({code:t,reason:e})},get readyState(){return c},CONNECTING:n,OPEN:o,CLOSING:u,CLOSED:a}};var c={genAdapter:function(){return{root:{},reqClass:o.QQRequest,wsClass:a,localStorage:o.qqMpStorage,primaryStorage:u.StorageType.local}},isMatch:function(){if("undefined"==typeof qq)return!1;if(!qq.onHide)return!1;if(!qq.offHide)return!1;if(!qq.onShow)return!1;if(!qq.offShow)return!1;if(!qq.getSystemInfoSync)return!1;if(!qq.getStorageSync)return!1;if(!qq.setStorageSync)return!1;if(!qq.connectSocket)return!1;if(!qq.request)return!1;try{if(!qq.getSystemInfoSync())return!1}catch(t){return!1}return!0},runtime:"qq_game"};e.adapter=c,e.default=c},function(t,e,n){"use strict";n.r(e),n.d(e,"QQRequest",(function(){return c})),n.d(e,"qqMpStorage",(function(){return i})),n.d(e,"QQMpWebSocket",(function(){return f})),n.d(e,"adapter",(function(){return s}));var r,o=n(0),u=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=function(){return(a=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return u(e,t),e.prototype.post=function(t){var e=t.url,n=t.data,r=t.headers;return new Promise((function(t,u){qq.request({url:Object(o.formatUrl)("https:",e),data:n,method:"POST",header:r,success:function(e){t(e)},fail:function(t){u(t)}})}))},e.prototype.upload=function(t){return new Promise((function(e){var n=t.url,r=t.file,u=t.data,c=t.headers;qq.uploadFile({url:Object(o.formatUrl)("https:",n),name:"file",formData:a(a({},u),{file:r}),filePath:r,header:c,success:function(t){var n={statusCode:t.statusCode,data:t.data||{}};200===t.statusCode&&u.success_action_status&&(n.statusCode=parseInt(u.success_action_status,10)),e(n)},fail:function(t){e(t)}})}))},e.prototype.download=function(t){var e=t.url,n=t.headers;return new Promise((function(t,r){qq.downloadFile({url:Object(o.formatUrl)("https:",e),header:n,success:function(e){200===e.statusCode&&e.tempFilePath?t({statusCode:200,tempFilePath:e.tempFilePath}):t(e)},fail:function(t){r(t)}})}))},e}(o.AbstractSDKRequest),i={setItem:function(t,e){qq.setStorageSync(t,e)},getItem:function(t){return qq.getStorageSync(t)},removeItem:function(t){qq.removeStorageSync(t)},clear:function(){qq.clearStorageSync()}},f=function(t,e){void 0===e&&(e={});var n=qq.connectSocket(a({url:t},e));return{set onopen(t){n.onOpen(t)},set onmessage(t){n.onMessage(t)},set onclose(t){n.onClose(t)},set onerror(t){n.onError(t)},send:function(t){return n.send({data:t})},close:function(t,e){return n.close({code:t,reason:e})},get readyState(){return n.readyState},CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3}};var s={genAdapter:function(){return{root:{},reqClass:c,wsClass:f,localStorage:i,primaryStorage:o.StorageType.local}},isMatch:function(){if("undefined"==typeof qq)return!1;if("undefined"==typeof App)return!1;if("undefined"==typeof Page)return!1;if("function"!=typeof getApp)return!1;if(!qq.onAppHide)return!1;if(!qq.offAppHide)return!1;if(!qq.onAppShow)return!1;if(!qq.offAppShow)return!1;if(!qq.getSystemInfoSync)return!1;if(!qq.getStorageSync)return!1;if(!qq.setStorageSync)return!1;if(!qq.connectSocket)return!1;if(!qq.request)return!1;try{if(!qq.getSystemInfoSync())return!1;if("qq"!==qq.getSystemInfoSync().AppPlatform)return!1}catch(t){return!1}return!0},runtime:"qq_mp"};e.default=s}])}));
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("tcbAdapterQQGame",[],e):"object"==typeof exports?exports.tcbAdapterQQGame=e():t.tcbAdapterQQGame=e()}("undefined"!=typeof window?window:this,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([function(t,e,r){"use strict";var n;r.r(e),function(t){t.local="local",t.none="none",t.session="session"}(n||(n={}));var o=function(){},u=function(){};function i(t,e,r){void 0===r&&(r={});var n=/\?/.test(e),o="";for(var u in r)""===o?!n&&(e+="?"):o+="&",o+=u+"="+encodeURIComponent(r[u]);return/^http(s)?\:\/\//.test(e+=o)?e:""+t+e}r.d(e,"StorageType",(function(){return n})),r.d(e,"AbstractSDKRequest",(function(){return o})),r.d(e,"AbstractStorage",(function(){return u})),r.d(e,"formatUrl",(function(){return i}))},function(t,e,r){t.exports=r(2)},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var o=r(3),u=r(0);var i=function(t,e){void 0===e&&(e={});var r=0,o=1,u=2,i=3,a=r,c=qq.connectSocket(n({url:t},e));return{set onopen(t){c.onOpen((function(e){a=o,t&&t(e)}))},set onmessage(t){c.onMessage(t)},set onclose(t){c.onClose((function(e){a=i,t&&t(e)}))},set onerror(t){c.onError(t)},send:function(t){return c.send({data:t})},close:function(t,e){return c.close({code:t,reason:e})},get readyState(){return a},CONNECTING:r,OPEN:o,CLOSING:u,CLOSED:i}};var a={genAdapter:function(){return{root:qq,reqClass:o.QQRequest,wsClass:i,localStorage:o.qqMpStorage,primaryStorage:u.StorageType.local}},isMatch:function(){if("undefined"==typeof qq)return!1;if(!qq.onHide)return!1;if(!qq.offHide)return!1;if(!qq.onShow)return!1;if(!qq.offShow)return!1;if(!qq.getSystemInfoSync)return!1;if(!qq.getStorageSync)return!1;if(!qq.setStorageSync)return!1;if(!qq.connectSocket)return!1;if(!qq.request)return!1;try{if(!qq.getSystemInfoSync())return!1}catch(t){return!1}return!0},runtime:"qq_game"};e.adapter=a;try{qq.adapter=a,qq.tcbAdapterQQGame=a}catch(t){}e.default=a},function(t,e,r){"use strict";r.r(e),r.d(e,"QQRequest",(function(){return a})),r.d(e,"qqMpStorage",(function(){return c})),r.d(e,"QQMpWebSocket",(function(){return s})),r.d(e,"adapter",(function(){return f}));var n,o=r(0),u=(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};var a=function(t){function e(e){void 0===e&&(e={});var r=t.call(this)||this,n=e.timeout,o=e.timeoutMsg,u=e.restrictedMethods;return r._timeout=n||0,r._timeoutMsg=o||"请求超时",r._restrictedMethods=u||["get","post","upload","download"],r}return u(e,t),e.prototype.post=function(t){var e=this;return new Promise((function(r,n){var u=null,i=t.url,a=t.data,c=t.headers,s=qq.request({url:Object(o.formatUrl)("https:",i),data:a,method:"POST",header:c,success:function(t){e._clearTimeout(u),r(t)},fail:function(t){e._clearTimeout(u),n(t)}});u=e._setTimeout("post",s)}))},e.prototype.upload=function(t){var e=this;return new Promise((function(r){var n=null,u=t.url,a=t.file,c=t.data,s=t.headers,f=qq.uploadFile({url:Object(o.formatUrl)("https:",u),name:"file",formData:i(i({},c),{file:a}),filePath:a,header:s,success:function(t){e._clearTimeout(n);var o={statusCode:t.statusCode,data:t.data||{}};200===t.statusCode&&c.success_action_status&&(o.statusCode=parseInt(c.success_action_status,10)),r(o)},fail:function(t){e._clearTimeout(n),r(t)}});n=e._setTimeout("upload",f)}))},e.prototype.download=function(t){var e=this;return new Promise((function(r,n){var u=null,i=t.url,a=t.headers,c=qq.downloadFile({url:Object(o.formatUrl)("https:",i),header:a,success:function(t){e._clearTimeout(u),200===t.statusCode&&t.tempFilePath?r({statusCode:200,tempFilePath:t.tempFilePath}):r(t)},fail:function(t){e._clearTimeout(u),n(t)}});u=e._setTimeout("download",c)}))},e.prototype._clearTimeout=function(t){t&&(clearTimeout(t),t=null)},e.prototype._setTimeout=function(t,e){var r=this;return this._timeout&&-1!==this._restrictedMethods.indexOf(t)?setTimeout((function(){console.warn(r._timeoutMsg),e.abort()}),this._timeout):null},e}(o.AbstractSDKRequest),c={setItem:function(t,e){qq.setStorageSync(t,e)},getItem:function(t){return qq.getStorageSync(t)},removeItem:function(t){qq.removeStorageSync(t)},clear:function(){qq.clearStorageSync()}},s=function(t,e){void 0===e&&(e={});var r=qq.connectSocket(i({url:t},e));return{set onopen(t){r.onOpen(t)},set onmessage(t){r.onMessage(t)},set onclose(t){r.onClose(t)},set onerror(t){r.onError(t)},send:function(t){return r.send({data:t})},close:function(t,e){return r.close({code:t,reason:e})},get readyState(){return r.readyState},CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3}};var f={genAdapter:function(){return{root:qq,reqClass:a,wsClass:s,localStorage:c,primaryStorage:o.StorageType.local,getAppSign:function(){var t=qq.getAccountInfoSync();return t&&t.miniProgram?t.miniProgram.appId:""}}},isMatch:function(){if("undefined"==typeof qq)return!1;if("undefined"==typeof App)return!1;if("undefined"==typeof Page)return!1;if("function"!=typeof getApp)return!1;if(!qq.onAppHide)return!1;if(!qq.offAppHide)return!1;if(!qq.onAppShow)return!1;if(!qq.offAppShow)return!1;if(!qq.getSystemInfoSync)return!1;if(!qq.getStorageSync)return!1;if(!qq.setStorageSync)return!1;if(!qq.connectSocket)return!1;if(!qq.request)return!1;try{if(!qq.getSystemInfoSync())return!1;if("qq"!==qq.getSystemInfoSync().AppPlatform)return!1}catch(t){return!1}return!0},runtime:"qq_mp"};try{qq.adapter=f,qq.tcbAdapterQQMp=f}catch(t){}e.default=f}])}));
{
"name": "@cloudbase/adapter-qq_game",
"version": "0.1.0",
"version": "0.2.0",
"description": "qq game adapter of cloudbase javascript SDK",

@@ -28,6 +28,5 @@ "main": "dist/index.js",

"dependencies": {
"@cloudbase/adapter-interface": "^0.2.0",
"@cloudbase/adapter-qq_mp": "^0.1.0",
"@cloudbase/adapter-wx_mp": "^0.2.1"
"@cloudbase/adapter-interface": "^0.4.0",
"@cloudbase/adapter-qq_mp": "^0.2.0"
}
}

@@ -15,5 +15,6 @@ const path = require('path');

filename: 'index.js',
library: 'tcbAdapterWxMp',
library: 'tcbAdapterQQGame',
libraryTarget: 'umd',
umdNamedDefine: true
umdNamedDefine: true,
globalObject: 'typeof window !== "undefined"?window:this'
},

@@ -20,0 +21,0 @@ resolve: {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc