@terra-js/terra-kit 0.1.0-alpha.9 → 0.3.0-alpha.10
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/bundle/terra.js +1 -1
- package/dist/BaseModule.d.ts +9 -0
- package/dist/BaseModule.js +10 -0
- package/dist/TerraKit.d.ts +19 -0
- package/dist/TerraKit.js +75 -1
- package/dist/auth/AuthKitModule.d.ts +3 -3
- package/dist/auth/AuthKitModule.js +6 -1
- package/dist/auth/types.d.ts +3 -0
- package/dist/common/CommonKitModule.d.ts +16 -0
- package/dist/common/CommonKitModule.js +19 -2
- package/dist/common/types.d.ts +6 -6
- package/dist/discovery/DiscoveryKitModule.d.ts +9 -0
- package/dist/discovery/DiscoveryKitModule.js +73 -0
- package/dist/discovery/types.d.ts +7 -0
- package/dist/discovery/types.js +2 -0
- package/dist/erp/ErpKitModule.d.ts +2 -0
- package/dist/erp/ErpKitModule.js +8 -0
- package/dist/erp/types.d.ts +2 -1
- package/dist/loyalty/LoyaltyKitModule.d.ts +12 -0
- package/dist/loyalty/LoyaltyKitModule.js +95 -0
- package/dist/loyalty/types.d.ts +98 -0
- package/dist/loyalty/types.js +44 -0
- package/dist/order/OrderKitModule.d.ts +13 -0
- package/dist/order/OrderKitModule.js +96 -0
- package/dist/order/types.d.ts +0 -0
- package/dist/order/types.js +0 -0
- package/dist/terra/types.d.ts +5 -0
- package/dist/terra/types.js +2 -0
- package/dist/user/UserKitModule.d.ts +31 -4
- package/dist/user/UserKitModule.js +59 -12
- package/dist/user/types.d.ts +33 -9
- package/dist/user/types.js +7 -0
- package/package.json +8 -6
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=r.wrapModuleName(e)}return e.prototype.getWrappedModule=function(){return window[this.wrappedModuleName]||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 u=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=u},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 u=n(951);Object.defineProperty(t,"TerraAppBasedModuleWrapper",{enumerable:!0,get:function(){return u.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 u=function(e){function t(t){return e.call(this,!0,null,t)||this}return r(t,e),t}(o);t.Success=u;var i=function(e){function t(t){return e.call(this,!1,t)||this}return r(t,e),t}(o);t.Failure=i,t.success=function(e){return new u(e)},t.failure=function(e){return new i(e)},t.mapResponseToResult=function(e){return 200===e.status_code?new u(e.result):new i(new Error(e.error))},t.toResult=function(e){return new Promise((function(t){e().then((function(e){200===e.status_code?t(new u(e.result)):t(new i(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:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(194),o=n(307),u=n(723),i=n(299),a=n(913),s=n(63),l=function(){function e(){this.wrappedModule=null,this.authKit=new o.default,this.erpKit=new u.default,this.userKit=new i.default,this.apolloKit=new a.default,this.commonKit=new s.default,this.wrappedModule=new r.ModuleWrapper("TerraModule")}return e.prototype.isAvailable=function(){return n.g.isTerraAvailable||!1},e.prototype.finish=function(){this.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}();t.default=l},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,u){function i(e){try{s(r.next(e))}catch(e){u(e)}}function a(e){try{s(r.throw(e))}catch(e){u(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(i,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,u,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return u={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function a(u){return function(a){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var u=n(194),i=function(){function e(){this.wrappedModule=null,this.accessToken=null,this.user=null,this.wrappedModule=new u.ModuleWrapper("AuthKitModule")}return e.prototype.isLoggedIn=function(){return null!=this.user},e.prototype.login=function(){throw Error("Should not call login within a WebView scope")},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=i},63:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,u){function i(e){try{s(r.next(e))}catch(e){u(e)}}function a(e){try{s(r.throw(e))}catch(e){u(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(i,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,u,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return u={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function a(u){return function(a){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var u=n(194),i=n(194),a=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,i.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,i.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 u.ModuleWrapper("CommonKitModule")}return e.prototype.scan=function(){return{observeScanResult:this.observeScanResult,processScanResult:this.processScanResult}},e}();t.default=a},723:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,u){function i(e){try{s(r.next(e))}catch(e){u(e)}}function a(e){try{s(r.throw(e))}catch(e){u(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(i,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,u,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return u={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function a(u){return function(a){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var u=n(194),i=function(){function e(){this.terminal=null,this.wrappedModule=null,this.wrappedModule=new u.ModuleWrapper("ErpKitModule")}return e.prototype.getSellerId=function(){var e;return null===(e=this.terminal)||void 0===e?void 0:e.sellerID},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=i},299:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,u){function i(e){try{s(r.next(e))}catch(e){u(e)}}function a(e){try{s(r.throw(e))}catch(e){u(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(i,a)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,u,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return u={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function a(u){return function(a){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var u=n(194);t.default=function(){var e=this;this.wrappedModule=null,this.searchProfile=function(t){return u.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,u.toResult((function(){return e.wrappedModule.invoke("upsertProfile",t)}))]}))}))},this.registerProfile=function(t){return u.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,u.toResult((function(){return e.wrappedModule.invoke("createNewAddress",t)}))]}))}))},this.getDealerConfig=function(){return r(e,void 0,void 0,(function(){var e=this;return o(this,(function(t){return[2,u.toResult((function(){return e.wrappedModule.invoke("getDealerConfig")}))]}))}))},this.getOperationFlow=function(){return r(e,void 0,void 0,(function(){var e=this;return o(this,(function(t){return[2,u.toResult((function(){return e.wrappedModule.invoke("getOperationFlow")}))]}))}))},this.changeDealer=function(t){return r(e,void 0,void 0,(function(){var e=this;return o(this,(function(n){return[2,u.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,u.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,u.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,u.toResult((function(){return e.wrappedModule.invoke("publishCustomer",t)}))]}))}))},this.wrappedModule=new u.ModuleWrapper("UserKitModule")}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var u=t[r]={exports:{}};return e[r].call(u.exports,u,u.exports,n),u.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,(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.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}();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})()}));
|
package/dist/BaseModule.d.ts
CHANGED
|
@@ -2,3 +2,12 @@ import { ModuleWrapper } from '@terra-js/common';
|
|
|
2
2
|
export interface BaseModule {
|
|
3
3
|
wrappedModule: ModuleWrapper;
|
|
4
4
|
}
|
|
5
|
+
export declare type FinishResult = {
|
|
6
|
+
resultCode: number;
|
|
7
|
+
data?: any;
|
|
8
|
+
};
|
|
9
|
+
export declare class FinishResultCode {
|
|
10
|
+
static readonly Success = 0;
|
|
11
|
+
static readonly Failed = 1;
|
|
12
|
+
static readonly Cancelled = 2;
|
|
13
|
+
}
|
package/dist/BaseModule.js
CHANGED
|
@@ -1,2 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FinishResultCode = void 0;
|
|
4
|
+
var FinishResultCode = /** @class */ (function () {
|
|
5
|
+
function FinishResultCode() {
|
|
6
|
+
}
|
|
7
|
+
FinishResultCode.Success = 0;
|
|
8
|
+
FinishResultCode.Failed = 1;
|
|
9
|
+
FinishResultCode.Cancelled = 2;
|
|
10
|
+
return FinishResultCode;
|
|
11
|
+
}());
|
|
12
|
+
exports.FinishResultCode = FinishResultCode;
|
package/dist/TerraKit.d.ts
CHANGED
|
@@ -1,21 +1,40 @@
|
|
|
1
|
+
import { Result } from '@terra-js/common';
|
|
1
2
|
import AuthKitModule from './auth/AuthKitModule';
|
|
2
3
|
import ErpKitModule from './erp/ErpKitModule';
|
|
3
4
|
import UserKitModule from './user/UserKitModule';
|
|
4
5
|
import ApolloKitModule from './apollo/ApolloKitModule';
|
|
5
6
|
import CommonKitModule from './common/CommonKitModule';
|
|
7
|
+
import LoyaltyKitModule from './loyalty/LoyaltyKitModule';
|
|
8
|
+
import OrderKitModule from './order/OrderKitModule';
|
|
9
|
+
import { ShareContent } from './terra/types';
|
|
10
|
+
import DiscoveryKitModule from './discovery/DiscoveryKitModule';
|
|
11
|
+
import { FinishResult } from './BaseModule';
|
|
6
12
|
export default class TerraKit {
|
|
7
13
|
private authKit;
|
|
8
14
|
private erpKit;
|
|
9
15
|
private userKit;
|
|
10
16
|
private apolloKit;
|
|
11
17
|
private commonKit;
|
|
18
|
+
private loyaltyKit;
|
|
19
|
+
private orderKit;
|
|
20
|
+
private discoveryKit;
|
|
12
21
|
private wrappedModule;
|
|
13
22
|
constructor();
|
|
14
23
|
isAvailable(): boolean;
|
|
15
24
|
finish(): void;
|
|
25
|
+
finishWithResult(result: FinishResult): void;
|
|
26
|
+
/**
|
|
27
|
+
* share content
|
|
28
|
+
* @param content Content to share
|
|
29
|
+
* @returns
|
|
30
|
+
*/
|
|
31
|
+
share: (content: ShareContent) => Promise<Result<Boolean>>;
|
|
16
32
|
auth(): AuthKitModule;
|
|
17
33
|
erp(): ErpKitModule;
|
|
18
34
|
user(): UserKitModule;
|
|
19
35
|
apollo(): ApolloKitModule;
|
|
20
36
|
common(): CommonKitModule;
|
|
37
|
+
loyalty(): LoyaltyKitModule;
|
|
38
|
+
order(): OrderKitModule;
|
|
39
|
+
discovery(): DiscoveryKitModule;
|
|
21
40
|
}
|
package/dist/TerraKit.js
CHANGED
|
@@ -1,4 +1,40 @@
|
|
|
1
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
|
+
};
|
|
2
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
39
|
var common_1 = require("@terra-js/common");
|
|
4
40
|
var AuthKitModule_1 = require("./auth/AuthKitModule");
|
|
@@ -6,22 +42,51 @@ var ErpKitModule_1 = require("./erp/ErpKitModule");
|
|
|
6
42
|
var UserKitModule_1 = require("./user/UserKitModule");
|
|
7
43
|
var ApolloKitModule_1 = require("./apollo/ApolloKitModule");
|
|
8
44
|
var CommonKitModule_1 = require("./common/CommonKitModule");
|
|
45
|
+
var LoyaltyKitModule_1 = require("./loyalty/LoyaltyKitModule");
|
|
46
|
+
var OrderKitModule_1 = require("./order/OrderKitModule");
|
|
47
|
+
var DiscoveryKitModule_1 = require("./discovery/DiscoveryKitModule");
|
|
9
48
|
var TerraKit = /** @class */ (function () {
|
|
10
49
|
function TerraKit() {
|
|
50
|
+
var _this = this;
|
|
11
51
|
this.wrappedModule = null;
|
|
52
|
+
/**
|
|
53
|
+
* share content
|
|
54
|
+
* @param content Content to share
|
|
55
|
+
* @returns
|
|
56
|
+
*/
|
|
57
|
+
this.share = function (content) { return __awaiter(_this, void 0, void 0, function () {
|
|
58
|
+
var _this = this;
|
|
59
|
+
return __generator(this, function (_a) {
|
|
60
|
+
return [2 /*return*/, (0, common_1.toResult)(function () { return _this.wrappedModule.invoke('shareContent', content); })];
|
|
61
|
+
});
|
|
62
|
+
}); };
|
|
12
63
|
this.authKit = new AuthKitModule_1.default();
|
|
13
64
|
this.erpKit = new ErpKitModule_1.default();
|
|
14
65
|
this.userKit = new UserKitModule_1.default();
|
|
15
66
|
this.apolloKit = new ApolloKitModule_1.default();
|
|
16
67
|
this.commonKit = new CommonKitModule_1.default();
|
|
68
|
+
this.loyaltyKit = new LoyaltyKitModule_1.default();
|
|
69
|
+
this.orderKit = new OrderKitModule_1.default();
|
|
70
|
+
this.discoveryKit = new DiscoveryKitModule_1.default();
|
|
17
71
|
this.wrappedModule = new common_1.ModuleWrapper('TerraModule');
|
|
18
72
|
}
|
|
19
73
|
TerraKit.prototype.isAvailable = function () {
|
|
20
|
-
return global['isTerraAvailable'] || false;
|
|
74
|
+
return (global['isTerraAvailable'] && global['isTerraAvailable']()) || false;
|
|
21
75
|
};
|
|
22
76
|
TerraKit.prototype.finish = function () {
|
|
23
77
|
this.wrappedModule.invoke('finish').then();
|
|
24
78
|
};
|
|
79
|
+
TerraKit.prototype.finishWithResult = function (result) {
|
|
80
|
+
var _this = this;
|
|
81
|
+
this.wrappedModule
|
|
82
|
+
.invoke('sendFinishResult', {
|
|
83
|
+
resultCode: result.resultCode,
|
|
84
|
+
data: JSON.stringify(result.data),
|
|
85
|
+
})
|
|
86
|
+
.then(function () {
|
|
87
|
+
_this.wrappedModule.invoke('finish').then();
|
|
88
|
+
});
|
|
89
|
+
};
|
|
25
90
|
TerraKit.prototype.auth = function () {
|
|
26
91
|
return this.authKit;
|
|
27
92
|
};
|
|
@@ -37,6 +102,15 @@ var TerraKit = /** @class */ (function () {
|
|
|
37
102
|
TerraKit.prototype.common = function () {
|
|
38
103
|
return this.commonKit;
|
|
39
104
|
};
|
|
105
|
+
TerraKit.prototype.loyalty = function () {
|
|
106
|
+
return this.loyaltyKit;
|
|
107
|
+
};
|
|
108
|
+
TerraKit.prototype.order = function () {
|
|
109
|
+
return this.orderKit;
|
|
110
|
+
};
|
|
111
|
+
TerraKit.prototype.discovery = function () {
|
|
112
|
+
return this.discoveryKit;
|
|
113
|
+
};
|
|
40
114
|
return TerraKit;
|
|
41
115
|
}());
|
|
42
116
|
exports.default = TerraKit;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { User } from './types';
|
|
2
|
-
import { ModuleWrapper } from '@terra-js/common';
|
|
1
|
+
import { User, LoginResult } from './types';
|
|
2
|
+
import { ModuleWrapper, Result } from '@terra-js/common';
|
|
3
3
|
import { BaseModule } from '../BaseModule';
|
|
4
4
|
export default class AuthKitModule implements BaseModule {
|
|
5
5
|
wrappedModule: ModuleWrapper;
|
|
@@ -7,7 +7,7 @@ export default class AuthKitModule implements BaseModule {
|
|
|
7
7
|
user?: User;
|
|
8
8
|
constructor();
|
|
9
9
|
isLoggedIn(): boolean;
|
|
10
|
-
login():
|
|
10
|
+
login(): Promise<Result<LoginResult>>;
|
|
11
11
|
logout(): void;
|
|
12
12
|
/**
|
|
13
13
|
* Returns the access token of current user. Returns null if no user has logged in.
|
|
@@ -48,7 +48,12 @@ var AuthKitModule = /** @class */ (function () {
|
|
|
48
48
|
return this.user != null;
|
|
49
49
|
};
|
|
50
50
|
AuthKitModule.prototype.login = function () {
|
|
51
|
-
|
|
51
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
52
|
+
var _this = this;
|
|
53
|
+
return __generator(this, function (_a) {
|
|
54
|
+
return [2 /*return*/, (0, common_1.toResult)(function () { return _this.wrappedModule.invoke('login'); })];
|
|
55
|
+
});
|
|
56
|
+
});
|
|
52
57
|
};
|
|
53
58
|
AuthKitModule.prototype.logout = function () {
|
|
54
59
|
throw Error('Should not call logout within a WebView scope');
|
package/dist/auth/types.d.ts
CHANGED
|
@@ -2,11 +2,27 @@ import { ModuleWrapper, DataStream } from '@terra-js/common';
|
|
|
2
2
|
import { Result } from '@terra-js/common/dist';
|
|
3
3
|
import { BaseModule } from '../BaseModule';
|
|
4
4
|
import { PrintConfig, PrintRequest, PrintResult } from './types';
|
|
5
|
+
export declare enum ScanningType {
|
|
6
|
+
PRODUCT_SERIAL = "serial",
|
|
7
|
+
PRODUCT_BARCODE = "barcode",
|
|
8
|
+
PRODUCT_QR = "qr",
|
|
9
|
+
PRODUCT_ALL_TYPE = "allType"
|
|
10
|
+
}
|
|
11
|
+
export declare enum ScanResultCode {
|
|
12
|
+
ERROR = 0,
|
|
13
|
+
SUCCESS = 1
|
|
14
|
+
}
|
|
15
|
+
export declare enum ScanResultAction {
|
|
16
|
+
FORCE_CLOSE_SCAN = "forceCloseScan"
|
|
17
|
+
}
|
|
5
18
|
export declare type ProcessScanResultFinish = {
|
|
6
19
|
message: string;
|
|
20
|
+
resultCode?: ScanResultCode;
|
|
21
|
+
resultAction?: ScanResultAction;
|
|
7
22
|
};
|
|
8
23
|
export declare type ObserveScanResultRequest = {
|
|
9
24
|
continuous?: boolean;
|
|
25
|
+
scanningType?: ScanningType;
|
|
10
26
|
};
|
|
11
27
|
export default class CommonKitModule implements BaseModule {
|
|
12
28
|
wrappedModule: ModuleWrapper;
|
|
@@ -36,8 +36,25 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.ScanResultAction = exports.ScanResultCode = exports.ScanningType = void 0;
|
|
39
40
|
var common_1 = require("@terra-js/common");
|
|
40
41
|
var dist_1 = require("@terra-js/common/dist");
|
|
42
|
+
var ScanningType;
|
|
43
|
+
(function (ScanningType) {
|
|
44
|
+
ScanningType["PRODUCT_SERIAL"] = "serial";
|
|
45
|
+
ScanningType["PRODUCT_BARCODE"] = "barcode";
|
|
46
|
+
ScanningType["PRODUCT_QR"] = "qr";
|
|
47
|
+
ScanningType["PRODUCT_ALL_TYPE"] = "allType";
|
|
48
|
+
})(ScanningType = exports.ScanningType || (exports.ScanningType = {}));
|
|
49
|
+
var ScanResultCode;
|
|
50
|
+
(function (ScanResultCode) {
|
|
51
|
+
ScanResultCode[ScanResultCode["ERROR"] = 0] = "ERROR";
|
|
52
|
+
ScanResultCode[ScanResultCode["SUCCESS"] = 1] = "SUCCESS";
|
|
53
|
+
})(ScanResultCode = exports.ScanResultCode || (exports.ScanResultCode = {}));
|
|
54
|
+
var ScanResultAction;
|
|
55
|
+
(function (ScanResultAction) {
|
|
56
|
+
ScanResultAction["FORCE_CLOSE_SCAN"] = "forceCloseScan";
|
|
57
|
+
})(ScanResultAction = exports.ScanResultAction || (exports.ScanResultAction = {}));
|
|
41
58
|
// TODO: should move this module to js app because it is too specific for an application.
|
|
42
59
|
// TerraKit should provide a `createCustomModule(moduleName)` method in order to js can create
|
|
43
60
|
// your own module for specific business
|
|
@@ -51,13 +68,13 @@ var CommonKitModule = /** @class */ (function () {
|
|
|
51
68
|
this.getPrintConfig = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
52
69
|
var _this = this;
|
|
53
70
|
return __generator(this, function (_a) {
|
|
54
|
-
return [2 /*return*/, dist_1.toResult(function () { return _this.wrappedModule.invoke('getPrintConfig'); })];
|
|
71
|
+
return [2 /*return*/, (0, dist_1.toResult)(function () { return _this.wrappedModule.invoke('getPrintConfig'); })];
|
|
55
72
|
});
|
|
56
73
|
}); };
|
|
57
74
|
this.printImage = function (request) { return __awaiter(_this, void 0, void 0, function () {
|
|
58
75
|
var _this = this;
|
|
59
76
|
return __generator(this, function (_a) {
|
|
60
|
-
return [2 /*return*/, dist_1.toResult(function () { return _this.wrappedModule.invoke('printImage', request); })];
|
|
77
|
+
return [2 /*return*/, (0, dist_1.toResult)(function () { return _this.wrappedModule.invoke('printImage', request); })];
|
|
61
78
|
});
|
|
62
79
|
}); };
|
|
63
80
|
this.observeScanResult = function (request) {
|
package/dist/common/types.d.ts
CHANGED
|
@@ -2,12 +2,12 @@ export interface PrintRequest {
|
|
|
2
2
|
base64String: string;
|
|
3
3
|
}
|
|
4
4
|
export interface PrintResult {
|
|
5
|
-
isSuccess:
|
|
6
|
-
message?:
|
|
5
|
+
isSuccess: boolean;
|
|
6
|
+
message?: string;
|
|
7
7
|
}
|
|
8
8
|
export interface PrintConfig {
|
|
9
|
-
clientBillAddress?:
|
|
10
|
-
clientBillLogo?:
|
|
11
|
-
clientBillName?:
|
|
12
|
-
clientBillPhone?:
|
|
9
|
+
clientBillAddress?: string;
|
|
10
|
+
clientBillLogo?: string;
|
|
11
|
+
clientBillName?: string;
|
|
12
|
+
clientBillPhone?: string;
|
|
13
13
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ModuleWrapper } from '@terra-js/common';
|
|
2
|
+
import { BaseModule } from '../BaseModule';
|
|
3
|
+
import { Product } from './types';
|
|
4
|
+
export default class DiscoveryKitModule implements BaseModule {
|
|
5
|
+
wrappedModule: ModuleWrapper;
|
|
6
|
+
constructor();
|
|
7
|
+
onStockRequestFinish(isSuccess: boolean): Promise<void>;
|
|
8
|
+
getProduct(): Promise<Product>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
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 common_1 = require("@terra-js/common");
|
|
40
|
+
var DiscoveryKitModule = /** @class */ (function () {
|
|
41
|
+
function DiscoveryKitModule() {
|
|
42
|
+
this.wrappedModule = null;
|
|
43
|
+
this.wrappedModule = new common_1.ModuleWrapper('DiscoveryKitModule');
|
|
44
|
+
}
|
|
45
|
+
DiscoveryKitModule.prototype.onStockRequestFinish = function (isSuccess) {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
47
|
+
var result;
|
|
48
|
+
return __generator(this, function (_a) {
|
|
49
|
+
switch (_a.label) {
|
|
50
|
+
case 0: return [4 /*yield*/, this.wrappedModule.invoke('onStockRequestFinish', { isSuccess: isSuccess })];
|
|
51
|
+
case 1:
|
|
52
|
+
result = (_a.sent()).result;
|
|
53
|
+
return [2 /*return*/, result];
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
DiscoveryKitModule.prototype.getProduct = function () {
|
|
59
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
60
|
+
var result;
|
|
61
|
+
return __generator(this, function (_a) {
|
|
62
|
+
switch (_a.label) {
|
|
63
|
+
case 0: return [4 /*yield*/, this.wrappedModule.invoke('getProduct')];
|
|
64
|
+
case 1:
|
|
65
|
+
result = (_a.sent()).result;
|
|
66
|
+
return [2 /*return*/, result];
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
return DiscoveryKitModule;
|
|
72
|
+
}());
|
|
73
|
+
exports.default = DiscoveryKitModule;
|
package/dist/erp/ErpKitModule.js
CHANGED
|
@@ -47,6 +47,14 @@ var ErpModule = /** @class */ (function () {
|
|
|
47
47
|
var _a;
|
|
48
48
|
return (_a = this.terminal) === null || _a === void 0 ? void 0 : _a.sellerID;
|
|
49
49
|
};
|
|
50
|
+
ErpModule.prototype.getPlatformId = function () {
|
|
51
|
+
var _a;
|
|
52
|
+
return (_a = this.terminal) === null || _a === void 0 ? void 0 : _a.platformId;
|
|
53
|
+
};
|
|
54
|
+
ErpModule.prototype.getPlatformCode = function () {
|
|
55
|
+
var _a;
|
|
56
|
+
return (_a = this.terminal) === null || _a === void 0 ? void 0 : _a.platformCode;
|
|
57
|
+
};
|
|
50
58
|
ErpModule.prototype.getTerminal = function () {
|
|
51
59
|
return __awaiter(this, void 0, void 0, function () {
|
|
52
60
|
var result;
|
package/dist/erp/types.d.ts
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ModuleWrapper } from '@terra-js/common';
|
|
2
|
+
import { BaseModule } from '../BaseModule';
|
|
3
|
+
import { AssignMemberCardResult, GetMemberInfoRequest, GetMemberInfoResult, GetNetworkConfigResult, GetLoyaltyConfigResult } from './types';
|
|
4
|
+
export default class LoyaltyKitModule implements BaseModule {
|
|
5
|
+
wrappedModule: ModuleWrapper;
|
|
6
|
+
constructor();
|
|
7
|
+
getMemberInfo(request?: GetMemberInfoRequest): Promise<GetMemberInfoResult>;
|
|
8
|
+
openAssignMemberCard(memberId: string): Promise<AssignMemberCardResult>;
|
|
9
|
+
getNetworkConfig(): Promise<GetNetworkConfigResult>;
|
|
10
|
+
getLoyaltyConfig(): Promise<GetLoyaltyConfigResult>;
|
|
11
|
+
private mapResult;
|
|
12
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
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 common_1 = require("@terra-js/common");
|
|
40
|
+
var types_1 = require("./types");
|
|
41
|
+
var LoyaltyKitModule = /** @class */ (function () {
|
|
42
|
+
function LoyaltyKitModule() {
|
|
43
|
+
this.wrappedModule = null;
|
|
44
|
+
this.wrappedModule = new common_1.ModuleWrapper('LoyaltyKitModule');
|
|
45
|
+
}
|
|
46
|
+
LoyaltyKitModule.prototype.getMemberInfo = function (request) {
|
|
47
|
+
if (request === void 0) { request = types_1.GetMemberInfoRequestFactory.currentUser(); }
|
|
48
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
49
|
+
var _this = this;
|
|
50
|
+
return __generator(this, function (_a) {
|
|
51
|
+
return [2 /*return*/, this.mapResult(function () { return _this.wrappedModule.invoke('getMemberInfo', request); })];
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
LoyaltyKitModule.prototype.openAssignMemberCard = function (memberId) {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
57
|
+
var _this = this;
|
|
58
|
+
return __generator(this, function (_a) {
|
|
59
|
+
return [2 /*return*/, this.mapResult(function () {
|
|
60
|
+
return _this.wrappedModule.invoke('openAssignMemberCard', { memberId: memberId });
|
|
61
|
+
})];
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
LoyaltyKitModule.prototype.getNetworkConfig = function () {
|
|
66
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
67
|
+
var _this = this;
|
|
68
|
+
return __generator(this, function (_a) {
|
|
69
|
+
return [2 /*return*/, this.mapResult(function () { return _this.wrappedModule.invoke('getNetworkConfig'); })];
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
LoyaltyKitModule.prototype.getLoyaltyConfig = function () {
|
|
74
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
75
|
+
var _this = this;
|
|
76
|
+
return __generator(this, function (_a) {
|
|
77
|
+
return [2 /*return*/, this.mapResult(function () { return _this.wrappedModule.invoke('getLoyaltyConfig'); })];
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
LoyaltyKitModule.prototype.mapResult = function (block) {
|
|
82
|
+
return new Promise(function (resolve) {
|
|
83
|
+
(0, common_1.toResult)(block).then(function (result) {
|
|
84
|
+
if (result.isSuccess()) {
|
|
85
|
+
resolve(result.getValue());
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
resolve({ resultCode: types_1.LoyaltyResultCode.Unexpected, message: result.getError().message });
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
return LoyaltyKitModule;
|
|
94
|
+
}());
|
|
95
|
+
exports.default = LoyaltyKitModule;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
export declare type LoyaltyResult = {
|
|
2
|
+
resultCode: LoyaltyResultCode;
|
|
3
|
+
message?: string;
|
|
4
|
+
};
|
|
5
|
+
export declare type GetMemberInfoRequest = {
|
|
6
|
+
type: 'currentUser' | 'phone' | 'memberQrCode';
|
|
7
|
+
phone?: string;
|
|
8
|
+
memberQrCode?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const GetMemberInfoRequestFactory: {
|
|
11
|
+
currentUser(): GetMemberInfoRequest;
|
|
12
|
+
phone(phone: string): GetMemberInfoRequest;
|
|
13
|
+
memberQrCode(memberQrCode: string): GetMemberInfoRequest;
|
|
14
|
+
};
|
|
15
|
+
export declare type GetMemberInfoResult = LoyaltyResult & {
|
|
16
|
+
data?: MemberInfo;
|
|
17
|
+
};
|
|
18
|
+
export declare type MemberInfo = {
|
|
19
|
+
memberQrCode?: string;
|
|
20
|
+
memberId: string;
|
|
21
|
+
phone: string;
|
|
22
|
+
memberCardId?: string;
|
|
23
|
+
name: string;
|
|
24
|
+
isActive: boolean;
|
|
25
|
+
point: number;
|
|
26
|
+
tierPoint?: number;
|
|
27
|
+
keepTierUntil?: number;
|
|
28
|
+
accumulationFrom?: number;
|
|
29
|
+
accumulationTo?: number;
|
|
30
|
+
currentTierCode?: boolean;
|
|
31
|
+
currentTierName?: boolean;
|
|
32
|
+
currentTierMinPoint?: number;
|
|
33
|
+
nextTierName?: string;
|
|
34
|
+
nextTierMinPoint?: number;
|
|
35
|
+
};
|
|
36
|
+
export declare type AssignMemberCardResult = LoyaltyResult & {
|
|
37
|
+
data?: {
|
|
38
|
+
memberCardId: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export declare type GetNetworkConfigResult = LoyaltyResult & {
|
|
42
|
+
data?: {
|
|
43
|
+
networkId: string;
|
|
44
|
+
networkName: string;
|
|
45
|
+
exchangeRate: number;
|
|
46
|
+
currencyImg: string;
|
|
47
|
+
currencyName: string;
|
|
48
|
+
cardDefaultImg?: string;
|
|
49
|
+
avatarDefaultImg?: string;
|
|
50
|
+
allowToGetMemberByPhone?: boolean;
|
|
51
|
+
faqWebUrl?: string;
|
|
52
|
+
benefitWebUrl?: string;
|
|
53
|
+
brandColor?: string;
|
|
54
|
+
allowMerchantIssueMemberCard?: boolean;
|
|
55
|
+
networkTiers?: [Tier];
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
export declare type Tier = {
|
|
59
|
+
code: string;
|
|
60
|
+
name: string;
|
|
61
|
+
fromPoint: number;
|
|
62
|
+
cardTieredImg?: string;
|
|
63
|
+
tierIconImg?: string;
|
|
64
|
+
};
|
|
65
|
+
export declare type GetLoyaltyConfigResult = LoyaltyResult & {
|
|
66
|
+
data?: {
|
|
67
|
+
url: string;
|
|
68
|
+
bffUrl: string;
|
|
69
|
+
merchantCode: string;
|
|
70
|
+
clientId: string;
|
|
71
|
+
iamAudience: string;
|
|
72
|
+
loggingEnabled: boolean;
|
|
73
|
+
linkMembershipUrl: string;
|
|
74
|
+
registerMemberUrl: string;
|
|
75
|
+
allowLinkMembership: boolean;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
export declare enum LoyaltyResultCode {
|
|
79
|
+
Success = "Success",
|
|
80
|
+
Cancelled = "Cancelled",
|
|
81
|
+
CannotCallLoyaltyService = "CannotCallLoyaltyService",
|
|
82
|
+
DataInactive = "DataInactive",
|
|
83
|
+
DuplicateMemberCardId = "DuplicateMemberCardId",
|
|
84
|
+
DuplicatePhone = "DuplicatePhone",
|
|
85
|
+
InvalidParam = "InvalidParam",
|
|
86
|
+
InvalidParamFormat = "InvalidParamFormat",
|
|
87
|
+
MemberInactive = "MemberInactive",
|
|
88
|
+
MemberQrInactive = "MemberQrInactive",
|
|
89
|
+
MissingParam = "MissingParam",
|
|
90
|
+
ParamOutOfRange = "ParamOutOfRange",
|
|
91
|
+
PermissionDenied = "PermissionDenied",
|
|
92
|
+
RedemptionCodeExpired = "RedemptionCodeExpired",
|
|
93
|
+
SubjectNotFound = "SubjectNotFound",
|
|
94
|
+
SystemError = "SystemError",
|
|
95
|
+
Unauthorized = "Unauthorized",
|
|
96
|
+
Unexpected = "Unexpected",
|
|
97
|
+
MemberNotMatchMerchant = "MemberNotMatchMerchant"
|
|
98
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LoyaltyResultCode = exports.GetMemberInfoRequestFactory = void 0;
|
|
4
|
+
exports.GetMemberInfoRequestFactory = {
|
|
5
|
+
currentUser: function () {
|
|
6
|
+
return {
|
|
7
|
+
type: 'currentUser',
|
|
8
|
+
};
|
|
9
|
+
},
|
|
10
|
+
phone: function (phone) {
|
|
11
|
+
return {
|
|
12
|
+
type: 'phone',
|
|
13
|
+
phone: phone,
|
|
14
|
+
};
|
|
15
|
+
},
|
|
16
|
+
memberQrCode: function (memberQrCode) {
|
|
17
|
+
return {
|
|
18
|
+
type: 'memberQrCode',
|
|
19
|
+
memberQrCode: memberQrCode,
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
var LoyaltyResultCode;
|
|
24
|
+
(function (LoyaltyResultCode) {
|
|
25
|
+
LoyaltyResultCode["Success"] = "Success";
|
|
26
|
+
LoyaltyResultCode["Cancelled"] = "Cancelled";
|
|
27
|
+
LoyaltyResultCode["CannotCallLoyaltyService"] = "CannotCallLoyaltyService";
|
|
28
|
+
LoyaltyResultCode["DataInactive"] = "DataInactive";
|
|
29
|
+
LoyaltyResultCode["DuplicateMemberCardId"] = "DuplicateMemberCardId";
|
|
30
|
+
LoyaltyResultCode["DuplicatePhone"] = "DuplicatePhone";
|
|
31
|
+
LoyaltyResultCode["InvalidParam"] = "InvalidParam";
|
|
32
|
+
LoyaltyResultCode["InvalidParamFormat"] = "InvalidParamFormat";
|
|
33
|
+
LoyaltyResultCode["MemberInactive"] = "MemberInactive";
|
|
34
|
+
LoyaltyResultCode["MemberQrInactive"] = "MemberQrInactive";
|
|
35
|
+
LoyaltyResultCode["MissingParam"] = "MissingParam";
|
|
36
|
+
LoyaltyResultCode["ParamOutOfRange"] = "ParamOutOfRange";
|
|
37
|
+
LoyaltyResultCode["PermissionDenied"] = "PermissionDenied";
|
|
38
|
+
LoyaltyResultCode["RedemptionCodeExpired"] = "RedemptionCodeExpired";
|
|
39
|
+
LoyaltyResultCode["SubjectNotFound"] = "SubjectNotFound";
|
|
40
|
+
LoyaltyResultCode["SystemError"] = "SystemError";
|
|
41
|
+
LoyaltyResultCode["Unauthorized"] = "Unauthorized";
|
|
42
|
+
LoyaltyResultCode["Unexpected"] = "Unexpected";
|
|
43
|
+
LoyaltyResultCode["MemberNotMatchMerchant"] = "MemberNotMatchMerchant";
|
|
44
|
+
})(LoyaltyResultCode = exports.LoyaltyResultCode || (exports.LoyaltyResultCode = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ModuleWrapper } from '@terra-js/common';
|
|
2
|
+
import { Result } from '@terra-js/common/dist';
|
|
3
|
+
import { BaseModule } from '../BaseModule';
|
|
4
|
+
export default class OrderKitModule implements BaseModule {
|
|
5
|
+
wrappedModule: ModuleWrapper;
|
|
6
|
+
constructor();
|
|
7
|
+
requestReturn(): Promise<Result<void>>;
|
|
8
|
+
navigateToCart(): Promise<Result<void>>;
|
|
9
|
+
navigateToProductDetail(sku: string): Promise<Result<void>>;
|
|
10
|
+
onReturnFinish(reload: boolean): Promise<Result<void>>;
|
|
11
|
+
printReceipt(orderId: string): Promise<Result<void>>;
|
|
12
|
+
payForOrder(orderId: String): Promise<Result<void>>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
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 common_1 = require("@terra-js/common");
|
|
40
|
+
var dist_1 = require("@terra-js/common/dist");
|
|
41
|
+
var OrderKitModule = /** @class */ (function () {
|
|
42
|
+
function OrderKitModule() {
|
|
43
|
+
this.wrappedModule = null;
|
|
44
|
+
this.wrappedModule = new common_1.ModuleWrapper('OrderKitModule');
|
|
45
|
+
}
|
|
46
|
+
OrderKitModule.prototype.requestReturn = function () {
|
|
47
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
48
|
+
var _this = this;
|
|
49
|
+
return __generator(this, function (_a) {
|
|
50
|
+
return [2 /*return*/, (0, dist_1.toResult)(function () { return _this.wrappedModule.invoke('requestReturn'); })];
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
OrderKitModule.prototype.navigateToCart = function () {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
56
|
+
var _this = this;
|
|
57
|
+
return __generator(this, function (_a) {
|
|
58
|
+
return [2 /*return*/, (0, dist_1.toResult)(function () { return _this.wrappedModule.invoke('navigateToCart'); })];
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
OrderKitModule.prototype.navigateToProductDetail = function (sku) {
|
|
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('navigateToProductDetail', { sku: sku }); })];
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
OrderKitModule.prototype.onReturnFinish = function (reload) {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
72
|
+
var _this = this;
|
|
73
|
+
return __generator(this, function (_a) {
|
|
74
|
+
return [2 /*return*/, (0, dist_1.toResult)(function () { return _this.wrappedModule.invoke('onReturnFinish', { reload: reload }); })];
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
OrderKitModule.prototype.printReceipt = function (orderId) {
|
|
79
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
80
|
+
var _this = this;
|
|
81
|
+
return __generator(this, function (_a) {
|
|
82
|
+
return [2 /*return*/, (0, dist_1.toResult)(function () { return _this.wrappedModule.invoke("printReceipt", { orderId: orderId }); })];
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
OrderKitModule.prototype.payForOrder = function (orderId) {
|
|
87
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
88
|
+
var _this = this;
|
|
89
|
+
return __generator(this, function (_a) {
|
|
90
|
+
return [2 /*return*/, (0, dist_1.toResult)(function () { return _this.wrappedModule.invoke("payForOrder", { orderId: orderId }); })];
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
return OrderKitModule;
|
|
95
|
+
}());
|
|
96
|
+
exports.default = OrderKitModule;
|
|
File without changes
|
|
File without changes
|
|
@@ -1,15 +1,41 @@
|
|
|
1
1
|
import { ModuleWrapper, Result } from '@terra-js/common';
|
|
2
2
|
import { BaseModule } from '../BaseModule';
|
|
3
|
-
import { SearchProfileRequest, SearchProfileResult, RegisterProfileRequest, Address, Profile,
|
|
3
|
+
import { SearchProfileRequest, SearchProfileResult, RegisterProfileRequest, Address, Profile, OperationFlowConfig, AddressRequest, ChangeDealerResult, DeleteAddressRequest, CustomerTypeResult } from './types';
|
|
4
4
|
export default class UserModule implements BaseModule {
|
|
5
5
|
wrappedModule: ModuleWrapper;
|
|
6
6
|
constructor();
|
|
7
|
+
/**
|
|
8
|
+
* Get profile of user currently login to the App
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
getUserProfile: () => Promise<Result<Profile>>;
|
|
12
|
+
/**
|
|
13
|
+
* Update info of an user
|
|
14
|
+
* @param request profile of the user currently login to the App
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
17
|
+
updateUserProfile: (profile: Profile) => Promise<Result<Profile>>;
|
|
18
|
+
/**
|
|
19
|
+
* Lookup customer based on keyword.
|
|
20
|
+
* @param request
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
7
23
|
searchProfile: (request: SearchProfileRequest) => Promise<Result<SearchProfileResult>>;
|
|
24
|
+
/**
|
|
25
|
+
* Update info of customer.
|
|
26
|
+
* @param request
|
|
27
|
+
* @returns
|
|
28
|
+
*/
|
|
8
29
|
upsertProfile: (profile: Profile) => Promise<Result<Profile>>;
|
|
9
30
|
registerProfile: (request: RegisterProfileRequest) => Promise<Result<void>>;
|
|
10
|
-
createNewAddress: (request:
|
|
11
|
-
|
|
12
|
-
|
|
31
|
+
createNewAddress: (request: AddressRequest) => Promise<Result<Address>>;
|
|
32
|
+
updateAddress: (request: AddressRequest) => Promise<Result<string>>;
|
|
33
|
+
deleteAddress: (request: DeleteAddressRequest) => Promise<Result<string>>;
|
|
34
|
+
/**
|
|
35
|
+
* Get appFlow of the current login user
|
|
36
|
+
* @returns
|
|
37
|
+
*/
|
|
38
|
+
getOperationFlowConfig: () => Promise<Result<OperationFlowConfig>>;
|
|
13
39
|
changeDealer: (request: {
|
|
14
40
|
phone: string;
|
|
15
41
|
}) => Promise<Result<ChangeDealerResult>>;
|
|
@@ -18,4 +44,5 @@ export default class UserModule implements BaseModule {
|
|
|
18
44
|
id: string;
|
|
19
45
|
}) => Promise<Result<Profile>>;
|
|
20
46
|
publishCustomer: (customer: Profile) => Promise<Result<void>>;
|
|
47
|
+
fetchCustomerTypes: () => Promise<Result<CustomerTypeResult>>;
|
|
21
48
|
}
|
|
@@ -41,58 +41,105 @@ var UserModule = /** @class */ (function () {
|
|
|
41
41
|
function UserModule() {
|
|
42
42
|
var _this = this;
|
|
43
43
|
this.wrappedModule = null;
|
|
44
|
+
/**
|
|
45
|
+
* Get profile of user currently login to the App
|
|
46
|
+
* @returns
|
|
47
|
+
*/
|
|
48
|
+
this.getUserProfile = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
49
|
+
var _this = this;
|
|
50
|
+
return __generator(this, function (_a) {
|
|
51
|
+
return [2 /*return*/, (0, common_1.toResult)(function () { return _this.wrappedModule.invoke('getUserProfile'); })];
|
|
52
|
+
});
|
|
53
|
+
}); };
|
|
54
|
+
/**
|
|
55
|
+
* Update info of an user
|
|
56
|
+
* @param request profile of the user currently login to the App
|
|
57
|
+
* @returns
|
|
58
|
+
*/
|
|
59
|
+
this.updateUserProfile = function (profile) { return __awaiter(_this, void 0, void 0, function () {
|
|
60
|
+
var _this = this;
|
|
61
|
+
return __generator(this, function (_a) {
|
|
62
|
+
return [2 /*return*/, (0, common_1.toResult)(function () { return _this.wrappedModule.invoke('updateUserProfile', profile); })];
|
|
63
|
+
});
|
|
64
|
+
}); };
|
|
65
|
+
/**
|
|
66
|
+
* Lookup customer based on keyword.
|
|
67
|
+
* @param request
|
|
68
|
+
* @returns
|
|
69
|
+
*/
|
|
44
70
|
this.searchProfile = function (request) {
|
|
45
|
-
return common_1.toResult(function () { return _this.wrappedModule.invoke('searchProfile', request); });
|
|
71
|
+
return (0, common_1.toResult)(function () { return _this.wrappedModule.invoke('searchProfile', request); });
|
|
46
72
|
};
|
|
73
|
+
/**
|
|
74
|
+
* Update info of customer.
|
|
75
|
+
* @param request
|
|
76
|
+
* @returns
|
|
77
|
+
*/
|
|
47
78
|
this.upsertProfile = function (profile) { return __awaiter(_this, void 0, void 0, function () {
|
|
48
79
|
var _this = this;
|
|
49
80
|
return __generator(this, function (_a) {
|
|
50
|
-
return [2 /*return*/, common_1.toResult(function () { return _this.wrappedModule.invoke('upsertProfile', profile); })];
|
|
81
|
+
return [2 /*return*/, (0, common_1.toResult)(function () { return _this.wrappedModule.invoke('upsertProfile', profile); })];
|
|
51
82
|
});
|
|
52
83
|
}); };
|
|
53
84
|
this.registerProfile = function (request) {
|
|
54
|
-
return common_1.toResult(function () { return _this.wrappedModule.invoke('registerProfile', request); });
|
|
85
|
+
return (0, common_1.toResult)(function () { return _this.wrappedModule.invoke('registerProfile', request); });
|
|
55
86
|
};
|
|
56
87
|
this.createNewAddress = function (request) { return __awaiter(_this, void 0, void 0, function () {
|
|
57
88
|
var _this = this;
|
|
58
89
|
return __generator(this, function (_a) {
|
|
59
|
-
return [2 /*return*/, common_1.toResult(function () { return _this.wrappedModule.invoke('createNewAddress', request); })];
|
|
90
|
+
return [2 /*return*/, (0, common_1.toResult)(function () { return _this.wrappedModule.invoke('createNewAddress', request); })];
|
|
60
91
|
});
|
|
61
92
|
}); };
|
|
62
|
-
this.
|
|
93
|
+
this.updateAddress = function (request) { return __awaiter(_this, void 0, void 0, function () {
|
|
63
94
|
var _this = this;
|
|
64
95
|
return __generator(this, function (_a) {
|
|
65
|
-
return [2 /*return*/, common_1.toResult(function () { return _this.wrappedModule.invoke('
|
|
96
|
+
return [2 /*return*/, (0, common_1.toResult)(function () { return _this.wrappedModule.invoke('updateAddress', request); })];
|
|
66
97
|
});
|
|
67
98
|
}); };
|
|
68
|
-
this.
|
|
99
|
+
this.deleteAddress = function (request) { return __awaiter(_this, void 0, void 0, function () {
|
|
69
100
|
var _this = this;
|
|
70
101
|
return __generator(this, function (_a) {
|
|
71
|
-
return [2 /*return*/, common_1.toResult(function () { return _this.wrappedModule.invoke('
|
|
102
|
+
return [2 /*return*/, (0, common_1.toResult)(function () { return _this.wrappedModule.invoke('deleteAddress', request); })];
|
|
103
|
+
});
|
|
104
|
+
}); };
|
|
105
|
+
/**
|
|
106
|
+
* Get appFlow of the current login user
|
|
107
|
+
* @returns
|
|
108
|
+
*/
|
|
109
|
+
this.getOperationFlowConfig = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
110
|
+
var _this = this;
|
|
111
|
+
return __generator(this, function (_a) {
|
|
112
|
+
return [2 /*return*/, (0, common_1.toResult)(function () { return _this.wrappedModule.invoke('getOperationFlowConfig'); })];
|
|
72
113
|
});
|
|
73
114
|
}); };
|
|
74
115
|
this.changeDealer = function (request) { return __awaiter(_this, void 0, void 0, function () {
|
|
75
116
|
var _this = this;
|
|
76
117
|
return __generator(this, function (_a) {
|
|
77
|
-
return [2 /*return*/, common_1.toResult(function () { return _this.wrappedModule.invoke('changeDealer', request); })];
|
|
118
|
+
return [2 /*return*/, (0, common_1.toResult)(function () { return _this.wrappedModule.invoke('changeDealer', request); })];
|
|
78
119
|
});
|
|
79
120
|
}); };
|
|
80
121
|
this.fetchUserAddressList = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
81
122
|
var _this = this;
|
|
82
123
|
return __generator(this, function (_a) {
|
|
83
|
-
return [2 /*return*/, common_1.toResult(function () { return _this.wrappedModule.invoke('fetchUserAddress'); })];
|
|
124
|
+
return [2 /*return*/, (0, common_1.toResult)(function () { return _this.wrappedModule.invoke('fetchUserAddress'); })];
|
|
84
125
|
});
|
|
85
126
|
}); };
|
|
86
127
|
this.getDetailProfile = function (request) { return __awaiter(_this, void 0, void 0, function () {
|
|
87
128
|
var _this = this;
|
|
88
129
|
return __generator(this, function (_a) {
|
|
89
|
-
return [2 /*return*/, common_1.toResult(function () { return _this.wrappedModule.invoke('getDetailProfile', request); })];
|
|
130
|
+
return [2 /*return*/, (0, common_1.toResult)(function () { return _this.wrappedModule.invoke('getDetailProfile', request); })];
|
|
90
131
|
});
|
|
91
132
|
}); };
|
|
92
133
|
this.publishCustomer = function (customer) { return __awaiter(_this, void 0, void 0, function () {
|
|
93
134
|
var _this = this;
|
|
94
135
|
return __generator(this, function (_a) {
|
|
95
|
-
return [2 /*return*/, common_1.toResult(function () { return _this.wrappedModule.invoke('publishCustomer', customer); })];
|
|
136
|
+
return [2 /*return*/, (0, common_1.toResult)(function () { return _this.wrappedModule.invoke('publishCustomer', customer); })];
|
|
137
|
+
});
|
|
138
|
+
}); };
|
|
139
|
+
this.fetchCustomerTypes = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
140
|
+
var _this = this;
|
|
141
|
+
return __generator(this, function (_a) {
|
|
142
|
+
return [2 /*return*/, (0, common_1.toResult)(function () { return _this.wrappedModule.invoke('fetchCustomerTypes'); })];
|
|
96
143
|
});
|
|
97
144
|
}); };
|
|
98
145
|
this.wrappedModule = new common_1.ModuleWrapper('UserKitModule');
|
package/dist/user/types.d.ts
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
export interface SearchProfileRequest {
|
|
2
2
|
keyword?: string;
|
|
3
|
-
|
|
3
|
+
pageSize?: number;
|
|
4
4
|
page?: number;
|
|
5
5
|
filterDealer?: boolean;
|
|
6
6
|
}
|
|
7
|
-
export interface
|
|
8
|
-
data?: Profile[];
|
|
7
|
+
export interface Pagination {
|
|
9
8
|
totalItems: number;
|
|
10
9
|
currentPage: number;
|
|
11
10
|
pageSize: number;
|
|
12
|
-
isExisted: boolean;
|
|
13
11
|
}
|
|
12
|
+
export declare type SearchProfileResult = {
|
|
13
|
+
data?: Profile[];
|
|
14
|
+
isExisted: boolean;
|
|
15
|
+
} & Pagination;
|
|
14
16
|
export interface Profile {
|
|
15
17
|
id?: string;
|
|
16
18
|
taxCode?: string;
|
|
@@ -25,11 +27,20 @@ export interface Profile {
|
|
|
25
27
|
userType?: string;
|
|
26
28
|
telephone?: string;
|
|
27
29
|
isCompany?: boolean;
|
|
30
|
+
customerTypeId?: number;
|
|
28
31
|
sex?: string;
|
|
29
32
|
dob?: string;
|
|
30
33
|
billing?: BillingInfo;
|
|
31
34
|
surfAddress?: string;
|
|
32
35
|
userId?: string;
|
|
36
|
+
dealer?: Dealer;
|
|
37
|
+
}
|
|
38
|
+
export interface Dealer {
|
|
39
|
+
id?: string;
|
|
40
|
+
userId?: string;
|
|
41
|
+
name?: string;
|
|
42
|
+
telephone?: string;
|
|
43
|
+
address?: Address;
|
|
33
44
|
}
|
|
34
45
|
export interface Address {
|
|
35
46
|
id?: string;
|
|
@@ -70,13 +81,15 @@ export interface RegisterProfileRequest {
|
|
|
70
81
|
telephone?: string;
|
|
71
82
|
name?: string;
|
|
72
83
|
}
|
|
73
|
-
export interface
|
|
74
|
-
|
|
84
|
+
export interface OperationFlowConfig {
|
|
85
|
+
operationFlow: OperationFlow;
|
|
75
86
|
}
|
|
76
|
-
export
|
|
77
|
-
|
|
87
|
+
export declare enum OperationFlow {
|
|
88
|
+
DEALER = "dealer",
|
|
89
|
+
CONSUMER = "consumer",
|
|
90
|
+
STAFF = "staff"
|
|
78
91
|
}
|
|
79
|
-
export interface
|
|
92
|
+
export interface AddressRequest {
|
|
80
93
|
clientCode?: string;
|
|
81
94
|
email?: string;
|
|
82
95
|
telephone: string;
|
|
@@ -93,8 +106,19 @@ export interface NewAddressRequest {
|
|
|
93
106
|
addressNote?: string;
|
|
94
107
|
isDefault?: boolean;
|
|
95
108
|
}
|
|
109
|
+
export interface DeleteAddressRequest {
|
|
110
|
+
addressId: string;
|
|
111
|
+
}
|
|
96
112
|
export interface ChangeDealerResult {
|
|
97
113
|
message: string;
|
|
98
114
|
code: string;
|
|
99
115
|
isSuccess: boolean;
|
|
100
116
|
}
|
|
117
|
+
export declare type CustomerTypeResult = {
|
|
118
|
+
customerTypes: Array<CustomerType>;
|
|
119
|
+
} & Pagination;
|
|
120
|
+
export interface CustomerType {
|
|
121
|
+
id: number;
|
|
122
|
+
display: string;
|
|
123
|
+
platformId: number;
|
|
124
|
+
}
|
package/dist/user/types.js
CHANGED
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OperationFlow = void 0;
|
|
4
|
+
var OperationFlow;
|
|
5
|
+
(function (OperationFlow) {
|
|
6
|
+
OperationFlow["DEALER"] = "dealer";
|
|
7
|
+
OperationFlow["CONSUMER"] = "consumer";
|
|
8
|
+
OperationFlow["STAFF"] = "staff";
|
|
9
|
+
})(OperationFlow = exports.OperationFlow || (exports.OperationFlow = {}));
|
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@terra-js/terra-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0-alpha.10",
|
|
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",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"build": "tsc",
|
|
10
|
-
"
|
|
10
|
+
"bundle": "webpack --mode production",
|
|
11
|
+
"prepublish": "yarn run clean && yarn run build && yarn run bundle",
|
|
12
|
+
"clean": "rimraf dist && rimraf bundle"
|
|
11
13
|
},
|
|
12
14
|
"keywords": [
|
|
13
15
|
"teko",
|
|
@@ -21,13 +23,13 @@
|
|
|
21
23
|
"bundle/**/*"
|
|
22
24
|
],
|
|
23
25
|
"dependencies": {
|
|
24
|
-
"@terra-js/common": "0.1.0
|
|
26
|
+
"@terra-js/common": "0.1.0"
|
|
25
27
|
},
|
|
26
28
|
"devDependencies": {
|
|
29
|
+
"rimraf": "^3.0.2",
|
|
27
30
|
"ts-loader": "^9.2.2",
|
|
28
31
|
"typescript": "^4.3.2",
|
|
29
32
|
"webpack": "^5.38.1",
|
|
30
33
|
"webpack-cli": "^4.7.0"
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
+
}
|
|
35
|
+
}
|