Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cloudbase/adapter-wx_mp

Package Overview
Dependencies
Maintainers
8
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cloudbase/adapter-wx_mp - npm Package Compare versions

Comparing version 0.2.1 to 0.3.0

6

dist/esm/index.js

@@ -248,3 +248,7 @@ var __extends = (this && this.__extends) || (function () {

localStorage: wxMpStorage,
primaryStorage: StorageType.local
primaryStorage: StorageType.local,
getAppSign: function () {
var info = wx.getAccountInfoSync();
return info && info.miniProgram ? info.miniProgram.appId : '';
}
};

@@ -251,0 +255,0 @@ return 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=0)}([function(t,e,n){t.exports=n(1)},function(t,e,n){"use strict";var r,o=this&&this.__extends||(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)}),u=this&&this.__assign||function(){return(u=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)},i=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,u){function i(t){try{c(r.next(t))}catch(t){u(t)}}function a(t){try{c(r.throw(t))}catch(t){u(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,a)}c((r=r.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,r,o,u,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return u={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function a(u){return function(a){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=e.call(t,i)}catch(t){u=[6,t],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}};Object.defineProperty(e,"__esModule",{value:!0});var c=n(2);var f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.post=function(t){var e=t.url,n=t.data,r=t.headers;return new Promise((function(t,o){wx.request({url:c.formatUrl("https:",e),data:n,method:"POST",header:r,success:function(e){t(e)},fail:function(t){o(t)}})}))},e.prototype.upload=function(t){var e=this;return new Promise((function(n){return i(e,void 0,void 0,(function(){var e,r,o,i;return a(this,(function(a){return e=t.url,r=t.file,o=t.data,i=t.headers,wx.uploadFile({url:c.formatUrl("https:",e),filePath:r,name:"file",formData:u(u({},o),{file:r}),header:i,success:function(t){var e={statusCode:t.statusCode,data:t.data||{}};200===t.statusCode&&o.success_action_status&&(e.statusCode=parseInt(o.success_action_status,10)),n(e)},fail:function(t){n(t)}}),[2]}))}))}))},e.prototype.download=function(t){var e=t.url,n=t.headers;return new Promise((function(t,r){wx.downloadFile({url:c.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}(c.AbstractSDKRequest);e.WxRequest=f,e.wxMpStorage={setItem:function(t,e){wx.setStorageSync(t,e)},getItem:function(t){return wx.getStorageSync(t)},removeItem:function(t){wx.removeStorageSync(t)},clear:function(){wx.clearStorageSync()}};var s=function(t,e){void 0===e&&(e={});var n=wx.connectSocket(u({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}};e.WxMpWebSocket=s;var l={genAdapter:function(){return{root:{},reqClass:f,wsClass:s,localStorage:e.wxMpStorage,primaryStorage:c.StorageType.local}},isMatch:function(){if("undefined"==typeof wx)return!1;if("undefined"==typeof App)return!1;if("undefined"==typeof Page)return!1;if("function"!=typeof getApp)return!1;if(!wx.onAppHide)return!1;if(!wx.offAppHide)return!1;if(!wx.onAppShow)return!1;if(!wx.offAppShow)return!1;if(!wx.getSystemInfoSync)return!1;if(!wx.getStorageSync)return!1;if(!wx.setStorageSync)return!1;if(!wx.connectSocket)return!1;if(!wx.request)return!1;try{if(!wx.getSystemInfoSync())return!1;if("qq"===wx.getSystemInfoSync().AppPlatform)return!1}catch(t){return!1}return!0},runtime:"wx_mp"};e.default=l},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 i(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 i}))}])}));
!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=0)}([function(t,e,n){t.exports=n(1)},function(t,e,n){"use strict";var r,o=this&&this.__extends||(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)}),u=this&&this.__assign||function(){return(u=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)},i=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,u){function i(t){try{c(r.next(t))}catch(t){u(t)}}function a(t){try{c(r.throw(t))}catch(t){u(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,a)}c((r=r.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,r,o,u,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return u={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function a(u){return function(a){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=e.call(t,i)}catch(t){u=[6,t],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}};Object.defineProperty(e,"__esModule",{value:!0});var c=n(2);var f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.post=function(t){var e=t.url,n=t.data,r=t.headers;return new Promise((function(t,o){wx.request({url:c.formatUrl("https:",e),data:n,method:"POST",header:r,success:function(e){t(e)},fail:function(t){o(t)}})}))},e.prototype.upload=function(t){var e=this;return new Promise((function(n){return i(e,void 0,void 0,(function(){var e,r,o,i;return a(this,(function(a){return e=t.url,r=t.file,o=t.data,i=t.headers,wx.uploadFile({url:c.formatUrl("https:",e),filePath:r,name:"file",formData:u(u({},o),{file:r}),header:i,success:function(t){var e={statusCode:t.statusCode,data:t.data||{}};200===t.statusCode&&o.success_action_status&&(e.statusCode=parseInt(o.success_action_status,10)),n(e)},fail:function(t){n(t)}}),[2]}))}))}))},e.prototype.download=function(t){var e=t.url,n=t.headers;return new Promise((function(t,r){wx.downloadFile({url:c.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}(c.AbstractSDKRequest);e.WxRequest=f,e.wxMpStorage={setItem:function(t,e){wx.setStorageSync(t,e)},getItem:function(t){return wx.getStorageSync(t)},removeItem:function(t){wx.removeStorageSync(t)},clear:function(){wx.clearStorageSync()}};var s=function(t,e){void 0===e&&(e={});var n=wx.connectSocket(u({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}};e.WxMpWebSocket=s;var l={genAdapter:function(){return{root:{},reqClass:f,wsClass:s,localStorage:e.wxMpStorage,primaryStorage:c.StorageType.local,getAppSign:function(){var t=wx.getAccountInfoSync();return t&&t.miniProgram?t.miniProgram.appId:""}}},isMatch:function(){if("undefined"==typeof wx)return!1;if("undefined"==typeof App)return!1;if("undefined"==typeof Page)return!1;if("function"!=typeof getApp)return!1;if(!wx.onAppHide)return!1;if(!wx.offAppHide)return!1;if(!wx.onAppShow)return!1;if(!wx.offAppShow)return!1;if(!wx.getSystemInfoSync)return!1;if(!wx.getStorageSync)return!1;if(!wx.setStorageSync)return!1;if(!wx.connectSocket)return!1;if(!wx.request)return!1;try{if(!wx.getSystemInfoSync())return!1;if("qq"===wx.getSystemInfoSync().AppPlatform)return!1}catch(t){return!1}return!0},runtime:"wx_mp"};e.default=l},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 i(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 i}))}])}));
{
"name": "@cloudbase/adapter-wx_mp",
"version": "0.2.1",
"version": "0.3.0",
"description": "wechat miniprogram adapter of cloudbase javascript SDK",

@@ -10,4 +10,3 @@ "main": "dist/index.js",

"build:esm": "tsc -p tsconfig.esm.json",
"build": "webpack && npm run build:esm",
"publish": "npm publish --access=public"
"build": "webpack && npm run build:esm"
},

@@ -30,4 +29,4 @@ "author": "",

"dependencies": {
"@cloudbase/adapter-interface": "^0.2.0"
"@cloudbase/adapter-interface": "^0.3.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