@gataca/qr 3.0.11 → 4.0.0
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/{esm/qr-code-styling-0eeb38d5.js → cjs/gat-icon-check-c88a30ed.js} +15 -1
- package/dist/cjs/{gataca-qr_2.cjs.entry.js → gataca-qr_3.cjs.entry.js} +380 -45
- package/dist/cjs/gataca-qrws.cjs.entry.js +6 -7
- package/dist/cjs/gataca-ssibuttonws.cjs.entry.js +61 -0
- package/dist/cjs/gatacaqr.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/gataca-qr/components/qr/QR.js +2 -2
- package/dist/collection/components/gataca-qr/components/readQR/ReadQR.js +4 -2
- package/dist/collection/components/gataca-qr/gataca-qr.js +26 -7
- package/dist/collection/components/gataca-qrdisplay/gataca-qrdisplay.js +22 -0
- package/dist/collection/components/gataca-ssibutton/gataca-ssibutton.js +163 -3
- package/dist/components/{gat-icon-alert.js → gat-icon-check.js} +3 -3
- package/dist/components/gataca-qr2.js +40 -37
- package/dist/components/gataca-qrdisplay2.js +5 -0
- package/dist/components/gataca-qrws2.js +1 -1
- package/dist/components/gataca-ssibutton2.js +88 -4
- package/dist/components/index.js +1 -1
- package/dist/{cjs/qr-code-styling-412bbc7a.js → esm/gat-icon-check-c188cd29.js} +8 -2
- package/dist/esm/{gataca-qr_2.entry.js → gataca-qr_3.entry.js} +377 -43
- package/dist/esm/gataca-qrws.entry.js +1 -2
- package/dist/esm/gataca-ssibuttonws.entry.js +57 -0
- package/dist/esm/gatacaqr.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/gatacaqr/gatacaqr.esm.js +1 -1
- package/dist/gatacaqr/p-5be73956.js +1 -0
- package/dist/gatacaqr/p-948e7d94.entry.js +1 -0
- package/dist/gatacaqr/p-e94e9be8.entry.js +1 -0
- package/dist/gatacaqr/p-fb41fad9.entry.js +1 -0
- package/dist/types/components/gataca-qr/components/qr/QR.d.ts +3 -1
- package/dist/types/components/gataca-qr/components/readQR/ReadQR.d.ts +2 -0
- package/dist/types/components/gataca-qr/gataca-qr.d.ts +11 -2
- package/dist/types/components/gataca-qrdisplay/gataca-qrdisplay.d.ts +5 -0
- package/dist/types/components/gataca-ssibutton/gataca-ssibutton.d.ts +30 -1
- package/dist/types/components.d.ts +50 -0
- package/package.json +1 -1
- package/dist/cjs/gat-icon-alert-0ad19b26.js +0 -14
- package/dist/cjs/gataca-ssibutton_2.cjs.entry.js +0 -313
- package/dist/esm/gat-icon-alert-7b06ef3a.js +0 -9
- package/dist/esm/gataca-ssibutton_2.entry.js +0 -308
- package/dist/gatacaqr/p-0be4566d.js +0 -1
- package/dist/gatacaqr/p-2adc0bcc.entry.js +0 -1
- package/dist/gatacaqr/p-2ddbc2fc.entry.js +0 -1
- package/dist/gatacaqr/p-d2dd7c85.entry.js +0 -1
- package/dist/gatacaqr/p-ea783014.js +0 -1
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-93d47a75.js');
|
|
6
|
+
|
|
7
|
+
const gatacaSsibuttonwsCss = "@import url(\"https://fonts.googleapis.com/css2?family=Work+Sans:wght@300;400&display=swap\"); html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:\"\";content:none}table{border-collapse:collapse;border-spacing:0}.img-fluid{height:auto;max-width:50%}img{margin-left:auto;margin-right:auto}.buttonContainer{display:inline-block;text-align:right;padding:10px;position:relative}.gatacaButtonWrapper{margin:8px}.gatacaButtonWrapper .gatacaButton{display:flex;min-width:100px;padding:8px 8px;background-color:white;font-size:12px;font-family:\"Work Sans\", sans-serif;letter-spacing:1px;font-weight:2;justify-content:space-between;align-items:center;border-radius:6px;border:1px solid rgba(24, 27, 94, 0.5);color:rgba(24, 27, 94, 0.8);box-shadow:0px 1px 3px rgba(48, 48, 48, 0.15);cursor:pointer}.gatacaButtonWrapper .gatacaButton>span{margin-right:10px}.gatacaButtonWrapper .gatacaButton:hover{box-shadow:0px 2px 8px rgba(48, 48, 48, 0.1)}.gatacaButtonWrapper .buttonText{text-align:right;font-size:8px;color:rgba(24, 27, 94, 0.5);font-family:\"Helvetica Neue\", sans-serif;letter-spacing:1px;padding-right:8px;font-weight:1}.gatacaButtonWrapper .buttonImg{height:25px;width:25px;margin:0;margin-right:20px}";
|
|
8
|
+
|
|
9
|
+
const PHONE_ICON = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAYAAACN1PRVAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAHvSURBVHgB3ZZPTttAFMbfe3YjL7qYLopcpZXSG7Q3CDfIsqrSJpyg5QQtJ2h7glgUdVs4AeEE5AYEQSDAgtnw357Hm0hAQDaeIRFCfFKyeKPxzzPzvc+DUKCZN80GEv1ABgWOQgSdGbOwv7u0nDueV4zjTzUIKhuAZna4vdQFR828azbI0K/TI/qodaLvjlP+tLDGDCs+IKv9Lbsi7kcv0w9541Q0EREPYcoieEQ9KiyECRXHzbpBUOcnYTfPFOOaaGVx9WsLiDrSIp0iU0wFNgIx/AQyc9I/OmOjy+Y8aBvHQcDUYebewc6/Xtk8J5htcg5efEPGhk0JtqkyBjo7DuZcnuO2sqCyKv8rUDmfTS9IBURqBAL+I6CkzBjOMOs22TLY21n8fl17KzXR3uDvb/CQk0GEdfvN07QvpnAOaGfYaRT25JzU6+rnG2tTpcWAy+Cp0m3U/URLms8HWfg/rn6RFaGSs9KQkZMpvGBWNs2Vandt46ac6YNBuc0fDLMaOU5DFybQ8039p/KJ4bq4rwPewtqoM/1gsCm/NfBXvWjgHhhuDAeLyd3qVSifHQULeZkou9EqemLhmUmav8qrZ4GEMGA7ivzjKvfeqGptFV2YdWPMPHHq0cCh3DdpVdLl/XCY9J1gVvbCiWa6N+JLocPFjCsx9cAAAAAASUVORK5CYII=';
|
|
10
|
+
const GatacaSSIButtonWS = class {
|
|
11
|
+
constructor(hostRef) {
|
|
12
|
+
index.registerInstance(this, hostRef);
|
|
13
|
+
this.gatacaLoginCompleted = index.createEvent(this, "gatacaLoginCompleted", 7);
|
|
14
|
+
this.gatacaLoginFailed = index.createEvent(this, "gatacaLoginFailed", 7);
|
|
15
|
+
this.buttonText = 'Easy login';
|
|
16
|
+
this.successCallback = undefined;
|
|
17
|
+
this.errorCallback = undefined;
|
|
18
|
+
this.qrType = 'svg';
|
|
19
|
+
this.qrRole = undefined;
|
|
20
|
+
this.callbackServer = undefined;
|
|
21
|
+
this.socketEndpoint = undefined;
|
|
22
|
+
this.sessionTimeout = undefined;
|
|
23
|
+
this.wsOnOpen = undefined;
|
|
24
|
+
this.wsOnMessage = undefined;
|
|
25
|
+
this.autostart = true;
|
|
26
|
+
this.autorefresh = false;
|
|
27
|
+
this.v = '3';
|
|
28
|
+
this.qrModalTitle = 'Quick Access';
|
|
29
|
+
this.qrModalDescription = 'Sign up or sign in by scanning the QR Code with the Gataca Wallet';
|
|
30
|
+
this.hideBrandTitle = false;
|
|
31
|
+
this.dynamicLink = true;
|
|
32
|
+
this.open = false;
|
|
33
|
+
this.qr = (index.h("gataca-qrws", { wsOnMessage: this.wsOnMessage, wsOnOpen: this.wsOnOpen, successCallback: this.successCallback, errorCallback: this.errorCallback, qrRole: this.qrRole, qrType: this.qrType, callbackServer: this.callbackServer, sessionTimeout: this.sessionTimeout, socketEndpoint: this.socketEndpoint, autostart: true, autorefresh: this.autorefresh, v: this.v, qrModalTitle: this.qrModalTitle, qrModalDescription: this.qrModalDescription, hideBrandTitle: this.hideBrandTitle, dynamicLink: this.dynamicLink }));
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Retrieve manually the session data on a successful login
|
|
37
|
+
*/
|
|
38
|
+
async getSessionData() {
|
|
39
|
+
return this.qr.getSessionData();
|
|
40
|
+
}
|
|
41
|
+
renderModal() {
|
|
42
|
+
return this.qr;
|
|
43
|
+
}
|
|
44
|
+
renderButton() {
|
|
45
|
+
return (index.h("div", { class: "gatacaButtonWrapper" }, index.h("button", { class: "gatacaButton", onClick: () => {
|
|
46
|
+
this.open = !this.open;
|
|
47
|
+
if (this.open) {
|
|
48
|
+
this.qr.display();
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
this.qr.stop();
|
|
52
|
+
}
|
|
53
|
+
} }, index.h("img", { src: PHONE_ICON, class: "buttonImg", alt: this.buttonText }), index.h("span", null, this.buttonText))));
|
|
54
|
+
}
|
|
55
|
+
render() {
|
|
56
|
+
return (index.h("div", { class: "buttonContainer" }, this.renderButton(), this.open && this.renderModal()));
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
GatacaSSIButtonWS.style = gatacaSsibuttonwsCss;
|
|
60
|
+
|
|
61
|
+
exports.gataca_ssibuttonws = GatacaSSIButtonWS;
|
package/dist/cjs/gatacaqr.cjs.js
CHANGED
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["gataca-
|
|
18
|
+
return index.bootstrapLazy([["gataca-qr_3.cjs",[[1,"gataca-ssibutton",{"buttonText":[1,"button-text"],"buttonDCAPIText":[1,"button-d-c-a-p-i-text"],"qrType":[1,"qr-type"],"autostart":[4],"checkStatus":[16],"createSession":[16],"fillSession":[16],"successCallback":[16],"errorCallback":[16],"handleCheckAppLoading":[16],"checkAppTimeout":[2,"check-app-timeout"],"qrRole":[1,"qr-role"],"callbackServer":[1,"callback-server"],"sessionTimeout":[2,"session-timeout"],"pollingFrequency":[2,"polling-frequency"],"autorefresh":[4],"v":[1],"qrModalTitle":[1,"qr-modal-title"],"modalTitleColor":[1,"modal-title-color"],"qrModalDescription":[1,"qr-modal-description"],"hideBrandTitle":[4,"hide-brand-title"],"dynamicLink":[4,"dynamic-link"],"logoSize":[2,"logo-size"],"logoSrc":[1,"logo-src"],"qrCodeExpiredLabel":[1,"qr-code-expired-label"],"credentialsNotValidatedLabel":[1,"credentials-not-validated-label"],"clickInsideBoxLabel":[1,"click-inside-box-label"],"refreshQrLabel":[1,"refresh-qr-label"],"scanQrLabel":[1,"scan-qr-label"],"userNotScanInTimeErrorLabel":[1,"user-not-scan-in-time-error-label"],"credsNotValidatedErrorLabel":[1,"creds-not-validated-error-label"],"failedLoginErrorLabel":[1,"failed-login-error-label"],"successLoginLabel":[1,"success-login-label"],"byBrandLabel":[1,"by-brand-label"],"waitingStartSessionLabel":[1,"waiting-start-session-label"],"enableDcApi":[4,"enable-dc-api"],"hideQrModalDescription":[4,"hide-qr-modal-description"],"qrStyle":[16],"open":[32],"sessionId":[32],"authenticationRequest":[32],"sessionData":[32],"result":[32],"getSessionData":[64],"startMobilePolling":[64],"stop":[64]}],[1,"gataca-qr",{"checkStatus":[16],"createSession":[16],"successCallback":[16],"errorCallback":[16],"qrRole":[1,"qr-role"],"qrType":[1,"qr-type"],"callbackServer":[1,"callback-server"],"autostart":[4],"autorefresh":[4],"v":[1],"qrModalTitle":[1,"qr-modal-title"],"modalTitleColor":[1,"modal-title-color"],"qrModalDescription":[1,"qr-modal-description"],"hideModalTexts":[4,"hide-modal-texts"],"hideModalBoxShadow":[4,"hide-modal-box-shadow"],"hideBrandTitle":[4,"hide-brand-title"],"logoSize":[2,"logo-size"],"logoSrc":[1,"logo-src"],"qrSize":[2,"qr-size"],"modalWidth":[2,"modal-width"],"modalHeight":[2,"modal-height"],"qrCodeExpiredLabel":[1,"qr-code-expired-label"],"credentialsNotValidatedLabel":[1,"credentials-not-validated-label"],"clickInsideBoxLabel":[1,"click-inside-box-label"],"refreshQrLabel":[1,"refresh-qr-label"],"scanQrLabel":[1,"scan-qr-label"],"userNotScanInTimeErrorLabel":[1,"user-not-scan-in-time-error-label"],"credsNotValidatedErrorLabel":[1,"creds-not-validated-error-label"],"failedLoginErrorLabel":[1,"failed-login-error-label"],"successLoginLabel":[1,"success-login-label"],"byBrandLabel":[1,"by-brand-label"],"waitingStartSessionLabel":[1,"waiting-start-session-label"],"readQrTitle":[1,"read-qr-title"],"readQrDescription":[1,"read-qr-description"],"hideQrModalDescription":[4,"hide-qr-modal-description"],"sessionTimeout":[2,"session-timeout"],"pollingFrequency":[2,"polling-frequency"],"dynamicLink":[4,"dynamic-link"],"qrStyle":[16],"sessionId":[32],"authenticationRequest":[32],"sessionData":[32],"result":[32],"display":[64],"stop":[64],"getSessionData":[64]}],[0,"gataca-qrdisplay",{"qrData":[1,"qr-data"],"qrType":[1,"qr-type"],"size":[2],"logoSize":[2,"logo-size"],"logoSrc":[1,"logo-src"],"qrColor":[1,"qr-color"],"bgColor":[1,"bg-color"],"rounded":[4]}]]],["gataca-qrws.cjs",[[1,"gataca-qrws",{"successCallback":[16],"errorCallback":[16],"qrRole":[1,"qr-role"],"qrType":[1,"qr-type"],"callbackServer":[1,"callback-server"],"socketEndpoint":[1,"socket-endpoint"],"sessionTimeout":[2,"session-timeout"],"wsOnOpen":[16],"wsOnMessage":[16],"autostart":[4],"autorefresh":[4],"v":[1],"qrModalTitle":[1,"qr-modal-title"],"modalTitleColor":[1,"modal-title-color"],"qrModalDescription":[1,"qr-modal-description"],"hideModalTexts":[4,"hide-modal-texts"],"hideModalBoxShadow":[4,"hide-modal-box-shadow"],"hideBrandTitle":[4,"hide-brand-title"],"logoSize":[2,"logo-size"],"logoSrc":[1,"logo-src"],"qrSize":[2,"qr-size"],"modalWidth":[2,"modal-width"],"modalHeight":[2,"modal-height"],"qrCodeExpiredLabel":[1,"qr-code-expired-label"],"credentialsNotValidatedLabel":[1,"credentials-not-validated-label"],"clickInsideBoxLabel":[1,"click-inside-box-label"],"refreshQrLabel":[1,"refresh-qr-label"],"scanQrLabel":[1,"scan-qr-label"],"userNotScanInTimeErrorLabel":[1,"user-not-scan-in-time-error-label"],"credsNotValidatedErrorLabel":[1,"creds-not-validated-error-label"],"failedLoginErrorLabel":[1,"failed-login-error-label"],"successLoginLabel":[1,"success-login-label"],"byBrandLabel":[1,"by-brand-label"],"waitingStartSessionLabel":[1,"waiting-start-session-label"],"readQrTitle":[1,"read-qr-title"],"readQrDescription":[1,"read-qr-description"],"hideQrModalDescription":[4,"hide-qr-modal-description"],"dynamicLink":[4,"dynamic-link"],"sessionId":[32],"authenticationRequest":[32],"sessionData":[32],"result":[32],"display":[64],"stop":[64],"getSessionData":[64]},[[2,"sessionMsg","sessionMsgReceived"]]]]],["gataca-ssibuttonws.cjs",[[1,"gataca-ssibuttonws",{"buttonText":[1,"button-text"],"successCallback":[16],"errorCallback":[16],"qrType":[1,"qr-type"],"qrRole":[1,"qr-role"],"callbackServer":[1,"callback-server"],"socketEndpoint":[1,"socket-endpoint"],"sessionTimeout":[2,"session-timeout"],"wsOnOpen":[16],"wsOnMessage":[16],"autostart":[4],"autorefresh":[4],"v":[1],"qrModalTitle":[1,"qr-modal-title"],"qrModalDescription":[1,"qr-modal-description"],"hideBrandTitle":[4,"hide-brand-title"],"dynamicLink":[4,"dynamic-link"],"open":[32],"getSessionData":[64]}]]],["gataca-autoqr.cjs",[[1,"gataca-autoqr",{"configId":[1,"config-id"],"qrType":[1,"qr-type"],"configRepository":[1,"config-repository"],"successCallback":[16],"errorCallback":[16],"checkStatus":[16],"createSession":[16],"wsOnOpen":[16],"wsOnMessage":[16],"config":[32],"loading":[32],"getSessionData":[64]}]]]], options);
|
|
19
19
|
});
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["gataca-
|
|
17
|
+
return index.bootstrapLazy([["gataca-qr_3.cjs",[[1,"gataca-ssibutton",{"buttonText":[1,"button-text"],"buttonDCAPIText":[1,"button-d-c-a-p-i-text"],"qrType":[1,"qr-type"],"autostart":[4],"checkStatus":[16],"createSession":[16],"fillSession":[16],"successCallback":[16],"errorCallback":[16],"handleCheckAppLoading":[16],"checkAppTimeout":[2,"check-app-timeout"],"qrRole":[1,"qr-role"],"callbackServer":[1,"callback-server"],"sessionTimeout":[2,"session-timeout"],"pollingFrequency":[2,"polling-frequency"],"autorefresh":[4],"v":[1],"qrModalTitle":[1,"qr-modal-title"],"modalTitleColor":[1,"modal-title-color"],"qrModalDescription":[1,"qr-modal-description"],"hideBrandTitle":[4,"hide-brand-title"],"dynamicLink":[4,"dynamic-link"],"logoSize":[2,"logo-size"],"logoSrc":[1,"logo-src"],"qrCodeExpiredLabel":[1,"qr-code-expired-label"],"credentialsNotValidatedLabel":[1,"credentials-not-validated-label"],"clickInsideBoxLabel":[1,"click-inside-box-label"],"refreshQrLabel":[1,"refresh-qr-label"],"scanQrLabel":[1,"scan-qr-label"],"userNotScanInTimeErrorLabel":[1,"user-not-scan-in-time-error-label"],"credsNotValidatedErrorLabel":[1,"creds-not-validated-error-label"],"failedLoginErrorLabel":[1,"failed-login-error-label"],"successLoginLabel":[1,"success-login-label"],"byBrandLabel":[1,"by-brand-label"],"waitingStartSessionLabel":[1,"waiting-start-session-label"],"enableDcApi":[4,"enable-dc-api"],"hideQrModalDescription":[4,"hide-qr-modal-description"],"qrStyle":[16],"open":[32],"sessionId":[32],"authenticationRequest":[32],"sessionData":[32],"result":[32],"getSessionData":[64],"startMobilePolling":[64],"stop":[64]}],[1,"gataca-qr",{"checkStatus":[16],"createSession":[16],"successCallback":[16],"errorCallback":[16],"qrRole":[1,"qr-role"],"qrType":[1,"qr-type"],"callbackServer":[1,"callback-server"],"autostart":[4],"autorefresh":[4],"v":[1],"qrModalTitle":[1,"qr-modal-title"],"modalTitleColor":[1,"modal-title-color"],"qrModalDescription":[1,"qr-modal-description"],"hideModalTexts":[4,"hide-modal-texts"],"hideModalBoxShadow":[4,"hide-modal-box-shadow"],"hideBrandTitle":[4,"hide-brand-title"],"logoSize":[2,"logo-size"],"logoSrc":[1,"logo-src"],"qrSize":[2,"qr-size"],"modalWidth":[2,"modal-width"],"modalHeight":[2,"modal-height"],"qrCodeExpiredLabel":[1,"qr-code-expired-label"],"credentialsNotValidatedLabel":[1,"credentials-not-validated-label"],"clickInsideBoxLabel":[1,"click-inside-box-label"],"refreshQrLabel":[1,"refresh-qr-label"],"scanQrLabel":[1,"scan-qr-label"],"userNotScanInTimeErrorLabel":[1,"user-not-scan-in-time-error-label"],"credsNotValidatedErrorLabel":[1,"creds-not-validated-error-label"],"failedLoginErrorLabel":[1,"failed-login-error-label"],"successLoginLabel":[1,"success-login-label"],"byBrandLabel":[1,"by-brand-label"],"waitingStartSessionLabel":[1,"waiting-start-session-label"],"readQrTitle":[1,"read-qr-title"],"readQrDescription":[1,"read-qr-description"],"hideQrModalDescription":[4,"hide-qr-modal-description"],"sessionTimeout":[2,"session-timeout"],"pollingFrequency":[2,"polling-frequency"],"dynamicLink":[4,"dynamic-link"],"qrStyle":[16],"sessionId":[32],"authenticationRequest":[32],"sessionData":[32],"result":[32],"display":[64],"stop":[64],"getSessionData":[64]}],[0,"gataca-qrdisplay",{"qrData":[1,"qr-data"],"qrType":[1,"qr-type"],"size":[2],"logoSize":[2,"logo-size"],"logoSrc":[1,"logo-src"],"qrColor":[1,"qr-color"],"bgColor":[1,"bg-color"],"rounded":[4]}]]],["gataca-qrws.cjs",[[1,"gataca-qrws",{"successCallback":[16],"errorCallback":[16],"qrRole":[1,"qr-role"],"qrType":[1,"qr-type"],"callbackServer":[1,"callback-server"],"socketEndpoint":[1,"socket-endpoint"],"sessionTimeout":[2,"session-timeout"],"wsOnOpen":[16],"wsOnMessage":[16],"autostart":[4],"autorefresh":[4],"v":[1],"qrModalTitle":[1,"qr-modal-title"],"modalTitleColor":[1,"modal-title-color"],"qrModalDescription":[1,"qr-modal-description"],"hideModalTexts":[4,"hide-modal-texts"],"hideModalBoxShadow":[4,"hide-modal-box-shadow"],"hideBrandTitle":[4,"hide-brand-title"],"logoSize":[2,"logo-size"],"logoSrc":[1,"logo-src"],"qrSize":[2,"qr-size"],"modalWidth":[2,"modal-width"],"modalHeight":[2,"modal-height"],"qrCodeExpiredLabel":[1,"qr-code-expired-label"],"credentialsNotValidatedLabel":[1,"credentials-not-validated-label"],"clickInsideBoxLabel":[1,"click-inside-box-label"],"refreshQrLabel":[1,"refresh-qr-label"],"scanQrLabel":[1,"scan-qr-label"],"userNotScanInTimeErrorLabel":[1,"user-not-scan-in-time-error-label"],"credsNotValidatedErrorLabel":[1,"creds-not-validated-error-label"],"failedLoginErrorLabel":[1,"failed-login-error-label"],"successLoginLabel":[1,"success-login-label"],"byBrandLabel":[1,"by-brand-label"],"waitingStartSessionLabel":[1,"waiting-start-session-label"],"readQrTitle":[1,"read-qr-title"],"readQrDescription":[1,"read-qr-description"],"hideQrModalDescription":[4,"hide-qr-modal-description"],"dynamicLink":[4,"dynamic-link"],"sessionId":[32],"authenticationRequest":[32],"sessionData":[32],"result":[32],"display":[64],"stop":[64],"getSessionData":[64]},[[2,"sessionMsg","sessionMsgReceived"]]]]],["gataca-ssibuttonws.cjs",[[1,"gataca-ssibuttonws",{"buttonText":[1,"button-text"],"successCallback":[16],"errorCallback":[16],"qrType":[1,"qr-type"],"qrRole":[1,"qr-role"],"callbackServer":[1,"callback-server"],"socketEndpoint":[1,"socket-endpoint"],"sessionTimeout":[2,"session-timeout"],"wsOnOpen":[16],"wsOnMessage":[16],"autostart":[4],"autorefresh":[4],"v":[1],"qrModalTitle":[1,"qr-modal-title"],"qrModalDescription":[1,"qr-modal-description"],"hideBrandTitle":[4,"hide-brand-title"],"dynamicLink":[4,"dynamic-link"],"open":[32],"getSessionData":[64]}]]],["gataca-autoqr.cjs",[[1,"gataca-autoqr",{"configId":[1,"config-id"],"qrType":[1,"qr-type"],"configRepository":[1,"config-repository"],"successCallback":[16],"errorCallback":[16],"checkStatus":[16],"createSession":[16],"wsOnOpen":[16],"wsOnMessage":[16],"config":[32],"loading":[32],"getSessionData":[64]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h } from '@stencil/core';
|
|
2
2
|
export const QR = (props) => {
|
|
3
|
-
const { value, useLogo, logoSrc, size, qrType } = props;
|
|
4
|
-
return h("gataca-qrdisplay", { qrData: value, rounded: true, qrType: qrType, size: size, "logo-size": useLogo ? 0.33 : 0, "logo-src": logoSrc });
|
|
3
|
+
const { value, useLogo, logoSrc, size, qrType, style } = props;
|
|
4
|
+
return h("gataca-qrdisplay", { qrData: value, rounded: true, qrType: qrType, size: size, "logo-size": useLogo ? 0.33 : 0, "logo-src": logoSrc, qrColor: style === null || style === void 0 ? void 0 : style.color, bgColor: style === null || style === void 0 ? void 0 : style.bgColor });
|
|
5
5
|
};
|
|
@@ -2,10 +2,12 @@ import { h } from '@stencil/core';
|
|
|
2
2
|
import { AnimatedLoader } from './components/AnimatedLoader';
|
|
3
3
|
export const ReadQR = (props) => {
|
|
4
4
|
var _a;
|
|
5
|
-
const { modalWidth, readQrMessages, renderQR, url, sizeQR } = props;
|
|
5
|
+
const { modalWidth, readQrMessages, renderQR, url, sizeQR, style } = props;
|
|
6
6
|
return (h("div", { class: "blured", style: {
|
|
7
7
|
width: (modalWidth - 48).toString() + 'px',
|
|
8
|
-
height: modalWidth ? ((_a = (modalWidth - 48)) === null || _a === void 0 ? void 0 : _a.toString()) + 'px' : ''
|
|
8
|
+
height: modalWidth ? ((_a = (modalWidth - 48)) === null || _a === void 0 ? void 0 : _a.toString()) + 'px' : '',
|
|
9
|
+
backgroundColor: style === null || style === void 0 ? void 0 : style.bgColor,
|
|
10
|
+
color: style === null || style === void 0 ? void 0 : style.color
|
|
9
11
|
} }, h("div", { id: "notify" }, h(AnimatedLoader, null), h("p", { class: "notify-text" }, readQrMessages === null || readQrMessages === void 0 ? void 0 :
|
|
10
12
|
readQrMessages.title, " "), h("p", { class: "notify-text bold" }, readQrMessages === null || readQrMessages === void 0 ? void 0 : readQrMessages.description)), h("div", { id: "qrwait" }, renderQR(url, false, sizeQR))));
|
|
11
13
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { h } from '@stencil/core';
|
|
2
2
|
import logoGataca from '../../assets/images/logo_gataca.svg';
|
|
3
|
-
import '../gataca-qrdisplay/gataca-qrdisplay';
|
|
4
3
|
import { base64UrlEncode, checkMobile, RESULT_STATUS } from '../../utils/utils';
|
|
5
|
-
import
|
|
6
|
-
import { RetryButton } from './components/retryButton/RetryButton';
|
|
7
|
-
import { ReadQR } from './components/readQR/ReadQR';
|
|
4
|
+
import '../gataca-qrdisplay/gataca-qrdisplay';
|
|
8
5
|
import { QR } from './components/qr/QR';
|
|
6
|
+
import { ReadQR } from './components/readQR/ReadQR';
|
|
7
|
+
import { RetryButton } from './components/retryButton/RetryButton';
|
|
8
|
+
import { Success } from './components/success/Success';
|
|
9
9
|
const DEEP_LINK_PREFIX = 'https://api.gataca.io/qr/redirect.html';
|
|
10
10
|
//Default values
|
|
11
11
|
const DEFAULT_SESSION_TIMEOUT = 300; //5mins as in connect
|
|
12
12
|
const DEFAULT_POLLING_FREQ = 3;
|
|
13
13
|
export class GatacaQR {
|
|
14
|
-
constructor() { this.checkStatus = undefined; this.createSession = undefined; this.successCallback = undefined; this.errorCallback = undefined; this.qrRole = undefined; this.qrType = 'svg'; this.callbackServer = undefined; this.autostart = true; this.autorefresh = false; this.v = '3'; this.qrModalTitle = 'Quick Access'; this.modalTitleColor = '#4745B7'; this.qrModalDescription = 'Sign up or sign in by scanning the QR Code with the Gataca Wallet'; this.hideModalTexts = false; this.hideModalBoxShadow = false; this.hideBrandTitle = false; this.logoSize = 0; this.logoSrc = logoGataca; this.qrSize = 300; this.modalWidth = 300; this.modalHeight = undefined; this.qrCodeExpiredLabel = 'QR Code expired'; this.credentialsNotValidatedLabel = 'User credentials not validated'; this.clickInsideBoxLabel = 'Click inside the box to'; this.refreshQrLabel = 'Refresh QR Code'; this.scanQrLabel = 'Scan QR Code'; this.userNotScanInTimeErrorLabel = 'User did not scan the QR in the allowed time'; this.credsNotValidatedErrorLabel = "Provided user credentials couldn't be validated"; this.failedLoginErrorLabel = 'No successful login'; this.successLoginLabel = 'Successful Connection!'; this.byBrandLabel = 'by Gataca'; this.waitingStartSessionLabel = 'waiting to start a session'; this.readQrTitle = 'Processing...'; this.readQrDescription = 'Please wait a moment'; this.hideQrModalDescription = false; this.sessionTimeout = DEFAULT_SESSION_TIMEOUT; this.pollingFrequency = DEFAULT_POLLING_FREQ; this.dynamicLink = true; this.sessionId = undefined; this.authenticationRequest = undefined; this.sessionData = undefined; this.result = RESULT_STATUS.NOT_STARTED; }
|
|
14
|
+
constructor() { this.checkStatus = undefined; this.createSession = undefined; this.successCallback = undefined; this.errorCallback = undefined; this.qrRole = undefined; this.qrType = 'svg'; this.callbackServer = undefined; this.autostart = true; this.autorefresh = false; this.v = '3'; this.qrModalTitle = 'Quick Access'; this.modalTitleColor = '#4745B7'; this.qrModalDescription = 'Sign up or sign in by scanning the QR Code with the Gataca Wallet'; this.hideModalTexts = false; this.hideModalBoxShadow = false; this.hideBrandTitle = false; this.logoSize = 0; this.logoSrc = logoGataca; this.qrSize = 300; this.modalWidth = 300; this.modalHeight = undefined; this.qrCodeExpiredLabel = 'QR Code expired'; this.credentialsNotValidatedLabel = 'User credentials not validated'; this.clickInsideBoxLabel = 'Click inside the box to'; this.refreshQrLabel = 'Refresh QR Code'; this.scanQrLabel = 'Scan QR Code'; this.userNotScanInTimeErrorLabel = 'User did not scan the QR in the allowed time'; this.credsNotValidatedErrorLabel = "Provided user credentials couldn't be validated"; this.failedLoginErrorLabel = 'No successful login'; this.successLoginLabel = 'Successful Connection!'; this.byBrandLabel = 'by Gataca'; this.waitingStartSessionLabel = 'waiting to start a session'; this.readQrTitle = 'Processing...'; this.readQrDescription = 'Please wait a moment'; this.hideQrModalDescription = false; this.sessionTimeout = DEFAULT_SESSION_TIMEOUT; this.pollingFrequency = DEFAULT_POLLING_FREQ; this.dynamicLink = true; this.qrStyle = undefined; this.sessionId = undefined; this.authenticationRequest = undefined; this.sessionData = undefined; this.result = RESULT_STATUS.NOT_STARTED; }
|
|
15
15
|
disconnectedCallback() {
|
|
16
16
|
this.stop();
|
|
17
17
|
}
|
|
@@ -151,10 +151,10 @@ export class GatacaQR {
|
|
|
151
151
|
return h(ReadQR, { modalWidth: this === null || this === void 0 ? void 0 : this.modalWidth, readQrMessages: readQrMessages, url: this.getLink(), sizeQR: (this === null || this === void 0 ? void 0 : this.qrSize) ? (this === null || this === void 0 ? void 0 : this.qrSize) - 50 : undefined, renderQR: this.renderQR.bind(this) });
|
|
152
152
|
}
|
|
153
153
|
renderQR(value, useLogo, sizeQR) {
|
|
154
|
-
return h(QR, { value: value, qrType: this.qrType, useLogo: useLogo && this.logoSize !== 0, size: sizeQR || (this === null || this === void 0 ? void 0 : this.qrSize) || undefined, logoSrc: this === null || this === void 0 ? void 0 : this.logoSrc });
|
|
154
|
+
return h(QR, { value: value, qrType: this.qrType, useLogo: useLogo && this.logoSize !== 0, size: sizeQR || (this === null || this === void 0 ? void 0 : this.qrSize) || undefined, logoSrc: this === null || this === void 0 ? void 0 : this.logoSrc, style: this === null || this === void 0 ? void 0 : this.qrStyle });
|
|
155
155
|
}
|
|
156
156
|
renderRetryQR(value, useLogo) {
|
|
157
|
-
return h(QR, { value: value, useLogo: useLogo && this.logoSize !== 0, qrType: this.qrType, size: (this === null || this === void 0 ? void 0 : this.qrSize) ? (this === null || this === void 0 ? void 0 : this.qrSize) - 50 : undefined, logoSrc: this === null || this === void 0 ? void 0 : this.logoSrc });
|
|
157
|
+
return h(QR, { value: value, useLogo: useLogo && this.logoSize !== 0, qrType: this.qrType, size: (this === null || this === void 0 ? void 0 : this.qrSize) ? (this === null || this === void 0 ? void 0 : this.qrSize) - 50 : undefined, logoSrc: this === null || this === void 0 ? void 0 : this.logoSrc, style: this === null || this === void 0 ? void 0 : this.qrStyle });
|
|
158
158
|
}
|
|
159
159
|
render() {
|
|
160
160
|
var _a, _b;
|
|
@@ -875,6 +875,25 @@ export class GatacaQR {
|
|
|
875
875
|
"attribute": "dynamic-link",
|
|
876
876
|
"reflect": false,
|
|
877
877
|
"defaultValue": "true"
|
|
878
|
+
},
|
|
879
|
+
"qrStyle": {
|
|
880
|
+
"type": "unknown",
|
|
881
|
+
"mutable": false,
|
|
882
|
+
"complexType": {
|
|
883
|
+
"original": "qrStyle",
|
|
884
|
+
"resolved": "{ color: string; bgColor: string; }",
|
|
885
|
+
"references": {
|
|
886
|
+
"qrStyle": {
|
|
887
|
+
"location": "local"
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
},
|
|
891
|
+
"required": false,
|
|
892
|
+
"optional": true,
|
|
893
|
+
"docs": {
|
|
894
|
+
"tags": [],
|
|
895
|
+
"text": "_[Optional]_\nAdjust the color styles of the QR"
|
|
896
|
+
}
|
|
878
897
|
}
|
|
879
898
|
};
|
|
880
899
|
}
|
|
@@ -9,6 +9,7 @@ export class GatacaQRDisplay {
|
|
|
9
9
|
this.logoSize = 0;
|
|
10
10
|
this.logoSrc = undefined;
|
|
11
11
|
this.qrColor = '#1E1E20';
|
|
12
|
+
this.bgColor = '#FFFFFF';
|
|
12
13
|
this.rounded = true;
|
|
13
14
|
}
|
|
14
15
|
componentDidLoad() {
|
|
@@ -32,6 +33,9 @@ export class GatacaQRDisplay {
|
|
|
32
33
|
imageOptions: {
|
|
33
34
|
margin: 2,
|
|
34
35
|
imageSize: this.logoSize
|
|
36
|
+
},
|
|
37
|
+
backgroundOptions: {
|
|
38
|
+
color: this.bgColor
|
|
35
39
|
}
|
|
36
40
|
});
|
|
37
41
|
qrCode.append(this.qr);
|
|
@@ -155,6 +159,24 @@ export class GatacaQRDisplay {
|
|
|
155
159
|
"reflect": false,
|
|
156
160
|
"defaultValue": "'#1E1E20'"
|
|
157
161
|
},
|
|
162
|
+
"bgColor": {
|
|
163
|
+
"type": "string",
|
|
164
|
+
"mutable": false,
|
|
165
|
+
"complexType": {
|
|
166
|
+
"original": "string",
|
|
167
|
+
"resolved": "string",
|
|
168
|
+
"references": {}
|
|
169
|
+
},
|
|
170
|
+
"required": false,
|
|
171
|
+
"optional": true,
|
|
172
|
+
"docs": {
|
|
173
|
+
"tags": [],
|
|
174
|
+
"text": "_[Optional]_\nQR Color."
|
|
175
|
+
},
|
|
176
|
+
"attribute": "bg-color",
|
|
177
|
+
"reflect": false,
|
|
178
|
+
"defaultValue": "'#FFFFFF'"
|
|
179
|
+
},
|
|
158
180
|
"rounded": {
|
|
159
181
|
"type": "boolean",
|
|
160
182
|
"mutable": false,
|
|
@@ -7,11 +7,32 @@ const DEFAULT_SESSION_TIMEOUT = 300; //5mins as in connect
|
|
|
7
7
|
const DEFAULT_POLLING_FREQ = 3;
|
|
8
8
|
export class GatacaSSIButton {
|
|
9
9
|
constructor() {
|
|
10
|
+
this.getRequestFromUri = async (authRequest) => {
|
|
11
|
+
const requrl = new URL(authRequest);
|
|
12
|
+
const requri = requrl.searchParams.get('request_uri');
|
|
13
|
+
if (requri) {
|
|
14
|
+
const response = await fetch(requri, {
|
|
15
|
+
method: 'GET',
|
|
16
|
+
headers: {
|
|
17
|
+
'Content-Type': 'application/json'
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
const jwt = await response.json();
|
|
21
|
+
const parts = jwt.split('.');
|
|
22
|
+
const base64 = parts[1].replace(/-/g, '+').replace(/_/g, '/');
|
|
23
|
+
const decoded = window.atob(base64);
|
|
24
|
+
let parsed = JSON.parse(decoded);
|
|
25
|
+
parsed.response_mode = 'dc_api';
|
|
26
|
+
return parsed;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
10
29
|
this.buttonText = 'Easy login';
|
|
30
|
+
this.buttonDCAPIText = 'Login with Device Credentials';
|
|
11
31
|
this.qrType = 'svg';
|
|
12
32
|
this.autostart = true;
|
|
13
33
|
this.checkStatus = undefined;
|
|
14
34
|
this.createSession = undefined;
|
|
35
|
+
this.fillSession = undefined;
|
|
15
36
|
this.successCallback = undefined;
|
|
16
37
|
this.errorCallback = undefined;
|
|
17
38
|
this.handleCheckAppLoading = undefined;
|
|
@@ -40,13 +61,30 @@ export class GatacaSSIButton {
|
|
|
40
61
|
this.successLoginLabel = 'Successful Connection!';
|
|
41
62
|
this.byBrandLabel = 'by Gataca';
|
|
42
63
|
this.waitingStartSessionLabel = 'waiting to start a session';
|
|
64
|
+
this.enableDcApi = false;
|
|
43
65
|
this.hideQrModalDescription = false;
|
|
66
|
+
this.qrStyle = undefined;
|
|
44
67
|
this.open = false;
|
|
45
68
|
this.sessionId = undefined;
|
|
46
69
|
this.authenticationRequest = undefined;
|
|
47
70
|
this.sessionData = undefined;
|
|
48
71
|
this.result = RESULT_STATUS.NOT_STARTED;
|
|
49
|
-
this.qr = (h("gataca-qr", { ref: (el) => (this.qrElement = el), checkStatus: this.checkStatus, createSession: this.createSession, successCallback: this.successCallback, errorCallback: this.errorCallback, qrRole: this.qrRole, qrType: this.qrType, callbackServer: this.callbackServer, sessionTimeout: this.sessionTimeout, pollingFrequency: this.pollingFrequency, autostart: this.autostart, autorefresh: this.autorefresh, v: this.v, qrModalTitle: this.qrModalTitle, qrModalDescription: this.qrModalDescription, hideBrandTitle: this.hideBrandTitle, dynamicLink: this.dynamicLink, logoSize: this.logoSize, logoSrc: this.logoSrc, modalTitleColor: this.modalTitleColor, qrCodeExpiredLabel: this.qrCodeExpiredLabel, credentialsNotValidatedLabel: this.credentialsNotValidatedLabel, clickInsideBoxLabel: this.clickInsideBoxLabel, refreshQrLabel: this.refreshQrLabel, scanQrLabel: this.scanQrLabel, userNotScanInTimeErrorLabel: this.userNotScanInTimeErrorLabel, credsNotValidatedErrorLabel: this.credsNotValidatedErrorLabel, failedLoginErrorLabel: this.failedLoginErrorLabel, successLoginLabel: this.successLoginLabel, byBrandLabel: this.byBrandLabel, waitingStartSessionLabel: this.waitingStartSessionLabel, hideQrModalDescription: this.hideQrModalDescription }));
|
|
72
|
+
this.qr = (h("gataca-qr", { ref: (el) => (this.qrElement = el), checkStatus: this.checkStatus, createSession: this.createSession, successCallback: this.successCallback, errorCallback: this.errorCallback, qrRole: this.qrRole, qrType: this.qrType, callbackServer: this.callbackServer, sessionTimeout: this.sessionTimeout, pollingFrequency: this.pollingFrequency, autostart: this.autostart, autorefresh: this.autorefresh, v: this.v, qrModalTitle: this.qrModalTitle, qrModalDescription: this.qrModalDescription, hideBrandTitle: this.hideBrandTitle, dynamicLink: this.dynamicLink, logoSize: this.logoSize, logoSrc: this.logoSrc, modalTitleColor: this.modalTitleColor, qrCodeExpiredLabel: this.qrCodeExpiredLabel, credentialsNotValidatedLabel: this.credentialsNotValidatedLabel, clickInsideBoxLabel: this.clickInsideBoxLabel, refreshQrLabel: this.refreshQrLabel, scanQrLabel: this.scanQrLabel, userNotScanInTimeErrorLabel: this.userNotScanInTimeErrorLabel, credsNotValidatedErrorLabel: this.credsNotValidatedErrorLabel, failedLoginErrorLabel: this.failedLoginErrorLabel, successLoginLabel: this.successLoginLabel, byBrandLabel: this.byBrandLabel, waitingStartSessionLabel: this.waitingStartSessionLabel, hideQrModalDescription: this.hideQrModalDescription, qrStyle: this.qrStyle }));
|
|
73
|
+
}
|
|
74
|
+
supportsDCAPI() {
|
|
75
|
+
// let mobile = checkMobile();
|
|
76
|
+
// if (!mobile) return false;
|
|
77
|
+
if (!this.enableDcApi) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
//@ts-ignore
|
|
81
|
+
if (typeof window.DigitalCredential === 'undefined')
|
|
82
|
+
return false;
|
|
83
|
+
const protocols = ['org-iso-mdoc', 'openid4vp', 'openid4vci'];
|
|
84
|
+
//@ts-ignore
|
|
85
|
+
const supportedProtocols = protocols.filter(window.DigitalCredential.userAgentAllowsProtocol);
|
|
86
|
+
console.log(supportedProtocols, protocols);
|
|
87
|
+
return true;
|
|
50
88
|
}
|
|
51
89
|
/**
|
|
52
90
|
* Retrieve manually the session data on a successful login
|
|
@@ -191,7 +229,7 @@ export class GatacaSSIButton {
|
|
|
191
229
|
return authenticationRequest;
|
|
192
230
|
}
|
|
193
231
|
renderMobileButton(isAndroid, isIos) {
|
|
194
|
-
if (this.autostart) {
|
|
232
|
+
if (this.autostart && !this.supportsDCAPI()) {
|
|
195
233
|
this.startMobilePolling();
|
|
196
234
|
}
|
|
197
235
|
let loading = false;
|
|
@@ -230,6 +268,47 @@ export class GatacaSSIButton {
|
|
|
230
268
|
executeRedirection();
|
|
231
269
|
}, disabled: loading }, h("img", { src: PHONE_ICON, class: "buttonImg", alt: this.buttonText }), h("span", null, this.buttonText))));
|
|
232
270
|
}
|
|
271
|
+
renderDCAPIButton(isAndroid, isIos) {
|
|
272
|
+
let loading = false;
|
|
273
|
+
console.log('Maybe act different', isAndroid, isIos);
|
|
274
|
+
const handleLoading = (isLoading) => {
|
|
275
|
+
loading = isLoading;
|
|
276
|
+
if (this.handleCheckAppLoading) {
|
|
277
|
+
this.handleCheckAppLoading(isLoading);
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
const executeDCAPICall = async () => {
|
|
281
|
+
handleLoading(true);
|
|
282
|
+
try {
|
|
283
|
+
const authRequest = await this.getAuthRequest();
|
|
284
|
+
let request = await this.getRequestFromUri(authRequest);
|
|
285
|
+
let credentialResponse = await navigator.credentials.get({
|
|
286
|
+
//@ts-ignore
|
|
287
|
+
digital: {
|
|
288
|
+
requests: [
|
|
289
|
+
{
|
|
290
|
+
protocol: 'openid4vp-v1-unsigned',
|
|
291
|
+
data: request
|
|
292
|
+
}
|
|
293
|
+
]
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
if (credentialResponse.constructor.name == 'DigitalCredential') {
|
|
297
|
+
console.log('Digital Credential - Response Data: ' + credentialResponse);
|
|
298
|
+
}
|
|
299
|
+
//@ts-ignore
|
|
300
|
+
await this.fillSession(request, credentialResponse === null || credentialResponse === void 0 ? void 0 : credentialResponse.data);
|
|
301
|
+
}
|
|
302
|
+
catch (error) {
|
|
303
|
+
this.stop();
|
|
304
|
+
handleLoading(false);
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
return (h("div", { class: "gatacaButtonWrapper" }, h("button", { class: "gatacaButton", onClick: () => {
|
|
308
|
+
this.gatacaButtonPushed.emit();
|
|
309
|
+
executeDCAPICall();
|
|
310
|
+
}, disabled: loading }, h("img", { src: PHONE_ICON, class: "buttonImg", alt: this.buttonDCAPIText }), h("span", null, this.buttonDCAPIText))));
|
|
311
|
+
}
|
|
233
312
|
render() {
|
|
234
313
|
const userAgent =
|
|
235
314
|
// @ts-ignore
|
|
@@ -239,7 +318,8 @@ export class GatacaSSIButton {
|
|
|
239
318
|
// @ts-ignore
|
|
240
319
|
(/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);
|
|
241
320
|
const isMobile = isAndroid || isIos;
|
|
242
|
-
|
|
321
|
+
const displayDCApi = this.supportsDCAPI();
|
|
322
|
+
return (h("div", null, h("div", { class: "buttonContainer" }, isMobile && this.v === '3' ? this.renderMobileButton(isAndroid, isIos) : this.renderDesktopButton(), this.open && (!isMobile || this.v === '3') && this.renderModal()), displayDCApi /** && isMobile */ && h("div", { class: "buttonContainer" }, this.renderDCAPIButton(isAndroid, isIos))));
|
|
243
323
|
}
|
|
244
324
|
static get is() { return "gataca-ssibutton"; }
|
|
245
325
|
static get encapsulation() { return "shadow"; }
|
|
@@ -273,6 +353,24 @@ export class GatacaSSIButton {
|
|
|
273
353
|
"reflect": false,
|
|
274
354
|
"defaultValue": "'Easy login'"
|
|
275
355
|
},
|
|
356
|
+
"buttonDCAPIText": {
|
|
357
|
+
"type": "string",
|
|
358
|
+
"mutable": false,
|
|
359
|
+
"complexType": {
|
|
360
|
+
"original": "string",
|
|
361
|
+
"resolved": "string",
|
|
362
|
+
"references": {}
|
|
363
|
+
},
|
|
364
|
+
"required": false,
|
|
365
|
+
"optional": true,
|
|
366
|
+
"docs": {
|
|
367
|
+
"tags": [],
|
|
368
|
+
"text": "_[Optional]_\nIn the case of enabling DCAPI button, allows to configure the text displayed"
|
|
369
|
+
},
|
|
370
|
+
"attribute": "button-d-c-a-p-i-text",
|
|
371
|
+
"reflect": false,
|
|
372
|
+
"defaultValue": "'Login with Device Credentials'"
|
|
373
|
+
},
|
|
276
374
|
"qrType": {
|
|
277
375
|
"type": "string",
|
|
278
376
|
"mutable": false,
|
|
@@ -358,6 +456,30 @@ export class GatacaSSIButton {
|
|
|
358
456
|
},
|
|
359
457
|
"defaultValue": "undefined"
|
|
360
458
|
},
|
|
459
|
+
"fillSession": {
|
|
460
|
+
"type": "unknown",
|
|
461
|
+
"mutable": false,
|
|
462
|
+
"complexType": {
|
|
463
|
+
"original": "(request: any, sessionData?: any) => Promise<{result: RESULT_STATUS; data?: any}>",
|
|
464
|
+
"resolved": "(request: any, sessionData?: any) => Promise<{ result: RESULT_STATUS; data?: any; }>",
|
|
465
|
+
"references": {
|
|
466
|
+
"Promise": {
|
|
467
|
+
"location": "global"
|
|
468
|
+
},
|
|
469
|
+
"RESULT_STATUS": {
|
|
470
|
+
"location": "import",
|
|
471
|
+
"path": "../../utils/utils"
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
},
|
|
475
|
+
"required": false,
|
|
476
|
+
"optional": true,
|
|
477
|
+
"docs": {
|
|
478
|
+
"tags": [],
|
|
479
|
+
"text": "***Mandatory if DC API***\nSends the API response"
|
|
480
|
+
},
|
|
481
|
+
"defaultValue": "undefined"
|
|
482
|
+
},
|
|
361
483
|
"successCallback": {
|
|
362
484
|
"type": "unknown",
|
|
363
485
|
"mutable": false,
|
|
@@ -855,6 +977,24 @@ export class GatacaSSIButton {
|
|
|
855
977
|
"reflect": false,
|
|
856
978
|
"defaultValue": "'waiting to start a session'"
|
|
857
979
|
},
|
|
980
|
+
"enableDcApi": {
|
|
981
|
+
"type": "boolean",
|
|
982
|
+
"mutable": false,
|
|
983
|
+
"complexType": {
|
|
984
|
+
"original": "boolean",
|
|
985
|
+
"resolved": "boolean",
|
|
986
|
+
"references": {}
|
|
987
|
+
},
|
|
988
|
+
"required": false,
|
|
989
|
+
"optional": true,
|
|
990
|
+
"docs": {
|
|
991
|
+
"tags": [],
|
|
992
|
+
"text": "_[Optional]_\nString to show \"waiting start session\" label"
|
|
993
|
+
},
|
|
994
|
+
"attribute": "enable-dc-api",
|
|
995
|
+
"reflect": false,
|
|
996
|
+
"defaultValue": "false"
|
|
997
|
+
},
|
|
858
998
|
"hideQrModalDescription": {
|
|
859
999
|
"type": "boolean",
|
|
860
1000
|
"mutable": false,
|
|
@@ -872,6 +1012,26 @@ export class GatacaSSIButton {
|
|
|
872
1012
|
"attribute": "hide-qr-modal-description",
|
|
873
1013
|
"reflect": false,
|
|
874
1014
|
"defaultValue": "false"
|
|
1015
|
+
},
|
|
1016
|
+
"qrStyle": {
|
|
1017
|
+
"type": "unknown",
|
|
1018
|
+
"mutable": false,
|
|
1019
|
+
"complexType": {
|
|
1020
|
+
"original": "qrStyle",
|
|
1021
|
+
"resolved": "{ color: string; bgColor: string; }",
|
|
1022
|
+
"references": {
|
|
1023
|
+
"qrStyle": {
|
|
1024
|
+
"location": "import",
|
|
1025
|
+
"path": "../gataca-qr/gataca-qr"
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
},
|
|
1029
|
+
"required": false,
|
|
1030
|
+
"optional": true,
|
|
1031
|
+
"docs": {
|
|
1032
|
+
"tags": [],
|
|
1033
|
+
"text": "_[Optional]_\nAdjust the color styles of the QR"
|
|
1034
|
+
}
|
|
875
1035
|
}
|
|
876
1036
|
};
|
|
877
1037
|
}
|
|
@@ -21,10 +21,10 @@ var RESULT_STATUS;
|
|
|
21
21
|
RESULT_STATUS[RESULT_STATUS["READ"] = 5] = "READ";
|
|
22
22
|
})(RESULT_STATUS || (RESULT_STATUS = {}));
|
|
23
23
|
|
|
24
|
-
const gatIconCheckSvg = 'data:image/svg+xml;base64,Cjxzdmcgd2lkdGg9IjUyIiBoZWlnaHQ9IjUzIiB2aWV3Qm94PSIwIDAgNTIgNTMiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxjaXJjbGUgY3g9IjI2IiBjeT0iMjYuNjcxOSIgcj0iMjYiIGZpbGw9IiMzRDlBNTAiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zOC41MiAxNy43NDk1QzM5LjU4MDUgMTguODA5OSAzOS41ODA1IDIwLjUyOTMgMzguNTIgMjEuNTg5OEwyMy41ODQ2IDM2LjUyNTFDMjIuNTI0MiAzNy41ODU2IDIwLjgwNDggMzcuNTg1NiAxOS43NDQzIDM2LjUyNTFMMTIuOTU1NSAyOS43MzYzQzExLjg5NSAyOC42NzU5IDExLjg5NSAyNi45NTY1IDEyLjk1NTUgMjUuODk2QzE0LjAxNiAyNC44MzU1IDE1LjczNTQgMjQuODM1NSAxNi43OTU4IDI1Ljg5NkwyMS42NjQ1IDMwLjc2NDdMMzQuNjc5NyAxNy43NDk1QzM1Ljc0MDIgMTYuNjg5IDM3LjQ1OTUgMTYuNjg5IDM4LjUyIDE3Ljc0OTVaIiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K';
|
|
25
|
-
|
|
26
24
|
const gatIconRefresh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o8L3N2Zz4K';
|
|
29
|
+
|
|
30
|
+
export { RESULT_STATUS as R, gatIconAlertSvg as a, base64UrlEncode as b, checkMobile as c, gatIconCheckSvg as d, gatIconRefreshSvg as g };
|