@terra-js/terra-kit 0.3.0-alpha.9 → 0.4.0-OMNI964.1

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/CHANGELOG.md ADDED
@@ -0,0 +1,24 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.4.0-alpha.4] - 2022-11-16
9
+
10
+ ### Updated
11
+
12
+ - [terra-kit][auth] Save access token after refreshing to local accessToken variable.
13
+
14
+ ## [0.4.0-alpha.3] - 2022-08-02
15
+
16
+ ### Added
17
+
18
+ - [terra-kit][auth] Add method for refreshing access token.
19
+
20
+ ## [0.4.0-alpha.2] - 2022-05-19
21
+
22
+ ### Fixed
23
+
24
+ - [terra-kit][device] Fix wrong type of Location.
package/bundle/terra.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(self,(function(){return(()=>{"use strict";var e={206:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ModuleWrapper=void 0;var r=n(39),o=function(){function e(e){this.moduleName="",this.wrappedModuleName="",this.moduleName=e,this.wrappedModuleName=(0,r.wrapModuleName)(e)}return e.prototype.getWrappedModule=function(){return window[this.wrappedModuleName]||(0,r.wrapModule)(window,this.moduleName),window[this.wrappedModuleName]},e.prototype.invoke=function(e,t){return void 0===t&&(t={}),this.getWrappedModule().invoke(e,t)},e}();t.ModuleWrapper=o},951:function(e,t,n){var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.TerraAppBasedModuleWrapper=void 0;var i=function(e){function t(t,n){var r=e.call(this,n)||this;return r.appName="",r.appName=t,r}return o(t,e),t.prototype.invoke=function(t,n){return void 0===n&&(n={}),e.prototype.invoke.call(this,t,{params:n,appName:this.appName})},t}(n(206).ModuleWrapper);t.TerraAppBasedModuleWrapper=i},194:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TerraAppBasedModuleWrapper=t.Result=t.toResult=t.ModuleWrapper=void 0;var r=n(206);Object.defineProperty(t,"ModuleWrapper",{enumerable:!0,get:function(){return r.ModuleWrapper}});var o=n(852);Object.defineProperty(t,"toResult",{enumerable:!0,get:function(){return o.toResult}}),Object.defineProperty(t,"Result",{enumerable:!0,get:function(){return o.Result}});var i=n(951);Object.defineProperty(t,"TerraAppBasedModuleWrapper",{enumerable:!0,get:function(){return i.TerraAppBasedModuleWrapper}})},852:function(e,t){var n,r=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.toResult=t.mapResponseToResult=t.failure=t.success=t.Failure=t.Success=t.Result=void 0;var o=function(){function e(e,t,n){this.success=e,this.value=n,this.error=t}return e.prototype.isSuccess=function(){return this.success},e.prototype.isFailure=function(){return!this.success},e.prototype.getValue=function(){return this.value},e.prototype.getError=function(){return this.error},e}();t.Result=o;var i=function(e){function t(t){return e.call(this,!0,null,t)||this}return r(t,e),t}(o);t.Success=i;var u=function(e){function t(t){return e.call(this,!1,t)||this}return r(t,e),t}(o);t.Failure=u,t.success=function(e){return new i(e)},t.failure=function(e){return new u(e)},t.mapResponseToResult=function(e){return 200===e.status_code?new i(e.result):new u(new Error(e.error))},t.toResult=function(e){return new Promise((function(t){e().then((function(e){200===e.status_code?t(new i(e.result)):t(new u(new Error(e.error)))}))}))}},39:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.wrapModuleName=t.wrapModule=void 0,t.wrapModule=function(e,t){var n=e.wrapModule;if(null!=n)return n(e,t);throw"undefined"!=typeof document?Error("Please install @terra-js/web-bridge before using any feature of terra-js"):navigator&&"ReactNative"===navigator.product?Error("Please install @terra-js/react-native-bridge before using any feature of terra-js"):new Error("Unsupported environment")},t.wrapModuleName=function(e){return"Wrapped"+e}},782:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(194),u=n(307),a=n(723),s=n(299),l=n(913),c=n(63),f=n(942),p=n(479),d=n(68),h=function(){function e(){var e=this;this.wrappedModule=null,this.share=function(t){return r(e,void 0,void 0,(function(){var e=this;return o(this,(function(n){return[2,(0,i.toResult)((function(){return e.wrappedModule.invoke("shareContent",t)}))]}))}))},this.authKit=new u.default,this.erpKit=new a.default,this.userKit=new s.default,this.apolloKit=new l.default,this.commonKit=new c.default,this.loyaltyKit=new f.default,this.orderKit=new p.default,this.discoveryKit=new d.default,this.wrappedModule=new i.ModuleWrapper("TerraModule")}return e.prototype.isAvailable=function(){return n.g.isTerraAvailable&&n.g.isTerraAvailable()||!1},e.prototype.finish=function(){this.wrappedModule.invoke("finish").then()},e.prototype.finishWithResult=function(e){var t=this;this.wrappedModule.invoke("sendFinishResult",{resultCode:e.resultCode,data:JSON.stringify(e.data)}).then((function(){t.wrappedModule.invoke("finish").then()}))},e.prototype.auth=function(){return this.authKit},e.prototype.erp=function(){return this.erpKit},e.prototype.user=function(){return this.userKit},e.prototype.apollo=function(){return this.apolloKit},e.prototype.common=function(){return this.commonKit},e.prototype.loyalty=function(){return this.loyaltyKit},e.prototype.order=function(){return this.orderKit},e.prototype.discovery=function(){return this.discoveryKit},e}();t.default=h},913:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(194);t.default=function(){var e=this;this.appName="",this.wrappedModule=null,this.getConfig=function(){return e.wrappedModule.invoke("getConfig")},this.wrappedModule=new r.ModuleWrapper("ApolloKitModule")}},307:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(194),u=function(){function e(){this.wrappedModule=null,this.accessToken=null,this.user=null,this.wrappedModule=new i.ModuleWrapper("AuthKitModule")}return e.prototype.isLoggedIn=function(){return null!=this.user},e.prototype.login=function(){return r(this,void 0,void 0,(function(){var e=this;return o(this,(function(t){return[2,(0,i.toResult)((function(){return e.wrappedModule.invoke("login")}))]}))}))},e.prototype.logout=function(){throw Error("Should not call logout within a WebView scope")},e.prototype.getAccessToken=function(){return this.accessToken},e.prototype.getAccessTokenAsync=function(){return r(this,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:return[4,this.wrappedModule.invoke("getAccessToken")];case 1:return e=t.sent().result,this.accessToken=null==e?void 0:e.accessToken,[2,this.accessToken]}}))}))},e.prototype.getUserInfo=function(){return this.user},e.prototype.getFullUserInfo=function(){return r(this,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:return[4,this.wrappedModule.invoke("getUserInfo")];case 1:return e=t.sent().result,this.user=e,[2,this.user]}}))}))},e}();t.default=u},63:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.ScanResultAction=t.ScanResultCode=t.ScanningType=void 0;var i,u,a=n(194),s=n(194);(u=t.ScanningType||(t.ScanningType={})).PRODUCT_SERIAL="serial",u.PRODUCT_BARCODE="barcode",u.PRODUCT_QR="qr",u.PRODUCT_ALL_TYPE="allType",(i=t.ScanResultCode||(t.ScanResultCode={}))[i.ERROR=0]="ERROR",i[i.SUCCESS=1]="SUCCESS",(t.ScanResultAction||(t.ScanResultAction={})).FORCE_CLOSE_SCAN="forceCloseScan";var l=function(){function e(){var e=this;this.wrappedModule=null,this.deviceID="",this.accessToken=null,this.user=null,this.getPrintConfig=function(){return r(e,void 0,void 0,(function(){var e=this;return o(this,(function(t){return[2,(0,s.toResult)((function(){return e.wrappedModule.invoke("getPrintConfig")}))]}))}))},this.printImage=function(t){return r(e,void 0,void 0,(function(){var e=this;return o(this,(function(n){return[2,(0,s.toResult)((function(){return e.wrappedModule.invoke("printImage",t)}))]}))}))},this.observeScanResult=function(t){return e.wrappedModule.invoke("observeScanResult",t)},this.processScanResult=function(t){return r(e,void 0,void 0,(function(){return o(this,(function(e){return this.wrappedModule.invoke("processScanResult",t).then(),[2]}))}))},this.wrappedModule=new a.ModuleWrapper("CommonKitModule")}return e.prototype.scan=function(){return{observeScanResult:this.observeScanResult,processScanResult:this.processScanResult}},e}();t.default=l},68:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(194),u=function(){function e(){this.wrappedModule=null,this.wrappedModule=new i.ModuleWrapper("DiscoveryKitModule")}return e.prototype.onStockRequestFinish=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,this.wrappedModule.invoke("onStockRequestFinish",{isSuccess:e})];case 1:return[2,t.sent().result]}}))}))},e.prototype.getProduct=function(){return r(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.wrappedModule.invoke("getProduct")];case 1:return[2,e.sent().result]}}))}))},e}();t.default=u},723:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(194),u=function(){function e(){this.terminal=null,this.wrappedModule=null,this.wrappedModule=new i.ModuleWrapper("ErpKitModule")}return e.prototype.getSellerId=function(){var e;return null===(e=this.terminal)||void 0===e?void 0:e.sellerID},e.prototype.getPlatformId=function(){var e;return null===(e=this.terminal)||void 0===e?void 0:e.platformId},e.prototype.getPlatformCode=function(){var e;return null===(e=this.terminal)||void 0===e?void 0:e.platformCode},e.prototype.getTerminal=function(){return r(this,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:return[4,this.wrappedModule.invoke("getTerminal")];case 1:return e=t.sent().result,this.terminal=e,[2,e]}}))}))},e}();t.default=u},942:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(194),u=n(781),a=function(){function e(){this.wrappedModule=null,this.wrappedModule=new i.ModuleWrapper("LoyaltyKitModule")}return e.prototype.getMemberInfo=function(e){return void 0===e&&(e=u.GetMemberInfoRequestFactory.currentUser()),r(this,void 0,void 0,(function(){var t=this;return o(this,(function(n){return[2,this.mapResult((function(){return t.wrappedModule.invoke("getMemberInfo",e)}))]}))}))},e.prototype.openAssignMemberCard=function(e){return r(this,void 0,void 0,(function(){var t=this;return o(this,(function(n){return[2,this.mapResult((function(){return t.wrappedModule.invoke("openAssignMemberCard",{memberId:e})}))]}))}))},e.prototype.getNetworkConfig=function(){return r(this,void 0,void 0,(function(){var e=this;return o(this,(function(t){return[2,this.mapResult((function(){return e.wrappedModule.invoke("getNetworkConfig")}))]}))}))},e.prototype.getLoyaltyConfig=function(){return r(this,void 0,void 0,(function(){var e=this;return o(this,(function(t){return[2,this.mapResult((function(){return e.wrappedModule.invoke("getLoyaltyConfig")}))]}))}))},e.prototype.mapResult=function(e){return new Promise((function(t){(0,i.toResult)(e).then((function(e){e.isSuccess()?t(e.getValue()):t({resultCode:u.LoyaltyResultCode.Unexpected,message:e.getError().message})}))}))},e}();t.default=a},781:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.LoyaltyResultCode=t.GetMemberInfoRequestFactory=void 0,t.GetMemberInfoRequestFactory={currentUser:function(){return{type:"currentUser"}},phone:function(e){return{type:"phone",phone:e}},memberQrCode:function(e){return{type:"memberQrCode",memberQrCode:e}}},(n=t.LoyaltyResultCode||(t.LoyaltyResultCode={})).Success="Success",n.Cancelled="Cancelled",n.CannotCallLoyaltyService="CannotCallLoyaltyService",n.DataInactive="DataInactive",n.DuplicateMemberCardId="DuplicateMemberCardId",n.DuplicatePhone="DuplicatePhone",n.InvalidParam="InvalidParam",n.InvalidParamFormat="InvalidParamFormat",n.MemberInactive="MemberInactive",n.MemberQrInactive="MemberQrInactive",n.MissingParam="MissingParam",n.ParamOutOfRange="ParamOutOfRange",n.PermissionDenied="PermissionDenied",n.RedemptionCodeExpired="RedemptionCodeExpired",n.SubjectNotFound="SubjectNotFound",n.SystemError="SystemError",n.Unauthorized="Unauthorized",n.Unexpected="Unexpected",n.MemberNotMatchMerchant="MemberNotMatchMerchant"},479:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(194),u=n(194),a=function(){function e(){this.wrappedModule=null,this.wrappedModule=new i.ModuleWrapper("OrderKitModule")}return e.prototype.requestReturn=function(){return r(this,void 0,void 0,(function(){var e=this;return o(this,(function(t){return[2,(0,u.toResult)((function(){return e.wrappedModule.invoke("requestReturn")}))]}))}))},e.prototype.navigateToCart=function(){return r(this,void 0,void 0,(function(){var e=this;return o(this,(function(t){return[2,(0,u.toResult)((function(){return e.wrappedModule.invoke("navigateToCart")}))]}))}))},e.prototype.navigateToProductDetail=function(e){return r(this,void 0,void 0,(function(){var t=this;return o(this,(function(n){return[2,(0,u.toResult)((function(){return t.wrappedModule.invoke("navigateToProductDetail",{sku:e})}))]}))}))},e.prototype.onReturnFinish=function(e){return r(this,void 0,void 0,(function(){var t=this;return o(this,(function(n){return[2,(0,u.toResult)((function(){return t.wrappedModule.invoke("onReturnFinish",{reload:e})}))]}))}))},e.prototype.printReceipt=function(e){return r(this,void 0,void 0,(function(){var t=this;return o(this,(function(n){return[2,(0,u.toResult)((function(){return t.wrappedModule.invoke("printReceipt",{orderId:e})}))]}))}))},e}();t.default=a},299:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(194);t.default=function(){var e=this;this.wrappedModule=null,this.getUserProfile=function(){return r(e,void 0,void 0,(function(){var e=this;return o(this,(function(t){return[2,(0,i.toResult)((function(){return e.wrappedModule.invoke("getUserProfile")}))]}))}))},this.updateUserProfile=function(t){return r(e,void 0,void 0,(function(){var e=this;return o(this,(function(n){return[2,(0,i.toResult)((function(){return e.wrappedModule.invoke("updateUserProfile",t)}))]}))}))},this.searchProfile=function(t){return(0,i.toResult)((function(){return e.wrappedModule.invoke("searchProfile",t)}))},this.upsertProfile=function(t){return r(e,void 0,void 0,(function(){var e=this;return o(this,(function(n){return[2,(0,i.toResult)((function(){return e.wrappedModule.invoke("upsertProfile",t)}))]}))}))},this.registerProfile=function(t){return(0,i.toResult)((function(){return e.wrappedModule.invoke("registerProfile",t)}))},this.createNewAddress=function(t){return r(e,void 0,void 0,(function(){var e=this;return o(this,(function(n){return[2,(0,i.toResult)((function(){return e.wrappedModule.invoke("createNewAddress",t)}))]}))}))},this.updateAddress=function(t){return r(e,void 0,void 0,(function(){var e=this;return o(this,(function(n){return[2,(0,i.toResult)((function(){return e.wrappedModule.invoke("updateAddress",t)}))]}))}))},this.deleteAddress=function(t){return r(e,void 0,void 0,(function(){var e=this;return o(this,(function(n){return[2,(0,i.toResult)((function(){return e.wrappedModule.invoke("deleteAddress",t)}))]}))}))},this.getOperationFlowConfig=function(){return r(e,void 0,void 0,(function(){var e=this;return o(this,(function(t){return[2,(0,i.toResult)((function(){return e.wrappedModule.invoke("getOperationFlowConfig")}))]}))}))},this.changeDealer=function(t){return r(e,void 0,void 0,(function(){var e=this;return o(this,(function(n){return[2,(0,i.toResult)((function(){return e.wrappedModule.invoke("changeDealer",t)}))]}))}))},this.fetchUserAddressList=function(){return r(e,void 0,void 0,(function(){var e=this;return o(this,(function(t){return[2,(0,i.toResult)((function(){return e.wrappedModule.invoke("fetchUserAddress")}))]}))}))},this.getDetailProfile=function(t){return r(e,void 0,void 0,(function(){var e=this;return o(this,(function(n){return[2,(0,i.toResult)((function(){return e.wrappedModule.invoke("getDetailProfile",t)}))]}))}))},this.publishCustomer=function(t){return r(e,void 0,void 0,(function(){var e=this;return o(this,(function(n){return[2,(0,i.toResult)((function(){return e.wrappedModule.invoke("publishCustomer",t)}))]}))}))},this.fetchCustomerTypes=function(){return r(e,void 0,void 0,(function(){var e=this;return o(this,(function(t){return[2,(0,i.toResult)((function(){return e.wrappedModule.invoke("fetchCustomerTypes")}))]}))}))},this.wrappedModule=new i.ModuleWrapper("UserKitModule")}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();var r={};return(()=>{var e=r;Object.defineProperty(e,"__esModule",{value:!0});var t=new(n(782).default);n.g.terraKit=t,e.default=t})(),r})()}));
1
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(self,(()=>(()=>{"use strict";var e={106:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(194),u=n(314),a=n(397),s=n(99),c=n(663),l=n(734),p=n(691),f=n(839),d=n(157),h=n(783),v=n(852),y=function(){function e(){var e=this;this.wrappedModule=null,this.getInitParams=function(){return r(e,void 0,void 0,(function(){var e,t,n,r;return o(this,(function(o){switch(o.label){case 0:return t=v.mapResponseToResult,[4,this.wrappedModule.invoke("getInitParams")];case 1:return(e=t.apply(void 0,[o.sent()])).isSuccess()?[2,e]:(n=new URLSearchParams(window.location.search),r={},n.forEach((function(e,t,n){r[t]=e})),[2,(0,v.success)(r)])}}))}))},this.share=function(t){return r(e,void 0,void 0,(function(){var e=this;return o(this,(function(n){return[2,(0,i.toResult)((function(){return e.wrappedModule.invoke("shareContent",t)}))]}))}))},this.authKit=new u.default,this.erpKit=new a.default,this.userKit=new s.default,this.apolloKit=new c.default,this.commonKit=new l.default,this.loyaltyKit=new p.default,this.orderKit=new f.default,this.discoveryKit=new h.default,this.deviceKit=new d.default,this.wrappedModule=new i.ModuleWrapper("TerraModule")}return e.prototype.isAvailable=function(){return n.g.isTerraAvailable&&n.g.isTerraAvailable()||!1},e.prototype.finish=function(){this.wrappedModule.invoke("finish").then()},e.prototype.finishWithResult=function(e){var t=this;this.wrappedModule.invoke("sendFinishResult",{resultCode:e.resultCode,data:JSON.stringify(e.data)}).then((function(){t.wrappedModule.invoke("finish").then()}))},e.prototype.auth=function(){return this.authKit},e.prototype.erp=function(){return this.erpKit},e.prototype.user=function(){return this.userKit},e.prototype.apollo=function(){return this.apolloKit},e.prototype.common=function(){return this.commonKit},e.prototype.loyalty=function(){return this.loyaltyKit},e.prototype.order=function(){return this.orderKit},e.prototype.discovery=function(){return this.discoveryKit},e.prototype.device=function(){return this.deviceKit},e}();t.default=y},663:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(194);t.default=function(){var e=this;this.appName="",this.wrappedModule=null,this.getConfig=function(){return e.wrappedModule.invoke("getConfig")},this.wrappedModule=new r.ModuleWrapper("ApolloKitModule")}},314:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(194),u=n(852),a=function(){function e(){this.wrappedModule=null,this.accessToken=null,this.user=null,this.wrappedModule=new i.ModuleWrapper("AuthKitModule")}return e.prototype.isLoggedIn=function(){return null!=this.user},e.prototype.login=function(){return r(this,void 0,void 0,(function(){var e=this;return o(this,(function(t){return[2,(0,i.toResult)((function(){return e.wrappedModule.invoke("login")}))]}))}))},e.prototype.logout=function(){throw Error("Should not call logout within a WebView scope")},e.prototype.getAccessToken=function(){return this.accessToken},e.prototype.getAccessTokenAsync=function(){return r(this,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:return[4,this.wrappedModule.invoke("getAccessToken")];case 1:return e=t.sent().result,this.accessToken=null==e?void 0:e.accessToken,[2,this.accessToken]}}))}))},e.prototype.refreshAccessToken=function(){return r(this,void 0,void 0,(function(){var e,t,n=this;return o(this,(function(r){switch(r.label){case 0:return[4,(0,i.toResult)((function(){return n.wrappedModule.invoke("refreshAccessToken")}))];case 1:return(e=r.sent()).isSuccess()?(t=e.getValue().accessToken,this.accessToken=t,[2,(0,u.success)(t)]):[2,(0,u.failure)(e.getError())]}}))}))},e.prototype.getUserInfo=function(){return this.user},e.prototype.getFullUserInfo=function(){return r(this,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:return[4,this.wrappedModule.invoke("getUserInfo")];case 1:return e=t.sent().result,this.user=e,[2,this.user]}}))}))},e}();t.default=a},734:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.ScanResultAction=t.ScanResultCode=t.ScanningType=void 0;var i,u,a=n(194),s=n(194);!function(e){e.PRODUCT_SERIAL="serial",e.PRODUCT_BARCODE="barcode",e.PRODUCT_QR="qr",e.PRODUCT_ALL_TYPE="allType"}(i=t.ScanningType||(t.ScanningType={})),(u=t.ScanResultCode||(t.ScanResultCode={}))[u.ERROR=0]="ERROR",u[u.SUCCESS=1]="SUCCESS",(t.ScanResultAction||(t.ScanResultAction={})).FORCE_CLOSE_SCAN="forceCloseScan";var c=function(){function e(){var e=this;this.wrappedModule=null,this.deviceID="",this.accessToken=null,this.user=null,this.getPrintConfig=function(){return r(e,void 0,void 0,(function(){var e=this;return o(this,(function(t){return[2,(0,s.toResult)((function(){return e.wrappedModule.invoke("getPrintConfig")}))]}))}))},this.printImage=function(t){return r(e,void 0,void 0,(function(){var e=this;return o(this,(function(n){return[2,(0,s.toResult)((function(){return e.wrappedModule.invoke("printImage",t)}))]}))}))},this.observeScanResult=function(t){var n;n=null==t.scanningTypes||1!=t.scanningTypes.length?i.PRODUCT_ALL_TYPE:t.scanningTypes[0];var r={continuous:t.continuous,scanningType:n,scanningTypes:t.scanningTypes};return e.wrappedModule.invoke("observeScanResult",r)},this.processScanResult=function(t){return r(e,void 0,void 0,(function(){return o(this,(function(e){return this.wrappedModule.invoke("processScanResult",t).then(),[2]}))}))},this.wrappedModule=new a.ModuleWrapper("CommonKitModule")}return e.prototype.scan=function(){return{observeScanResult:this.observeScanResult,processScanResult:this.processScanResult}},e}();t.default=c},157:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(194),u=function(){function e(){this.wrappedModule=new i.ModuleWrapper("DeviceKitModule")}return e.prototype.hasPermission=function(e){return r(this,void 0,void 0,(function(){var t=this;return o(this,(function(n){return[2,(0,i.toResult)((function(){return t.wrappedModule.invoke("hasPermission",e)}))]}))}))},e.prototype.turnOnGps=function(){return r(this,void 0,void 0,(function(){var e=this;return o(this,(function(t){return[2,(0,i.toResult)((function(){return e.wrappedModule.invoke("turnOnGps")}))]}))}))},e.prototype.getLocation=function(e){return void 0===e&&(e=null),r(this,void 0,void 0,(function(){var t=this;return o(this,(function(n){return[2,(0,i.toResult)((function(){return t.wrappedModule.invoke("getLocation",e)}))]}))}))},e}();t.default=u},783:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(194),u=function(){function e(){this.wrappedModule=null,this.wrappedModule=new i.ModuleWrapper("DiscoveryKitModule")}return e.prototype.onStockRequestFinish=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,this.wrappedModule.invoke("onStockRequestFinish",{isSuccess:e})];case 1:return[2,t.sent().result]}}))}))},e.prototype.getProduct=function(){return r(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.wrappedModule.invoke("getProduct")];case 1:return[2,e.sent().result]}}))}))},e}();t.default=u},397:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(194),u=function(){function e(){this.terminal=null,this.terraConfig=null,this.wrappedModule=null,this.wrappedModule=new i.ModuleWrapper("ErpKitModule")}return e.prototype.getSellerId=function(){var e;return null===(e=this.terminal)||void 0===e?void 0:e.sellerID},e.prototype.getPlatformId=function(){var e;return null===(e=this.terminal)||void 0===e?void 0:e.platformId},e.prototype.getPlatformCode=function(){var e;return null===(e=this.terminal)||void 0===e?void 0:e.platformCode},e.prototype.getTerminal=function(){return r(this,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:return[4,this.wrappedModule.invoke("getTerminal")];case 1:return e=t.sent().result,this.terminal=e,[2,e]}}))}))},e.prototype.getTerraConfig=function(){return r(this,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:return[4,this.wrappedModule.invoke("getTerraConfig")];case 1:return e=t.sent().result,this.terraConfig=e,[2,e]}}))}))},e.prototype.getLanguage=function(){return r(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.wrappedModule.invoke("getLanguage")];case 1:return[2,e.sent().result]}}))}))},e}();t.default=u},691:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(194),u=n(126),a=function(){function e(){this.wrappedModule=null,this.wrappedModule=new i.ModuleWrapper("LoyaltyKitModule")}return e.prototype.getMemberInfo=function(e){return void 0===e&&(e=u.GetMemberInfoRequestFactory.currentUser()),r(this,void 0,void 0,(function(){var t=this;return o(this,(function(n){return[2,this.mapResult((function(){return t.wrappedModule.invoke("getMemberInfo",e)}))]}))}))},e.prototype.openAssignMemberCard=function(e){return r(this,void 0,void 0,(function(){var t=this;return o(this,(function(n){return[2,this.mapResult((function(){return t.wrappedModule.invoke("openAssignMemberCard",{memberId:e})}))]}))}))},e.prototype.getNetworkConfig=function(){return r(this,void 0,void 0,(function(){var e=this;return o(this,(function(t){return[2,this.mapResult((function(){return e.wrappedModule.invoke("getNetworkConfig")}))]}))}))},e.prototype.getLoyaltyConfig=function(){return r(this,void 0,void 0,(function(){var e=this;return o(this,(function(t){return[2,this.mapResult((function(){return e.wrappedModule.invoke("getLoyaltyConfig")}))]}))}))},e.prototype.mapResult=function(e){return new Promise((function(t){(0,i.toResult)(e).then((function(e){e.isSuccess()?t(e.getValue()):t({resultCode:u.LoyaltyResultCode.Unexpected,message:e.getError().message})}))}))},e}();t.default=a},126:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.LoyaltyResultCode=t.GetMemberInfoRequestFactory=void 0,t.GetMemberInfoRequestFactory={currentUser:function(){return{type:"currentUser"}},phone:function(e){return{type:"phone",phone:e}},memberQrCode:function(e){return{type:"memberQrCode",memberQrCode:e}}},(n=t.LoyaltyResultCode||(t.LoyaltyResultCode={})).Success="Success",n.Cancelled="Cancelled",n.CannotCallLoyaltyService="CannotCallLoyaltyService",n.DataInactive="DataInactive",n.DuplicateMemberCardId="DuplicateMemberCardId",n.DuplicatePhone="DuplicatePhone",n.InvalidParam="InvalidParam",n.InvalidParamFormat="InvalidParamFormat",n.MemberInactive="MemberInactive",n.MemberQrInactive="MemberQrInactive",n.MissingParam="MissingParam",n.ParamOutOfRange="ParamOutOfRange",n.PermissionDenied="PermissionDenied",n.RedemptionCodeExpired="RedemptionCodeExpired",n.SubjectNotFound="SubjectNotFound",n.SystemError="SystemError",n.Unauthorized="Unauthorized",n.Unexpected="Unexpected",n.MemberNotMatchMerchant="MemberNotMatchMerchant"},839:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(194),u=n(194),a=function(){function e(){this.wrappedModule=null,this.wrappedModule=new i.ModuleWrapper("OrderKitModule")}return e.prototype.requestReturn=function(){return r(this,void 0,void 0,(function(){var e=this;return o(this,(function(t){return[2,(0,u.toResult)((function(){return e.wrappedModule.invoke("requestReturn")}))]}))}))},e.prototype.navigateToCart=function(e){return r(this,void 0,void 0,(function(){var t=this;return o(this,(function(n){return[2,(0,u.toResult)((function(){return t.wrappedModule.invoke("navigateToCart",{cartToken:e})}))]}))}))},e.prototype.repaymentOrder=function(e){return r(this,void 0,void 0,(function(){var t=this;return o(this,(function(n){return[2,(0,u.toResult)((function(){return t.wrappedModule.invoke("repaymentOrder",{orderId:e})}))]}))}))},e.prototype.navigateToProductDetail=function(e){return r(this,void 0,void 0,(function(){var t=this;return o(this,(function(n){return[2,(0,u.toResult)((function(){return t.wrappedModule.invoke("navigateToProductDetail",{sku:e})}))]}))}))},e.prototype.onReturnFinish=function(e){return r(this,void 0,void 0,(function(){var t=this;return o(this,(function(n){return[2,(0,u.toResult)((function(){return t.wrappedModule.invoke("onReturnFinish",{reload:e})}))]}))}))},e.prototype.printReceipt=function(e){return r(this,void 0,void 0,(function(){var t=this;return o(this,(function(n){return[2,(0,u.toResult)((function(){return t.wrappedModule.invoke("printReceipt",{orderId:e})}))]}))}))},e.prototype.payForOrder=function(e){return r(this,void 0,void 0,(function(){var t=this;return o(this,(function(n){return[2,(0,u.toResult)((function(){return t.wrappedModule.invoke("payForOrder",{orderId:e})}))]}))}))},e.prototype.openOrderManagement=function(e){return r(this,void 0,void 0,(function(){var t=this;return o(this,(function(n){return[2,(0,u.toResult)((function(){return t.wrappedModule.invoke("openOrderManagement",e)}))]}))}))},e.prototype.reloadOrders=function(e){return r(this,void 0,void 0,(function(){var t=this;return o(this,(function(n){return[2,(0,u.toResult)((function(){return t.wrappedModule.invoke("reloadOrders",e)}))]}))}))},e}();t.default=a},99:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(194);t.default=function(){var e=this;this.wrappedModule=null,this.getUserProfile=function(){return r(e,void 0,void 0,(function(){var e=this;return o(this,(function(t){return[2,(0,i.toResult)((function(){return e.wrappedModule.invoke("getUserProfile")}))]}))}))},this.updateUserProfile=function(t){return r(e,void 0,void 0,(function(){var e=this;return o(this,(function(n){return[2,(0,i.toResult)((function(){return e.wrappedModule.invoke("updateUserProfile",t)}))]}))}))},this.searchProfile=function(t){return(0,i.toResult)((function(){return e.wrappedModule.invoke("searchProfile",t)}))},this.upsertProfile=function(t){return r(e,void 0,void 0,(function(){var e=this;return o(this,(function(n){return[2,(0,i.toResult)((function(){return e.wrappedModule.invoke("upsertProfile",t)}))]}))}))},this.registerProfile=function(t){return(0,i.toResult)((function(){return e.wrappedModule.invoke("registerProfile",t)}))},this.createNewAddress=function(t){return r(e,void 0,void 0,(function(){var e=this;return o(this,(function(n){return[2,(0,i.toResult)((function(){return e.wrappedModule.invoke("createNewAddress",t)}))]}))}))},this.updateAddress=function(t){return r(e,void 0,void 0,(function(){var e=this;return o(this,(function(n){return[2,(0,i.toResult)((function(){return e.wrappedModule.invoke("updateAddress",t)}))]}))}))},this.deleteAddress=function(t){return r(e,void 0,void 0,(function(){var e=this;return o(this,(function(n){return[2,(0,i.toResult)((function(){return e.wrappedModule.invoke("deleteAddress",t)}))]}))}))},this.getOperationFlowConfig=function(){return r(e,void 0,void 0,(function(){var e=this;return o(this,(function(t){return[2,(0,i.toResult)((function(){return e.wrappedModule.invoke("getOperationFlowConfig")}))]}))}))},this.changeDealer=function(t){return r(e,void 0,void 0,(function(){var e=this;return o(this,(function(n){return[2,(0,i.toResult)((function(){return e.wrappedModule.invoke("changeDealer",t)}))]}))}))},this.fetchUserAddressList=function(){return r(e,void 0,void 0,(function(){var e=this;return o(this,(function(t){return[2,(0,i.toResult)((function(){return e.wrappedModule.invoke("fetchUserAddress")}))]}))}))},this.getDetailProfile=function(t){return r(e,void 0,void 0,(function(){var e=this;return o(this,(function(n){return[2,(0,i.toResult)((function(){return e.wrappedModule.invoke("getDetailProfile",t)}))]}))}))},this.publishCustomer=function(t){return r(e,void 0,void 0,(function(){var e=this;return o(this,(function(n){return[2,(0,i.toResult)((function(){return e.wrappedModule.invoke("publishCustomer",t)}))]}))}))},this.fetchCustomerTypes=function(){return r(e,void 0,void 0,(function(){var e=this;return o(this,(function(t){return[2,(0,i.toResult)((function(){return e.wrappedModule.invoke("fetchCustomerTypes")}))]}))}))},this.wrappedModule=new i.ModuleWrapper("UserKitModule")}},206:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.ModuleWrapper=void 0;var i=n(39),u=(0,i.wrapModuleName)("underlyingModule"),a=function(){function e(e,t){void 0===t&&(t=null),this.moduleName="",this.wrappedModuleName="",this.legacyModuleName="",this.wrappedLegacyModuleName="",this.moduleName=e,this.wrappedModuleName=(0,i.wrapModuleName)(e),this.legacyModuleName=null!=t?t:e,this.wrappedLegacyModuleName=(0,i.wrapModuleName)(this.legacyModuleName)}return e.prototype.getWrappedModule=function(){return window[this.wrappedModuleName]||(0,i.wrapModule)(window,this.moduleName),window[this.wrappedModuleName]},e.prototype.getWrappedLegacyModule=function(){return window[this.wrappedLegacyModuleName]||(0,i.wrapModule)(window,this.legacyModuleName),window[this.wrappedLegacyModuleName]},e.prototype.invoke=function(e,t){var n=this;return void 0===t&&(t={}),{subscribe:function(r){var o=r.next,i=r.complete,u=null;return n.checkHasModule().then((function(r){u=r?n.getWrappedModule().invoke(e,t).subscribe({next:o,complete:i}):n.getWrappedLegacyModule().invoke(e,t).subscribe({next:o,complete:i})})),{unsubscribe:function(){null==u||u.unsubscribe()}}},then:function(r){n.checkHasModule().then((function(o){o?n.getWrappedModule().invoke(e,t).then(r):n.getWrappedLegacyModule().invoke(e,t).then(r)}))}}},e.prototype.checkHasModule=function(){return r(this,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:return[4,this.getUnderlyingModule().invoke("hasModule",{moduleName:this.moduleName})];case 1:return[2,200==(e=t.sent()).status_code&&1==e.result]}}))}))},e.prototype.getUnderlyingModule=function(){return window[u]||(0,i.wrapModule)(window,"underlyingModule"),window[u]},e}();t.ModuleWrapper=a},951:function(e,t,n){var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.TerraAppBasedModuleWrapper=void 0;var i=function(e){function t(t,n){var r=e.call(this,n)||this;return r.appName="",r.appName=t,r}return o(t,e),t.prototype.invoke=function(t,n){return void 0===n&&(n={}),e.prototype.invoke.call(this,t,{params:n,appName:this.appName})},t}(n(206).ModuleWrapper);t.TerraAppBasedModuleWrapper=i},194:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TerraAppBasedModuleWrapper=t.Result=t.toResult=t.ModuleWrapper=void 0;var r=n(206);Object.defineProperty(t,"ModuleWrapper",{enumerable:!0,get:function(){return r.ModuleWrapper}});var o=n(852);Object.defineProperty(t,"toResult",{enumerable:!0,get:function(){return o.toResult}}),Object.defineProperty(t,"Result",{enumerable:!0,get:function(){return o.Result}});var i=n(951);Object.defineProperty(t,"TerraAppBasedModuleWrapper",{enumerable:!0,get:function(){return i.TerraAppBasedModuleWrapper}})},852:function(e,t){var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.toResult=t.mapResponseToResult=t.failure=t.success=t.Failure=t.Success=t.Result=void 0;var o=function(){function e(e,t,n){this.success=e,this.value=n,this.error=t}return e.prototype.isSuccess=function(){return this.success},e.prototype.isFailure=function(){return!this.success},e.prototype.getValue=function(){return this.value},e.prototype.getError=function(){return this.error},e}();t.Result=o;var i=function(e){function t(t){return e.call(this,!0,null,t)||this}return r(t,e),t}(o);t.Success=i;var u=function(e){function t(t){return e.call(this,!1,t)||this}return r(t,e),t}(o);t.Failure=u,t.success=function(e){return new i(e)},t.failure=function(e){return new u(e)},t.mapResponseToResult=function(e){return 200===e.status_code?new i(e.result):new u(new Error(e.error))},t.toResult=function(e){return new Promise((function(t){e().then((function(e){200===e.status_code?t(new i(e.result)):t(new u(new Error(e.error)))}))}))}},39:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.wrapModuleName=t.wrapModule=void 0,t.wrapModule=function(e,t){var n=e.wrapModule;if(null!=n)return n(e,t);throw"undefined"!=typeof document?Error("Please install @terra-js/web-bridge before using any feature of terra-js"):navigator&&"ReactNative"===navigator.product?Error("Please install @terra-js/react-native-bridge before using any feature of terra-js"):new Error("Unsupported environment")},t.wrapModuleName=function(e){return"Wrapped".concat(e)}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();var r={};return(()=>{var e=r;Object.defineProperty(e,"__esModule",{value:!0});var t=new(n(106).default);n.g.terraKit=t,e.default=t})(),r})()));
@@ -6,6 +6,7 @@ import ApolloKitModule from './apollo/ApolloKitModule';
6
6
  import CommonKitModule from './common/CommonKitModule';
