@grabjs/superapp-sdk 1.7.3 → 1.7.4
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/index.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e=e||self).SuperAppSDK={})}(this,function(e){"use strict";function n(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function t(e,n){for(var o=0;o<n.length;o++){var t=n[o];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,t.key,t)}}function o(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var r,u,i=(function(e,n){function a(e){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];if(!e)return!1;var t=function(e){return Object.keys(e).concat(Object.getOwnPropertyNames(Object.getPrototypeOf(e)))}(e);return n.every(function(e){return 0<=t.indexOf(e)})}function d(r,e){var u=e.callbackNameFunc,i=e.funcToWrap;return function(e){return{subscribe:e,then:function(t,r){return new Promise(function(){try{var n=null,o=!1;n=e({next:function(e){t&&t(e),n&&n.unsubscribe(),o=!0}}),o&&n&&n.unsubscribe()}catch(e){r&&r(e)}})}}}(function(o){var n,t=u();return r[t]=function(e){if(a(e,"status_code"))if(a(e.result,"event"))switch(e.result.event){case l.StreamEvent.STREAM_TERMINATED:n.unsubscribe()}else o&&o.next&&o.next(e)},i(t),n=function(e){var n=!1;return{isUnsubscribed:function(){return n},unsubscribe:function(){n||(delete r[t],o&&o.complete&&o.complete(),n=!0)}}}()})}var l;((l=n).StreamEvent||(l.StreamEvent={})).STREAM_TERMINATED="STREAM_TERMINATED",l.wrapModule=function(u,i){u[function(e){return"Wrapped"+e}(i)]=function(e,t,n){var r={};return{invoke:function(n,o){return function(e,n){return n.funcNameToWrap,d(e,function(e,n){var o={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(o[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(t=Object.getOwnPropertySymbols(e);r<t.length;r++)n.indexOf(t[r])<0&&(o[t[r]]=e[t[r]])}return o}(n,["funcNameToWrap"]))}(e,{funcNameToWrap:n,callbackNameFunc:function(){var e=r[n]||0;return r[n]=e+1,function(e){var n=e.moduleName,o=e.funcName,t=e.requestID;return n+"_"+o+"Callback"+(null!==t?"_"+t:"")}({moduleName:t,requestID:e,funcName:n})},funcToWrap:function(e){return function(e){if(u[i])u[i][e.method](JSON.stringify(e));else{if(!(u.webkit&&u.webkit.messageHandlers&&u.webkit.messageHandlers[i]))throw new Error("Unexpected method '"+e.method+"' for module '"+i+"'");u.webkit.messageHandlers[i].postMessage(e)}}({callback:e,method:n,module:t,parameters:null!=o?o:{}})}})}}}(u,i)},Object.defineProperty(l,"__esModule",{value:!0})}(r={exports:{}},r.exports),r.exports),a=(u=i)&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u,d=function(){function e(){n(this,e),a.wrapModule(window,"CheckoutModule")}return o(e,[{key:"triggerCheckout",value:function(e){return window.WrappedCheckoutModule.invoke("triggerCheckout",e)}}]),e}(),l=require("@grabjs/mobile-kit-bridge-sdk"),c=function(){function e(){n(this,e),l.wrapModule(window,"ContainerModule")}return o(e,[{key:"setBackgroundColor",value:function(e){return window.WrappedContainerModule.invoke("setBackgroundColor",{backgroundColor:e})}},{key:"setTitle",value:function(e){return window.WrappedContainerModule.invoke("setTitle",{title:e})}},{key:"hideBackButton",value:function(){return window.WrappedContainerModule.invoke("hideBackButton")}},{key:"showBackButton",value:function(){return window.WrappedContainerModule.invoke("showBackButton")}},{key:"hideRefreshButton",value:function(){return window.WrappedContainerModule.invoke("hideRefreshButton")}},{key:"showRefreshButton",value:function(){return window.WrappedContainerModule.invoke("showRefreshButton")}},{key:"hideLoader",value:function(){return window.WrappedContainerModule.invoke("hideLoader")}},{key:"close",value:function(){return window.WrappedContainerModule.invoke("close")}}]),e}(),f=function(){function e(){n(this,e),a.wrapModule(window,"LocaleModule")}return o(e,[{key:"getLanguageLocaleIdentifier",value:function(){return window.WrappedLocaleModule.invoke("getLanguageLocaleIdentifier")}}]),e}(),
|
|
1
|
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e=e||self).SuperAppSDK={})}(this,function(e){"use strict";function n(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function t(e,n){for(var o=0;o<n.length;o++){var t=n[o];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,t.key,t)}}function o(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var r,u,i=(function(e,n){function a(e){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];if(!e)return!1;var t=function(e){return Object.keys(e).concat(Object.getOwnPropertyNames(Object.getPrototypeOf(e)))}(e);return n.every(function(e){return 0<=t.indexOf(e)})}function d(r,e){var u=e.callbackNameFunc,i=e.funcToWrap;return function(e){return{subscribe:e,then:function(t,r){return new Promise(function(){try{var n=null,o=!1;n=e({next:function(e){t&&t(e),n&&n.unsubscribe(),o=!0}}),o&&n&&n.unsubscribe()}catch(e){r&&r(e)}})}}}(function(o){var n,t=u();return r[t]=function(e){if(a(e,"status_code"))if(a(e.result,"event"))switch(e.result.event){case l.StreamEvent.STREAM_TERMINATED:n.unsubscribe()}else o&&o.next&&o.next(e)},i(t),n=function(e){var n=!1;return{isUnsubscribed:function(){return n},unsubscribe:function(){n||(delete r[t],o&&o.complete&&o.complete(),n=!0)}}}()})}var l;((l=n).StreamEvent||(l.StreamEvent={})).STREAM_TERMINATED="STREAM_TERMINATED",l.wrapModule=function(u,i){u[function(e){return"Wrapped"+e}(i)]=function(e,t,n){var r={};return{invoke:function(n,o){return function(e,n){return n.funcNameToWrap,d(e,function(e,n){var o={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(o[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(t=Object.getOwnPropertySymbols(e);r<t.length;r++)n.indexOf(t[r])<0&&(o[t[r]]=e[t[r]])}return o}(n,["funcNameToWrap"]))}(e,{funcNameToWrap:n,callbackNameFunc:function(){var e=r[n]||0;return r[n]=e+1,function(e){var n=e.moduleName,o=e.funcName,t=e.requestID;return n+"_"+o+"Callback"+(null!==t?"_"+t:"")}({moduleName:t,requestID:e,funcName:n})},funcToWrap:function(e){return function(e){if(u[i])u[i][e.method](JSON.stringify(e));else{if(!(u.webkit&&u.webkit.messageHandlers&&u.webkit.messageHandlers[i]))throw new Error("Unexpected method '"+e.method+"' for module '"+i+"'");u.webkit.messageHandlers[i].postMessage(e)}}({callback:e,method:n,module:t,parameters:null!=o?o:{}})}})}}}(u,i)},Object.defineProperty(l,"__esModule",{value:!0})}(r={exports:{}},r.exports),r.exports),a=(u=i)&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u,d=function(){function e(){n(this,e),a.wrapModule(window,"CheckoutModule")}return o(e,[{key:"triggerCheckout",value:function(e){return window.WrappedCheckoutModule.invoke("triggerCheckout",e)}}]),e}(),l=require("@grabjs/mobile-kit-bridge-sdk"),c=function(){function e(){n(this,e),l.wrapModule(window,"ContainerModule")}return o(e,[{key:"setBackgroundColor",value:function(e){return window.WrappedContainerModule.invoke("setBackgroundColor",{backgroundColor:e})}},{key:"setTitle",value:function(e){return window.WrappedContainerModule.invoke("setTitle",{title:e})}},{key:"hideBackButton",value:function(){return window.WrappedContainerModule.invoke("hideBackButton")}},{key:"showBackButton",value:function(){return window.WrappedContainerModule.invoke("showBackButton")}},{key:"hideRefreshButton",value:function(){return window.WrappedContainerModule.invoke("hideRefreshButton")}},{key:"showRefreshButton",value:function(){return window.WrappedContainerModule.invoke("showRefreshButton")}},{key:"hideLoader",value:function(){return window.WrappedContainerModule.invoke("hideLoader")}},{key:"close",value:function(){return window.WrappedContainerModule.invoke("close")}}]),e}(),f=function(){function e(){n(this,e),a.wrapModule(window,"LocaleModule")}return o(e,[{key:"getLanguageLocaleIdentifier",value:function(){return window.WrappedLocaleModule.invoke("getLanguageLocaleIdentifier")}}]),e}(),s=function(){function e(){n(this,e),a.wrapModule(window,"LocationModule")}return o(e,[{key:"getCoordinate",value:function(){return window.WrappedLocationModule.invoke("getCoordinate")}},{key:"observeLocationChange",value:function(){return window.WrappedLocationModule.invoke("observeLocationChange")}}]),e}(),p=function(){function e(){n(this,e),a.wrapModule(window,"MediaModule")}return o(e,[{key:"playDRMContent",value:function(e){return window.WrappedMediaModule.invoke("playDRMContent",{data:e})}}]),e}(),w=require("@grabjs/mobile-kit-bridge-sdk"),k=function(){function e(){n(this,e),w.wrapModule(window,"PlatformModule")}return o(e,[{key:"back",value:function(){return window.WrappedPlatformModule.invoke("back")}}]),e}(),v=function(){function e(){n(this,e),a.wrapModule(window,"ScopeModule")}return o(e,[{key:"hasAccessTo",value:function(e,n){return window.WrappedScopeModule.invoke("hasAccessTo",{module:e,method:n})}},{key:"reloadScopes",value:function(){return window.WrappedScopeModule.invoke("reloadScopes")}}]),e}(),y=require("@grabjs/mobile-kit-bridge-sdk"),M=function(){function e(){n(this,e),y.wrapModule(window,"StorageModule")}return o(e,[{key:"setBoolean",value:function(e,n){return window.WrappedStorageModule.invoke("setBoolean",{key:e,value:n})}},{key:"getBoolean",value:function(e){return window.WrappedStorageModule.invoke("getBoolean",{key:e})}},{key:"setInt",value:function(e,n){return window.WrappedStorageModule.invoke("setInt",{key:e,value:n})}},{key:"getInt",value:function(e){return window.WrappedStorageModule.invoke("getInt",{key:e})}},{key:"setString",value:function(e,n){return window.WrappedStorageModule.invoke("setString",{key:e,value:n})}},{key:"getString",value:function(e){return window.WrappedStorageModule.invoke("getString",{key:e})}},{key:"setDouble",value:function(e,n){return window.WrappedStorageModule.invoke("setDouble",{key:e,value:n})}},{key:"getDouble",value:function(e){return window.WrappedStorageModule.invoke("getDouble",{key:e})}},{key:"remove",value:function(e){return window.WrappedStorageModule.invoke("remove",{key:e})}},{key:"removeAll",value:function(){return window.WrappedStorageModule.invoke("removeAll")}}]),e}(),b=function(){function e(){n(this,e),a.wrapModule(window,"SystemWebViewKitModule")}return o(e,[{key:"redirectToSystemWebView",value:function(e){var n=e.parameters,o=JSON.stringify({method:"redirectToSystemWebView",parameters:n});return window.WrappedSystemWebViewKitModule.invoke("redirectToSystemWebView",o)}}]),e}();e.CheckoutModule=d,e.ContainerModule=c,e.LocaleModule=f,e.LocationModule=s,e.MediaModule=p,e.PlatformModule=k,e.ScopeModule=v,e.StorageModule=M,e.SystemWebViewKitModule=b,Object.defineProperty(e,"__esModule",{value:!0})});
|