starti.app 1.0.21 → 1.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/clientUser.js +4 -2
- package/package.json +1 -1
- package/umd/main.js +1 -1
package/dist/clientUser.js
CHANGED
|
@@ -10,8 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.ClientUser = void 0;
|
|
13
|
-
const index_1 = require("./index");
|
|
14
13
|
const config_1 = require("./config");
|
|
14
|
+
const index_1 = require("./index");
|
|
15
15
|
exports.ClientUser = new class extends EventTarget {
|
|
16
16
|
registerId(clientUserId) {
|
|
17
17
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -23,7 +23,9 @@ exports.ClientUser = new class extends EventTarget {
|
|
|
23
23
|
deviceId: deviceId
|
|
24
24
|
};
|
|
25
25
|
const response = yield fetch(config_1.baseUrl + '/ClientUser-registerId', {
|
|
26
|
-
body: JSON.stringify(params)
|
|
26
|
+
body: JSON.stringify(params),
|
|
27
|
+
headers: { 'Content-Type': 'application/json' },
|
|
28
|
+
method: 'POST',
|
|
27
29
|
});
|
|
28
30
|
if (!response.ok) {
|
|
29
31
|
console.warn('Failed to register logged in client user', clientUserId, params);
|
package/package.json
CHANGED
package/umd/main.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 i=t();for(var n in i)("object"==typeof exports?exports:e)[n]=i[n]}}(self,(()=>(()=>{"use strict";var e={752:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.App=void 0,t.App=new class extends EventTarget{constructor(){super(...arguments),this.startiappIsLoaded=!1}setStartiappIsLoaded(){this.startiappIsLoaded=!0}isStartiappLoaded(){return this.startiappIsLoaded}setAppUrl(e){AppIntegration.setAppUrl(e)}appInForegroundEventRecievedEvent(){this.dispatchEvent(new CustomEvent("appInForeground"))}openExternalBrowser(e){AppIntegration.openBrowser(e)}downloadFile(e,t){AppIntegration.download(e,t)}brandId(){return new Promise(((e,t)=>{this.resolveBrandId=e,AppIntegration.brandId()}))}requestReview(){AppIntegration.requestReview()}deviceId(){return new Promise(((e,t)=>{this.resolveDeviceId=e,AppIntegration.deviceId()}))}version(){return new Promise(((e,t)=>{this.resolveVersion=e,AppIntegration.version()}))}showStatusBar(){AppIntegration.showStatusBar()}hideStatusBar(){AppIntegration.hideStatusBar()}disableScreenRotation(){AppIntegration.disableScreenRotation()}enableScreenRotation(){AppIntegration.enableScreenRotation()}brandIdResult(e){this.resolveBrandId(e)}versionResult(e){this.resolveVersion(e)}deviceIdResult(e){this.resolveDeviceId(e)}navigatingPageEvent(e){this.dispatchEvent(new CustomEvent("navigatingPage",{detail:e}))}}},1:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Biometrics=void 0,t.Biometrics=new class extends EventTarget{constructor(){super(...arguments),this.defaultScanTitle="Prove you have fingers!",this.defaultScanReason="Can't let you in if you don't."}scan(e=this.defaultScanTitle,t=this.defaultScanReason){return new Promise(((i,n)=>{this.resolveScan=i;try{if(!BiometricsIntegration)return void n("Biometrics virker kun i starti.app");BiometricsIntegration.startScanning(e,t)}catch(e){n(e)}}))}startScanningResult(e){this.resolveScan(e)}getAuthenticationType(){return new Promise(((e,t)=>{this.resolveAuthType=e;try{if(!BiometricsIntegration)return void t("Biometrics virker kun i starti.app");BiometricsIntegration.getAuthenticationType()}catch(e){t(e)}}))}getAuthenticationTypeResult(e){this.resolveAuthType(e)}setSecuredContent(e){if(!BiometricsIntegration)throw new Error("Biometrics virker kun i starti.app");BiometricsIntegration.setSecuredContent(JSON.stringify(e))}getSecuredContent(e=this.defaultScanTitle,t=this.defaultScanReason){return new Promise(((i,n)=>{this.resolveGetContent=i;try{if(!BiometricsIntegration)return void n("Biometrics virker kun i starti.app");BiometricsIntegration.getSecuredContent(e,t)}catch(e){n(e)}}))}getSecuredContentResult(e){this.resolveGetContent(JSON.parse(e))}hasSecureContent(){return new Promise(((e,t)=>{this.resolveHasSecureContent=e;try{if(!BiometricsIntegration)return void t("Biometrics virker kun i starti.app");BiometricsIntegration.hasSecuredContent()}catch(e){t(e)}}))}hasSecureContentResult(e){this.resolveHasSecureContent(e)}removeSecuredContent(){if(!BiometricsIntegration)throw new Error("Biometrics virker kun i starti.app");BiometricsIntegration.removeSecuredContent()}}},495:function(e,t,i){var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ClientUser=void 0;const r=i(
|
|
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 i=t();for(var n in i)("object"==typeof exports?exports:e)[n]=i[n]}}(self,(()=>(()=>{"use strict";var e={752:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.App=void 0,t.App=new class extends EventTarget{constructor(){super(...arguments),this.startiappIsLoaded=!1}setStartiappIsLoaded(){this.startiappIsLoaded=!0}isStartiappLoaded(){return this.startiappIsLoaded}setAppUrl(e){AppIntegration.setAppUrl(e)}appInForegroundEventRecievedEvent(){this.dispatchEvent(new CustomEvent("appInForeground"))}openExternalBrowser(e){AppIntegration.openBrowser(e)}downloadFile(e,t){AppIntegration.download(e,t)}brandId(){return new Promise(((e,t)=>{this.resolveBrandId=e,AppIntegration.brandId()}))}requestReview(){AppIntegration.requestReview()}deviceId(){return new Promise(((e,t)=>{this.resolveDeviceId=e,AppIntegration.deviceId()}))}version(){return new Promise(((e,t)=>{this.resolveVersion=e,AppIntegration.version()}))}showStatusBar(){AppIntegration.showStatusBar()}hideStatusBar(){AppIntegration.hideStatusBar()}disableScreenRotation(){AppIntegration.disableScreenRotation()}enableScreenRotation(){AppIntegration.enableScreenRotation()}brandIdResult(e){this.resolveBrandId(e)}versionResult(e){this.resolveVersion(e)}deviceIdResult(e){this.resolveDeviceId(e)}navigatingPageEvent(e){this.dispatchEvent(new CustomEvent("navigatingPage",{detail:e}))}}},1:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Biometrics=void 0,t.Biometrics=new class extends EventTarget{constructor(){super(...arguments),this.defaultScanTitle="Prove you have fingers!",this.defaultScanReason="Can't let you in if you don't."}scan(e=this.defaultScanTitle,t=this.defaultScanReason){return new Promise(((i,n)=>{this.resolveScan=i;try{if(!BiometricsIntegration)return void n("Biometrics virker kun i starti.app");BiometricsIntegration.startScanning(e,t)}catch(e){n(e)}}))}startScanningResult(e){this.resolveScan(e)}getAuthenticationType(){return new Promise(((e,t)=>{this.resolveAuthType=e;try{if(!BiometricsIntegration)return void t("Biometrics virker kun i starti.app");BiometricsIntegration.getAuthenticationType()}catch(e){t(e)}}))}getAuthenticationTypeResult(e){this.resolveAuthType(e)}setSecuredContent(e){if(!BiometricsIntegration)throw new Error("Biometrics virker kun i starti.app");BiometricsIntegration.setSecuredContent(JSON.stringify(e))}getSecuredContent(e=this.defaultScanTitle,t=this.defaultScanReason){return new Promise(((i,n)=>{this.resolveGetContent=i;try{if(!BiometricsIntegration)return void n("Biometrics virker kun i starti.app");BiometricsIntegration.getSecuredContent(e,t)}catch(e){n(e)}}))}getSecuredContentResult(e){this.resolveGetContent(JSON.parse(e))}hasSecureContent(){return new Promise(((e,t)=>{this.resolveHasSecureContent=e;try{if(!BiometricsIntegration)return void t("Biometrics virker kun i starti.app");BiometricsIntegration.hasSecuredContent()}catch(e){t(e)}}))}hasSecureContentResult(e){this.resolveHasSecureContent(e)}removeSecuredContent(){if(!BiometricsIntegration)throw new Error("Biometrics virker kun i starti.app");BiometricsIntegration.removeSecuredContent()}}},495:function(e,t,i){var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ClientUser=void 0;const r=i(913),s=i(607);t.ClientUser=new class extends EventTarget{registerId(e){return n(this,void 0,void 0,(function*(){const t=yield s.default.App.brandId(),i=yield s.default.App.deviceId(),n={brandId:t,clientUserId:e,deviceId:i};(yield fetch(r.baseUrl+"/ClientUser-registerId",{body:JSON.stringify(n),headers:{"Content-Type":"application/json"},method:"POST"})).ok||console.warn("Failed to register logged in client user",e,n)}))}}},913:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baseUrl=void 0,t.baseUrl="https://europe-west3-startiapp-test.cloudfunctions.net"},607:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=i(752),r=i(1),s=i(495),o=i(983),a=i(681),c=i(952),u=window;u.appIntegrationsAreReady=()=>{n.App.setStartiappIsLoaded(),d.dispatchEvent(new CustomEvent("integrationsAreReady"))},u.App=n.App,u.User=s.ClientUser,u.QrScanner=c.QrScanner,u.PushNotification=a.PushNotification,u.NFC=o.NFC,u.Biometrics=r.Biometrics,u.appErrorEvent=e=>{d.dispatchEvent(new CustomEvent("appError",{detail:e}))};const d=new class extends EventTarget{constructor(){super(...arguments),this.App=n.App,this.Biometrics=r.Biometrics,this.User=s.ClientUser,this.NfcScanner=o.NFC,this.PushNotification=a.PushNotification,this.QrScanner=c.QrScanner}initialize(){if(void 0===AppIntegration)throw new Error("The starti.app API integration is not available.");n.App.isStartiappLoaded()&&AppIntegration.webAppIsReady()}addEventListener(e,t,i){super.addEventListener(e,t,i)}removeEventListener(e,t,i){super.removeEventListener(e,t,i)}};t.default=d,u.startiapp=d},983:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NFC=void 0,t.NFC=new class extends EventTarget{isNFCSupported(){return new Promise(((e,t)=>{this.resolveNFCSupported=e;try{if(!NFCIntegration)return void t("NFC virker kun i starti.app");NFCIntegration.isNFCSupported()}catch(e){t(e)}}))}isNFCSupportedResult(e){this.resolveNFCSupported(e)}startNFCReader(){return new Promise(((e,t)=>{this.resolveStartNFCReader=e;try{if(!NFCIntegration)return void t("NFC virker kun i starti.app");NFCIntegration.initNFC()}catch(e){t(e)}}))}startNFCReaderResult(e){this.resolveStartNFCReader(e)}stopNFCReader(){return new Promise(((e,t)=>{this.resolveStopNFCReader=e;try{if(!NFCIntegration)return void t("NFC virker kun i starti.app");NFCIntegration.stopListening()}catch(e){t(e)}}))}stopListeningResult(e){this.resolveStopNFCReader(e)}nfcTagResultRecievedEvent(e){const t=new CustomEvent("nfcTagScanned",{detail:e});this.dispatchEvent(t)}}},681:function(e,t,i){var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.PushNotification=void 0;const r=i(913),s=i(607);t.PushNotification=new class extends EventTarget{requestAccess(){return n(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{this.resolveRequestAccess=e,PushNotificationIntegration.requestAccess()}))}))}requestAccessResult(e){this.resolveRequestAccess(e)}initialize(){if(!PushNotificationIntegration)throw new Error("PushNotificationIntegration is not available");return new Promise(((e,t)=>{this.resolveInitialize=e,PushNotificationIntegration.initialize()}))}initializeResult(e){this.resolveInitialize(e)}getLastPublishedToken(){return new Promise(((e,t)=>{this.resolveString=e,PushNotificationIntegration.getLastPublishedToken()}))}getFCMToken(){return new Promise(((e,t)=>{this.resolveFCMToken=e,PushNotificationIntegration.getFCMToken()}))}getFCMTokenResult(e){this.resolveFCMToken(e)}getLastPublishedTokenResult(e){this.resolveString(e)}tokenReceivedEvent(e){this.dispatchEvent(new CustomEvent("tokenReceived",{detail:e}))}notificationReceivedEvent(e){this.dispatchEvent(new CustomEvent("notificationReceived",{detail:e}))}subscribeToTopics(e){return n(this,void 0,void 0,(function*(){PushNotificationIntegration.firebasePushNotificationSubscribeToTopics(e);const t=yield this.getLastPublishedToken(),i=yield s.default.App.brandId(),n=yield s.default.App.deviceId(),o=[];e.forEach((e=>{const s={brand:i,topic:e,token:t,deviceId:n},a=fetch(r.baseUrl+"/PushNotification-subscribeToTopic",{body:JSON.stringify(s)});o.push(a)})),(yield Promise.all(o)).forEach(((t,i)=>{t.ok||console.warn("Failed to sign up to topic",i,e[i])}))}))}unsubscribeFromTopics(e){return n(this,void 0,void 0,(function*(){PushNotificationIntegration.firebasePushNotificationTopicsUnsubscribe(e);const t=yield this.getLastPublishedToken(),i=yield s.default.App.brandId(),n=yield s.default.App.deviceId(),o=[];e.forEach((e=>{const s={brand:i,topic:e,token:t,deviceId:n},a=fetch(r.baseUrl+"/PushNotification-unSubscribeFromTopic",{body:JSON.stringify(s)});o.push(a)})),(yield Promise.all(o)).forEach(((t,i)=>{t.ok||console.warn("Failed to unsubscribe from topic",i,e[i])}))}))}firebasePushNotificationTopicsUnsubscribeResult(e){}firebasePushNotificationSubscribeToTopicsResult(e){}}},952:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.QrScanner=void 0,t.QrScanner=new class extends EventTarget{scan(){return new Promise(((e,t)=>{this.resolveScan=e;try{if(!QrScannerIntegration)return void e("Scanner virker kun i starti.app");QrScannerIntegration.startQrCodeScanner()}catch(e){t(e)}}))}qrResultRecievedEvent(e){this.resolveScan(e)}isCameraAccessGranted(){return new Promise(((e,t)=>{this.resolveCameraAccessGranted=e;try{if(!QrScannerIntegration)return void t("Scanner virker kun i starti.app");QrScannerIntegration.isCameraAccessGranted()}catch(e){t(e)}}))}isCameraAccessGrantedResult(e){this.resolveCameraAccessGranted(e)}requestCameraAccess(){return new Promise(((e,t)=>{this.resolveRequestCameraAccess=e;try{if(!QrScannerIntegration)return void t("Scanner virker kun i starti.app");QrScannerIntegration.requestCameraAccess()}catch(e){t(e)}}))}requestCameraAccessResult(e){this.resolveRequestCameraAccess(e)}}}},t={};return function i(n){var r=t[n];if(void 0!==r)return r.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,i),s.exports}(607)})()));
|