7
7
  import LoyaltyKitModule from './loyalty/LoyaltyKitModule';
8
8
  import OrderKitModule from './order/OrderKitModule';
9
+ import DeviceKitModule from './device/DeviceKitModule';
9
10
  import { ShareContent } from './terra/types';
10
11
  import DiscoveryKitModule from './discovery/DiscoveryKitModule';
11
12
  import { FinishResult } from './BaseModule';
@@ -18,17 +19,21 @@ export default class TerraKit {
18
19
  private loyaltyKit;
19
20
  private orderKit;
20
21
  private discoveryKit;
22
+ private deviceKit;
21
23
  private wrappedModule;
22
24
  constructor();
23
25
  isAvailable(): boolean;
24
26
  finish(): void;
25
27
  finishWithResult(result: FinishResult): void;
28
+ getInitParams: () => Promise<Result<{
29
+ [key: string]: string;
30
+ }>>;
26
31
  /**
27
- * share content
28
- * @param content Content to share
29
- * @returns
30
- */
31
- share: (content: ShareContent) => Promise<Result<Boolean>>;
32
+ * share content
33
+ * @param content Content to share
34
+ * @returns
35
+ */
36
+ share: (content: ShareContent) => Promise<Result<boolean>>;
32
37
  auth(): AuthKitModule;
33
38
  erp(): ErpKitModule;
34
39
  user(): UserKitModule;
@@ -37,4 +42,5 @@ export default class TerraKit {
37
42
  loyalty(): LoyaltyKitModule;
38
43
  order(): OrderKitModule;
39
44
  discovery(): DiscoveryKitModule;
45
+ device(): DeviceKitModule;
40
46
  }
package/dist/TerraKit.js CHANGED
@@ -44,16 +44,42 @@ var ApolloKitModule_1 = require("./apollo/ApolloKitModule");
44
44
  var CommonKitModule_1 = require("./common/CommonKitModule");
45
45
  var LoyaltyKitModule_1 = require("./loyalty/LoyaltyKitModule");
46
46
  var OrderKitModule_1 = require("./order/OrderKitModule");
47
+ var DeviceKitModule_1 = require("./device/DeviceKitModule");
47
48
  var DiscoveryKitModule_1 = require("./discovery/DiscoveryKitModule");
49
+ var result_1 = require("@terra-js/common/dist/result");
48
50
  var TerraKit = /** @class */ (function () {
49
51
  function TerraKit() {
50
52
  var _this = this;
51
53
  this.wrappedModule = null;
54
+ this.getInitParams = function () { return __awaiter(_this, void 0, void 0, function () {
55
+ var result, _a, urlParams, result_2;
56
+ return __generator(this, function (_b) {
57
+ switch (_b.label) {
58
+ case 0:
59
+ _a = result_1.mapResponseToResult;
60
+ return [4 /*yield*/, this.wrappedModule.invoke('getInitParams')];
61
+ case 1:
62
+ result = _a.apply(void 0, [_b.sent()]);
63
+ if (result.isSuccess()) {
64
+ return [2 /*return*/, result];
65
+ }
66
+ else {
67
+ urlParams = new URLSearchParams(window.location.search);
68
+ result_2 = {};
69
+ urlParams.forEach(function (value, key, _) {
70
+ result_2[key] = value;
71
+ });
72
+ return [2 /*return*/, (0, result_1.success)(result_2)];
73
+ }
74
+ return [2 /*return*/];
75
+ }
76
+ });
77
+ }); };
52
78
  /**
53
- * share content
54
- * @param content Content to share
55
- * @returns
56
- */
79
+ * share content
80
+ * @param content Content to share
81
+ * @returns
82
+ */
57
83
  this.share = function (content) { return __awaiter(_this, void 0, void 0, function () {
58
84
  var _this = this;
59
85
  return __generator(this, function (_a) {
@@ -68,6 +94,7 @@ var TerraKit = /** @class */ (function () {
68
94
  this.loyaltyKit = new LoyaltyKitModule_1.default();
69
95
  this.orderKit = new OrderKitModule_1.default();
70
96
  this.discoveryKit = new DiscoveryKitModule_1.default();
97
+ this.deviceKit = new DeviceKitModule_1.default();
71
98
  this.wrappedModule = new common_1.ModuleWrapper('TerraModule');
72
99
  }
73
100
  TerraKit.prototype.isAvailable = function () {
@@ -111,6 +138,9 @@ var TerraKit = /** @class */ (function () {
111
138
  TerraKit.prototype.discovery = function () {
112
139
  return this.discoveryKit;
113
140
  };
141
+ TerraKit.prototype.device = function () {
142
+ return this.deviceKit;
143
+ };
114
144
  return TerraKit;
115
145
  }());
116
146
  exports.default = TerraKit;
@@ -17,7 +17,11 @@ export default class AuthKitModule implements BaseModule {
17
17
  getAccessToken(): string;
18
18
  getAccessTokenAsync(): Promise<string>;
19
19
  /**
20
- * Returns the access token of current user. Returns null if no user has logged in.
20
+ * Refreshes the access token. Returns an result with access token if success, otherwise returns an error result.
21
+ */
22
+ refreshAccessToken(): Promise<Result<string>>;
23
+ /**
24
+ * Returns the current user. Returns null if no user has logged in.
21
25
  *
22
26
  * Please call `getFullUserInfo` before.
23
27
  */
@@ -37,6 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  var common_1 = require("@terra-js/common");
40
+ var result_1 = require("@terra-js/common/dist/result");
40
41
  var AuthKitModule = /** @class */ (function () {
41
42
  function AuthKitModule() {
42
43
  this.wrappedModule = null;
@@ -81,7 +82,32 @@ var AuthKitModule = /** @class */ (function () {
81
82
  });
82
83
  };
83
84
  /**
84
- * Returns the access token of current user. Returns null if no user has logged in.
85
+ * Refreshes the access token. Returns an result with access token if success, otherwise returns an error result.
86
+ */
87
+ AuthKitModule.prototype.refreshAccessToken = function () {
88
+ return __awaiter(this, void 0, void 0, function () {
89
+ var result, accessToken;
90
+ var _this = this;
91
+ return __generator(this, function (_a) {
92
+ switch (_a.label) {
93
+ case 0: return [4 /*yield*/, (0, common_1.toResult)(function () { return _this.wrappedModule.invoke('refreshAccessToken'); })];
94
+ case 1:
95
+ result = _a.sent();
96
+ if (result.isSuccess()) {
97
+ accessToken = result.getValue().accessToken;
98
+ this.accessToken = accessToken;
99
+ return [2 /*return*/, (0, result_1.success)(accessToken)];
100
+ }
101
+ else {
102
+ return [2 /*return*/, (0, result_1.failure)(result.getError())];
103
+ }
104
+ return [2 /*return*/];
105
+ }
106
+ });
107
+ });
108
+ };
109
+ /**
110
+ * Returns the current user. Returns null if no user has logged in.
85
111
  *
86
112
  * Please call `getFullUserInfo` before.
87
113
  */
@@ -22,7 +22,7 @@ export declare type ProcessScanResultFinish = {
22
22
  };
23
23
  export declare type ObserveScanResultRequest = {
24
24
  continuous?: boolean;
25
- scanningType?: ScanningType;
25
+ scanningTypes?: ScanningType[];
26
26
  };
27
27
  export default class CommonKitModule implements BaseModule {
28
28
  wrappedModule: ModuleWrapper;
@@ -78,7 +78,21 @@ var CommonKitModule = /** @class */ (function () {
78
78
  });
79
79
  }); };
80
80
  this.observeScanResult = function (request) {
81
- return _this.wrappedModule.invoke('observeScanResult', request);
81
+ //As required by ticket MOBCOMMON-3084, need to support multiple types of ScanningType when opening screen,
82
+ //and also ensure backward compatibility with older versions, so need to add below code to handle
83
+ var scanningType;
84
+ if (request.scanningTypes == null || request.scanningTypes.length != 1) {
85
+ scanningType = ScanningType.PRODUCT_ALL_TYPE;
86
+ }
87
+ else {
88
+ scanningType = request.scanningTypes[0];
89
+ }
90
+ var internalRequest = {
91
+ continuous: request.continuous,
92
+ scanningType: scanningType,
93
+ scanningTypes: request.scanningTypes,
94
+ };
95
+ return _this.wrappedModule.invoke('observeScanResult', internalRequest);
82
96
  };
83
97
  this.processScanResult = function (request) { return __awaiter(_this, void 0, void 0, function () {
84
98
  return __generator(this, function (_a) {
@@ -0,0 +1,10 @@
1
+ import { ModuleWrapper, Result } from '@terra-js/common/dist';
2
+ import { BaseModule } from '../BaseModule';
3
+ import { Location, LocationRequest, PermissionRequest } from './types';
4
+ export default class DeviceKitModule implements BaseModule {
5
+ wrappedModule: ModuleWrapper;
6
+ constructor();
7
+ hasPermission(request: PermissionRequest): Promise<Result<boolean>>;
8
+ turnOnGps(): Promise<Result<boolean>>;
9
+ getLocation(request?: LocationRequest): Promise<Result<Location>>;
10
+ }
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ var dist_1 = require("@terra-js/common/dist");
40
+ var DeviceKitModule = /** @class */ (function () {
41
+ function DeviceKitModule() {
42
+ this.wrappedModule = new dist_1.ModuleWrapper('DeviceKitModule');
43
+ }
44
+ DeviceKitModule.prototype.hasPermission = function (request) {
45
+ return __awaiter(this, void 0, void 0, function () {
46
+ var _this = this;
47
+ return __generator(this, function (_a) {
48
+ return [2 /*return*/, (0, dist_1.toResult)(function () { return _this.wrappedModule.invoke('hasPermission', request); })];
49
+ });
50
+ });
51
+ };
52
+ DeviceKitModule.prototype.turnOnGps = function () {
53
+ return __awaiter(this, void 0, void 0, function () {
54
+ var _this = this;
55
+ return __generator(this, function (_a) {
56
+ return [2 /*return*/, (0, dist_1.toResult)(function () { return _this.wrappedModule.invoke('turnOnGps'); })];
57
+ });
58
+ });
59
+ };
60
+ DeviceKitModule.prototype.getLocation = function (request) {
61
+ if (request === void 0) { request = null; }
62
+ return __awaiter(this, void 0, void 0, function () {
63
+ var _this = this;
64
+ return __generator(this, function (_a) {
65
+ return [2 /*return*/, (0, dist_1.toResult)(function () { return _this.wrappedModule.invoke('getLocation', request); })];
66
+ });
67
+ });
68
+ };
69
+ return DeviceKitModule;
70
+ }());
71
+ exports.default = DeviceKitModule;
@@ -0,0 +1,13 @@
1
+ export declare type PermissionRequest = {
2
+ permission: Permission;
3
+ };
4
+ export declare enum Permission {
5
+ LOCATION = "location_permission"
6
+ }
7
+ export interface Location {
8
+ lat: number;
9
+ long: number;
10
+ }
11
+ export declare type LocationRequest = {
12
+ needGps: boolean;
13
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Permission = void 0;
4
+ var Permission;
5
+ (function (Permission) {
6
+ Permission["LOCATION"] = "location_permission";
7
+ })(Permission = exports.Permission || (exports.Permission = {}));
@@ -1,12 +1,15 @@
1
1
  import { ModuleWrapper } from '@terra-js/common';
2
2
  import { BaseModule } from '../BaseModule';
3
- import { Terminal } from './types';
3
+ import { Terminal, TerraExtraConfig, Language } from './types';
4
4
  export default class ErpModule implements BaseModule {
5
5
  terminal?: Terminal;
6
+ terraConfig?: TerraExtraConfig;
6
7
  wrappedModule: ModuleWrapper;
7
8
  constructor();
8
9
  getSellerId(): number;
9
10
  getPlatformId(): number;
10
11
  getPlatformCode(): string;
11
12
  getTerminal(): Promise<Terminal>;
13
+ getTerraConfig(): Promise<TerraExtraConfig>;
14
+ getLanguage(): Promise<Language>;
12
15
  }
@@ -40,6 +40,7 @@ var common_1 = require("@terra-js/common");
40
40
  var ErpModule = /** @class */ (function () {
41
41
  function ErpModule() {
42
42
  this.terminal = null;
43
+ this.terraConfig = null;
43
44
  this.wrappedModule = null;
44
45
  this.wrappedModule = new common_1.ModuleWrapper('ErpKitModule');
45
46
  }
@@ -69,6 +70,33 @@ var ErpModule = /** @class */ (function () {
69
70
  });
70
71
  });
71
72
  };
73
+ ErpModule.prototype.getTerraConfig = function () {
74
+ return __awaiter(this, void 0, void 0, function () {
75
+ var result;
76
+ return __generator(this, function (_a) {
77
+ switch (_a.label) {
78
+ case 0: return [4 /*yield*/, this.wrappedModule.invoke('getTerraConfig')];
79
+ case 1:
80
+ result = (_a.sent()).result;
81
+ this.terraConfig = result;
82
+ return [2 /*return*/, result];
83
+ }
84
+ });
85
+ });
86
+ };
87
+ ErpModule.prototype.getLanguage = function () {
88
+ return __awaiter(this, void 0, void 0, function () {
89
+ var result;
90
+ return __generator(this, function (_a) {
91
+ switch (_a.label) {
92
+ case 0: return [4 /*yield*/, this.wrappedModule.invoke('getLanguage')];
93
+ case 1:
94
+ result = (_a.sent()).result;
95
+ return [2 /*return*/, result];
96
+ }
97
+ });
98
+ });
99
+ };
72
100
  return ErpModule;
73
101
  }());
74
102
  exports.default = ErpModule;
@@ -23,3 +23,9 @@ export interface DeliveryMethods {
23
23
  pickupCounter: number;
24
24
  homeDelivery: number;
25
25
  }
26
+ export interface TerraExtraConfig {
27
+ kgUomCode: string;
28
+ }
29
+ export interface Language {
30
+ languageCode: string;
31
+ }
@@ -1,12 +1,17 @@
1
1
  import { ModuleWrapper } from '@terra-js/common';
2
2
  import { Result } from '@terra-js/common/dist';
3
+ import { OrderType, ChangedOrderData } from './types';
3
4
  import { BaseModule } from '../BaseModule';
4
5
  export default class OrderKitModule implements BaseModule {
5
6
  wrappedModule: ModuleWrapper;
6
7
  constructor();
7
8
  requestReturn(): Promise<Result<void>>;
8
- navigateToCart(): Promise<Result<void>>;
9
+ navigateToCart(cartToken: String): Promise<Result<void>>;
10
+ repaymentOrder(orderId: String): Promise<Result<void>>;
9
11
  navigateToProductDetail(sku: string): Promise<Result<void>>;
10
12
  onReturnFinish(reload: boolean): Promise<Result<void>>;
11
13
  printReceipt(orderId: string): Promise<Result<void>>;
14
+ payForOrder(orderId: String): Promise<Result<void>>;
15
+ openOrderManagement(orderType: OrderType): Promise<Result<void>>;
16
+ reloadOrders(data: ChangedOrderData): Promise<Result<void>>;
12
17
  }
@@ -51,11 +51,19 @@ var OrderKitModule = /** @class */ (function () {
51
51
  });
52
52
  });
53
53
  };
54
- OrderKitModule.prototype.navigateToCart = function () {
54
+ OrderKitModule.prototype.navigateToCart = function (cartToken) {
55
55
  return __awaiter(this, void 0, void 0, function () {
56
56
  var _this = this;
57
57
  return __generator(this, function (_a) {
58
- return [2 /*return*/, (0, dist_1.toResult)(function () { return _this.wrappedModule.invoke('navigateToCart'); })];
58
+ return [2 /*return*/, (0, dist_1.toResult)(function () { return _this.wrappedModule.invoke('navigateToCart', { cartToken: cartToken }); })];
59
+ });
60
+ });
61
+ };
62
+ OrderKitModule.prototype.repaymentOrder = function (orderId) {
63
+ return __awaiter(this, void 0, void 0, function () {
64
+ var _this = this;
65
+ return __generator(this, function (_a) {
66
+ return [2 /*return*/, (0, dist_1.toResult)(function () { return _this.wrappedModule.invoke('repaymentOrder', { orderId: orderId }); })];
59
67
  });
60
68
  });
61
69
  };
@@ -83,6 +91,30 @@ var OrderKitModule = /** @class */ (function () {
83
91
  });
84
92
  });
85
93
  };
94
+ OrderKitModule.prototype.payForOrder = function (orderId) {
95
+ return __awaiter(this, void 0, void 0, function () {
96
+ var _this = this;
97
+ return __generator(this, function (_a) {
98
+ return [2 /*return*/, (0, dist_1.toResult)(function () { return _this.wrappedModule.invoke("payForOrder", { orderId: orderId }); })];
99
+ });
100
+ });
101
+ };
102
+ OrderKitModule.prototype.openOrderManagement = function (orderType) {
103
+ return __awaiter(this, void 0, void 0, function () {
104
+ var _this = this;
105
+ return __generator(this, function (_a) {
106
+ return [2 /*return*/, (0, dist_1.toResult)(function () { return _this.wrappedModule.invoke("openOrderManagement", orderType); })];
107
+ });
108
+ });
109
+ };
110
+ OrderKitModule.prototype.reloadOrders = function (data) {
111
+ return __awaiter(this, void 0, void 0, function () {
112
+ var _this = this;
113
+ return __generator(this, function (_a) {
114
+ return [2 /*return*/, (0, dist_1.toResult)(function () { return _this.wrappedModule.invoke("reloadOrders", data); })];
115
+ });
116
+ });
117
+ };
86
118
  return OrderKitModule;
87
119
  }());
88
120
  exports.default = OrderKitModule;
@@ -0,0 +1,10 @@
1
+ export interface OrderType {
2
+ title: string;
3
+ status: string[];
4
+ }
5
+ export interface ChangedOrderData {
6
+ orderCode?: string;
7
+ orderId?: string;
8
+ oldStatus?: string;
9
+ newStatus?: string;
10
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@terra-js/terra-kit",
3
- "version": "0.3.0-alpha.9",
3
+ "version": "0.4.0-OMNI964.1",
4
4
  "description": "SDK for mobile bridge to offer unified method signatures for Android/iOS.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.js",
@@ -28,7 +28,7 @@
28
28
  "devDependencies": {
29
29
  "rimraf": "^3.0.2",
30
30
  "ts-loader": "^9.2.2",
31
- "typescript": "^4.3.2",
31
+ "typescript": "^4.6.3",
32
32
  "webpack": "^5.38.1",
33
33
  "webpack-cli": "^4.7.0"
34
34
  }