@gataca/qr 3.0.10 → 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-autoqr.cjs.entry.js +9 -9
- package/dist/cjs/gataca-qr_3.cjs.entry.js +620 -0
- package/dist/cjs/gataca-qrws.cjs.entry.js +39 -47
- package/dist/cjs/gataca-ssibuttonws.cjs.entry.js +61 -0
- package/dist/cjs/gatacaqr.cjs.js +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{utils-ef28b844.js → utils-b4e62bc0.js} +1 -1
- package/dist/collection/components/gataca-autoqr/gataca-autoqr.js +13 -13
- package/dist/collection/components/gataca-qr/components/qr/QR.js +3 -3
- package/dist/collection/components/gataca-qr/components/readQR/ReadQR.js +7 -5
- package/dist/collection/components/gataca-qr/components/readQR/components/AnimatedLoader.js +1 -1
- package/dist/collection/components/gataca-qr/components/retryButton/RetryButton.js +8 -8
- package/dist/collection/components/gataca-qr/components/success/Success.js +4 -4
- package/dist/collection/components/gataca-qr/gataca-qr.js +64 -55
- package/dist/collection/components/gataca-qrdisplay/gataca-qrdisplay.js +33 -11
- package/dist/collection/components/gataca-qrws/components/qr/QR.js +2 -2
- package/dist/collection/components/gataca-qrws/components/readQR/ReadQR.js +4 -4
- package/dist/collection/components/gataca-qrws/components/readQR/components/AnimatedLoader.js +1 -1
- package/dist/collection/components/gataca-qrws/components/retryButton/RetryButton.js +8 -8
- package/dist/collection/components/gataca-qrws/components/success/Success.js +4 -4
- package/dist/collection/components/gataca-qrws/gataca-qrws.js +49 -56
- package/dist/collection/components/gataca-ssibutton/gataca-ssibutton.js +224 -54
- package/dist/collection/components/gataca-ssibuttonws/gataca-ssibuttonws.js +12 -12
- package/dist/collection/index.js +2 -2
- package/dist/collection/utils/index.js +1 -1
- package/dist/collection/utils/utils.js +1 -1
- package/dist/components/{gat-icon-alert.js → gat-icon-check.js} +4 -4
- package/dist/components/gataca-autoqr.js +9 -9
- package/dist/components/gataca-qr2.js +56 -63
- package/dist/components/gataca-qrdisplay2.js +11 -6
- package/dist/components/gataca-qrws2.js +35 -42
- package/dist/components/gataca-ssibutton2.js +114 -34
- package/dist/components/gataca-ssibuttonws2.js +6 -6
- 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-autoqr.entry.js +9 -9
- package/dist/esm/gataca-qr_3.entry.js +614 -0
- package/dist/esm/gataca-qrws.entry.js +36 -44
- package/dist/esm/gataca-ssibuttonws.entry.js +57 -0
- package/dist/esm/gatacaqr.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{utils-63e7a33b.js → utils-21ffcc1e.js} +1 -1
- package/dist/gatacaqr/gatacaqr.esm.js +1 -1
- package/dist/gatacaqr/index.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-autoqr/gataca-autoqr.d.ts +7 -7
- package/dist/types/components/gataca-qr/components/qr/QR.d.ts +4 -2
- package/dist/types/components/gataca-qr/components/readQR/ReadQR.d.ts +3 -1
- package/dist/types/components/gataca-qr/components/readQR/components/AnimatedLoader.d.ts +1 -1
- package/dist/types/components/gataca-qr/components/retryButton/RetryButton.d.ts +1 -1
- package/dist/types/components/gataca-qr/components/success/Success.d.ts +1 -1
- package/dist/types/components/gataca-qr/gataca-qr.d.ts +13 -4
- package/dist/types/components/gataca-qrdisplay/gataca-qrdisplay.d.ts +6 -1
- package/dist/types/components/gataca-qrws/components/qr/QR.d.ts +2 -2
- package/dist/types/components/gataca-qrws/components/readQR/ReadQR.d.ts +1 -1
- package/dist/types/components/gataca-qrws/components/readQR/components/AnimatedLoader.d.ts +1 -1
- package/dist/types/components/gataca-qrws/components/retryButton/RetryButton.d.ts +1 -1
- package/dist/types/components/gataca-qrws/components/success/Success.d.ts +1 -1
- package/dist/types/components/gataca-qrws/gataca-qrws.d.ts +4 -4
- package/dist/types/components/gataca-ssibutton/gataca-ssibutton.d.ts +38 -5
- package/dist/types/components/gataca-ssibuttonws/gataca-ssibuttonws.d.ts +3 -3
- package/dist/types/components.d.ts +78 -36
- package/dist/types/index.d.ts +2 -2
- package/dist/types/utils/index.d.ts +1 -1
- package/package.json +30 -7
- package/dist/cjs/gat-icon-alert-0ad19b26.js +0 -14
- package/dist/cjs/gataca-qr_2.cjs.entry.js +0 -295
- package/dist/cjs/gataca-ssibutton_2.cjs.entry.js +0 -317
- package/dist/esm/gat-icon-alert-7b06ef3a.js +0 -9
- package/dist/esm/gataca-qr_2.entry.js +0 -290
- package/dist/esm/gataca-ssibutton_2.entry.js +0 -312
- package/dist/gatacaqr/p-0be4566d.js +0 -1
- package/dist/gatacaqr/p-3500ae66.entry.js +0 -1
- package/dist/gatacaqr/p-68272823.entry.js +0 -1
- package/dist/gatacaqr/p-92a2e6f0.entry.js +0 -1
- package/dist/gatacaqr/p-ea783014.js +0 -1
- /package/dist/gatacaqr/{p-2cd7b062.js → p-bce7e590.js} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
2
|
import { d as defineCustomElement$1 } from './gataca-qrdisplay2.js';
|
|
3
|
-
import { R as RESULT_STATUS } from './gat-icon-
|
|
3
|
+
import { R as RESULT_STATUS } from './gat-icon-check.js';
|
|
4
4
|
import { d as defineCustomElement$2 } from './gataca-qr2.js';
|
|
5
5
|
|
|
6
6
|
const gatacaSsibuttonCss = "@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}";
|
|
7
7
|
|
|
8
|
-
const PHONE_ICON =
|
|
8
|
+
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=';
|
|
9
9
|
//Default values
|
|
10
10
|
const DEFAULT_SESSION_TIMEOUT = 300; //5mins as in connect
|
|
11
11
|
const DEFAULT_POLLING_FREQ = 3;
|
|
@@ -16,11 +16,33 @@ const GatacaSSIButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
16
16
|
this.__attachShadow();
|
|
17
17
|
this.gatacaLoginCompleted = createEvent(this, "gatacaLoginCompleted", 7);
|
|
18
18
|
this.gatacaLoginFailed = createEvent(this, "gatacaLoginFailed", 7);
|
|
19
|
-
this.
|
|
20
|
-
this.
|
|
19
|
+
this.gatacaButtonPushed = createEvent(this, "gatacaButtonPushed", 7);
|
|
20
|
+
this.getRequestFromUri = async (authRequest) => {
|
|
21
|
+
const requrl = new URL(authRequest);
|
|
22
|
+
const requri = requrl.searchParams.get('request_uri');
|
|
23
|
+
if (requri) {
|
|
24
|
+
const response = await fetch(requri, {
|
|
25
|
+
method: 'GET',
|
|
26
|
+
headers: {
|
|
27
|
+
'Content-Type': 'application/json'
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
const jwt = await response.json();
|
|
31
|
+
const parts = jwt.split('.');
|
|
32
|
+
const base64 = parts[1].replace(/-/g, '+').replace(/_/g, '/');
|
|
33
|
+
const decoded = window.atob(base64);
|
|
34
|
+
let parsed = JSON.parse(decoded);
|
|
35
|
+
parsed.response_mode = 'dc_api';
|
|
36
|
+
return parsed;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
this.buttonText = 'Easy login';
|
|
40
|
+
this.buttonDCAPIText = 'Login with Device Credentials';
|
|
41
|
+
this.qrType = 'svg';
|
|
21
42
|
this.autostart = true;
|
|
22
43
|
this.checkStatus = undefined;
|
|
23
44
|
this.createSession = undefined;
|
|
45
|
+
this.fillSession = undefined;
|
|
24
46
|
this.successCallback = undefined;
|
|
25
47
|
this.errorCallback = undefined;
|
|
26
48
|
this.handleCheckAppLoading = undefined;
|
|
@@ -30,32 +52,49 @@ const GatacaSSIButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
30
52
|
this.sessionTimeout = undefined;
|
|
31
53
|
this.pollingFrequency = undefined;
|
|
32
54
|
this.autorefresh = false;
|
|
33
|
-
this.v =
|
|
34
|
-
this.qrModalTitle =
|
|
35
|
-
this.modalTitleColor =
|
|
36
|
-
this.qrModalDescription =
|
|
55
|
+
this.v = '3';
|
|
56
|
+
this.qrModalTitle = 'Quick Access';
|
|
57
|
+
this.modalTitleColor = '#4745B7';
|
|
58
|
+
this.qrModalDescription = 'Sign up or sign in by scanning the QR Code with the Gataca Wallet';
|
|
37
59
|
this.hideBrandTitle = false;
|
|
38
60
|
this.dynamicLink = true;
|
|
39
61
|
this.logoSize = 0;
|
|
40
62
|
this.logoSrc = undefined;
|
|
41
|
-
this.qrCodeExpiredLabel =
|
|
42
|
-
this.credentialsNotValidatedLabel =
|
|
43
|
-
this.clickInsideBoxLabel =
|
|
44
|
-
this.refreshQrLabel =
|
|
45
|
-
this.scanQrLabel =
|
|
46
|
-
this.userNotScanInTimeErrorLabel =
|
|
63
|
+
this.qrCodeExpiredLabel = 'QR Code expired';
|
|
64
|
+
this.credentialsNotValidatedLabel = 'User credentials not validated';
|
|
65
|
+
this.clickInsideBoxLabel = 'Click inside the box to';
|
|
66
|
+
this.refreshQrLabel = 'Refresh QR Code';
|
|
67
|
+
this.scanQrLabel = 'Scan QR Code';
|
|
68
|
+
this.userNotScanInTimeErrorLabel = 'User did not scan the QR in the allowed time';
|
|
47
69
|
this.credsNotValidatedErrorLabel = "Provided user credentials couldn't be validated";
|
|
48
|
-
this.failedLoginErrorLabel =
|
|
49
|
-
this.successLoginLabel =
|
|
50
|
-
this.byBrandLabel =
|
|
51
|
-
this.waitingStartSessionLabel =
|
|
70
|
+
this.failedLoginErrorLabel = 'No successful login';
|
|
71
|
+
this.successLoginLabel = 'Successful Connection!';
|
|
72
|
+
this.byBrandLabel = 'by Gataca';
|
|
73
|
+
this.waitingStartSessionLabel = 'waiting to start a session';
|
|
74
|
+
this.enableDcApi = false;
|
|
52
75
|
this.hideQrModalDescription = false;
|
|
76
|
+
this.qrStyle = undefined;
|
|
53
77
|
this.open = false;
|
|
54
78
|
this.sessionId = undefined;
|
|
55
79
|
this.authenticationRequest = undefined;
|
|
56
80
|
this.sessionData = undefined;
|
|
57
81
|
this.result = RESULT_STATUS.NOT_STARTED;
|
|
58
|
-
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 }));
|
|
82
|
+
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 }));
|
|
83
|
+
}
|
|
84
|
+
supportsDCAPI() {
|
|
85
|
+
// let mobile = checkMobile();
|
|
86
|
+
// if (!mobile) return false;
|
|
87
|
+
if (!this.enableDcApi) {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
//@ts-ignore
|
|
91
|
+
if (typeof window.DigitalCredential === 'undefined')
|
|
92
|
+
return false;
|
|
93
|
+
const protocols = ['org-iso-mdoc', 'openid4vp', 'openid4vci'];
|
|
94
|
+
//@ts-ignore
|
|
95
|
+
const supportedProtocols = protocols.filter(window.DigitalCredential.userAgentAllowsProtocol);
|
|
96
|
+
console.log(supportedProtocols, protocols);
|
|
97
|
+
return true;
|
|
59
98
|
}
|
|
60
99
|
/**
|
|
61
100
|
* Retrieve manually the session data on a successful login
|
|
@@ -93,9 +132,7 @@ const GatacaSSIButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
93
132
|
}
|
|
94
133
|
else {
|
|
95
134
|
if (err !== RESULT_STATUS.NOT_STARTED) {
|
|
96
|
-
let error = expired
|
|
97
|
-
? new Error(this.userNotScanInTimeErrorLabel)
|
|
98
|
-
: new Error(this.credsNotValidatedErrorLabel);
|
|
135
|
+
let error = expired ? new Error(this.userNotScanInTimeErrorLabel) : new Error(this.credsNotValidatedErrorLabel);
|
|
99
136
|
this.result = err;
|
|
100
137
|
this.gatacaLoginFailed.emit(error);
|
|
101
138
|
this.errorCallback(error);
|
|
@@ -120,8 +157,7 @@ const GatacaSSIButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
120
157
|
return this.qr;
|
|
121
158
|
}
|
|
122
159
|
async poll() {
|
|
123
|
-
let endTime = new Date().getTime() +
|
|
124
|
-
(this.sessionTimeout || DEFAULT_SESSION_TIMEOUT) * 1000;
|
|
160
|
+
let endTime = new Date().getTime() + (this.sessionTimeout || DEFAULT_SESSION_TIMEOUT) * 1000;
|
|
125
161
|
let interval = (this.pollingFrequency || DEFAULT_POLLING_FREQ) * 1000;
|
|
126
162
|
let checkFunc = async (component) => {
|
|
127
163
|
if (component.result === RESULT_STATUS.NOT_STARTED) {
|
|
@@ -178,10 +214,10 @@ const GatacaSSIButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
178
214
|
cleanup();
|
|
179
215
|
}
|
|
180
216
|
};
|
|
181
|
-
document.addEventListener(
|
|
217
|
+
document.addEventListener('visibilitychange', handleVisibilityChange);
|
|
182
218
|
function cleanup() {
|
|
183
219
|
clearTimeout(timeout);
|
|
184
|
-
document.removeEventListener(
|
|
220
|
+
document.removeEventListener('visibilitychange', handleVisibilityChange);
|
|
185
221
|
}
|
|
186
222
|
}
|
|
187
223
|
renderDesktopButton() {
|
|
@@ -203,7 +239,7 @@ const GatacaSSIButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
203
239
|
return authenticationRequest;
|
|
204
240
|
}
|
|
205
241
|
renderMobileButton(isAndroid, isIos) {
|
|
206
|
-
if (this.autostart) {
|
|
242
|
+
if (this.autostart && !this.supportsDCAPI()) {
|
|
207
243
|
this.startMobilePolling();
|
|
208
244
|
}
|
|
209
245
|
let loading = false;
|
|
@@ -215,8 +251,8 @@ const GatacaSSIButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
215
251
|
};
|
|
216
252
|
const executeRedirection = async () => {
|
|
217
253
|
handleLoading(true);
|
|
218
|
-
const androidStoreLink =
|
|
219
|
-
const iosStoreLink =
|
|
254
|
+
const androidStoreLink = 'https://play.google.com/store/apps/details?id=com.gataca.identity';
|
|
255
|
+
const iosStoreLink = 'https://apps.apple.com/us/app/gataca/id1498607616';
|
|
220
256
|
try {
|
|
221
257
|
const appScheme = await this.getAuthRequest();
|
|
222
258
|
this.isAppInstalled(appScheme, (installed) => {
|
|
@@ -238,9 +274,51 @@ const GatacaSSIButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
238
274
|
}
|
|
239
275
|
};
|
|
240
276
|
return (h("div", { class: "gatacaButtonWrapper" }, h("button", { class: "gatacaButton", onClick: () => {
|
|
277
|
+
this.gatacaButtonPushed.emit();
|
|
241
278
|
executeRedirection();
|
|
242
279
|
}, disabled: loading }, h("img", { src: PHONE_ICON, class: "buttonImg", alt: this.buttonText }), h("span", null, this.buttonText))));
|
|
243
280
|
}
|
|
281
|
+
renderDCAPIButton(isAndroid, isIos) {
|
|
282
|
+
let loading = false;
|
|
283
|
+
console.log('Maybe act different', isAndroid, isIos);
|
|
284
|
+
const handleLoading = (isLoading) => {
|
|
285
|
+
loading = isLoading;
|
|
286
|
+
if (this.handleCheckAppLoading) {
|
|
287
|
+
this.handleCheckAppLoading(isLoading);
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
const executeDCAPICall = async () => {
|
|
291
|
+
handleLoading(true);
|
|
292
|
+
try {
|
|
293
|
+
const authRequest = await this.getAuthRequest();
|
|
294
|
+
let request = await this.getRequestFromUri(authRequest);
|
|
295
|
+
let credentialResponse = await navigator.credentials.get({
|
|
296
|
+
//@ts-ignore
|
|
297
|
+
digital: {
|
|
298
|
+
requests: [
|
|
299
|
+
{
|
|
300
|
+
protocol: 'openid4vp-v1-unsigned',
|
|
301
|
+
data: request
|
|
302
|
+
}
|
|
303
|
+
]
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
if (credentialResponse.constructor.name == 'DigitalCredential') {
|
|
307
|
+
console.log('Digital Credential - Response Data: ' + credentialResponse);
|
|
308
|
+
}
|
|
309
|
+
//@ts-ignore
|
|
310
|
+
await this.fillSession(request, credentialResponse === null || credentialResponse === void 0 ? void 0 : credentialResponse.data);
|
|
311
|
+
}
|
|
312
|
+
catch (error) {
|
|
313
|
+
this.stop();
|
|
314
|
+
handleLoading(false);
|
|
315
|
+
}
|
|
316
|
+
};
|
|
317
|
+
return (h("div", { class: "gatacaButtonWrapper" }, h("button", { class: "gatacaButton", onClick: () => {
|
|
318
|
+
this.gatacaButtonPushed.emit();
|
|
319
|
+
executeDCAPICall();
|
|
320
|
+
}, disabled: loading }, h("img", { src: PHONE_ICON, class: "buttonImg", alt: this.buttonDCAPIText }), h("span", null, this.buttonDCAPIText))));
|
|
321
|
+
}
|
|
244
322
|
render() {
|
|
245
323
|
const userAgent =
|
|
246
324
|
// @ts-ignore
|
|
@@ -248,20 +326,20 @@ const GatacaSSIButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
248
326
|
const isAndroid = /android/i.test(userAgent);
|
|
249
327
|
const isIos =
|
|
250
328
|
// @ts-ignore
|
|
251
|
-
(/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) ||
|
|
252
|
-
(navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1);
|
|
329
|
+
(/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);
|
|
253
330
|
const isMobile = isAndroid || isIos;
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
: this.renderDesktopButton(), this.open && (!isMobile || this.v === "3") && this.renderModal()));
|
|
331
|
+
const displayDCApi = this.supportsDCAPI();
|
|
332
|
+
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))));
|
|
257
333
|
}
|
|
258
334
|
static get style() { return gatacaSsibuttonCss; }
|
|
259
335
|
}, [1, "gataca-ssibutton", {
|
|
260
336
|
"buttonText": [1, "button-text"],
|
|
337
|
+
"buttonDCAPIText": [1, "button-d-c-a-p-i-text"],
|
|
261
338
|
"qrType": [1, "qr-type"],
|
|
262
339
|
"autostart": [4],
|
|
263
340
|
"checkStatus": [16],
|
|
264
341
|
"createSession": [16],
|
|
342
|
+
"fillSession": [16],
|
|
265
343
|
"successCallback": [16],
|
|
266
344
|
"errorCallback": [16],
|
|
267
345
|
"handleCheckAppLoading": [16],
|
|
@@ -290,7 +368,9 @@ const GatacaSSIButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
290
368
|
"successLoginLabel": [1, "success-login-label"],
|
|
291
369
|
"byBrandLabel": [1, "by-brand-label"],
|
|
292
370
|
"waitingStartSessionLabel": [1, "waiting-start-session-label"],
|
|
371
|
+
"enableDcApi": [4, "enable-dc-api"],
|
|
293
372
|
"hideQrModalDescription": [4, "hide-qr-modal-description"],
|
|
373
|
+
"qrStyle": [16],
|
|
294
374
|
"open": [32],
|
|
295
375
|
"sessionId": [32],
|
|
296
376
|
"authenticationRequest": [32],
|
|
@@ -4,7 +4,7 @@ import { d as defineCustomElement$1 } from './gataca-qrws2.js';
|
|
|
4
4
|
|
|
5
5
|
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}";
|
|
6
6
|
|
|
7
|
-
const PHONE_ICON =
|
|
7
|
+
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=';
|
|
8
8
|
const GatacaSSIButtonWS = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
9
9
|
constructor() {
|
|
10
10
|
super();
|
|
@@ -12,10 +12,10 @@ const GatacaSSIButtonWS = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
12
12
|
this.__attachShadow();
|
|
13
13
|
this.gatacaLoginCompleted = createEvent(this, "gatacaLoginCompleted", 7);
|
|
14
14
|
this.gatacaLoginFailed = createEvent(this, "gatacaLoginFailed", 7);
|
|
15
|
-
this.buttonText =
|
|
15
|
+
this.buttonText = 'Easy login';
|
|
16
16
|
this.successCallback = undefined;
|
|
17
17
|
this.errorCallback = undefined;
|
|
18
|
-
this.qrType =
|
|
18
|
+
this.qrType = 'svg';
|
|
19
19
|
this.qrRole = undefined;
|
|
20
20
|
this.callbackServer = undefined;
|
|
21
21
|
this.socketEndpoint = undefined;
|
|
@@ -24,9 +24,9 @@ const GatacaSSIButtonWS = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
24
24
|
this.wsOnMessage = undefined;
|
|
25
25
|
this.autostart = true;
|
|
26
26
|
this.autorefresh = false;
|
|
27
|
-
this.v =
|
|
28
|
-
this.qrModalTitle =
|
|
29
|
-
this.qrModalDescription =
|
|
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
30
|
this.hideBrandTitle = false;
|
|
31
31
|
this.dynamicLink = true;
|
|
32
32
|
this.open = false;
|
package/dist/components/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|
|
2
|
-
export { R as RESULT_STATUS, b as base64UrlEncode, c as checkMobile } from './gat-icon-
|
|
2
|
+
export { R as RESULT_STATUS, b as base64UrlEncode, c as checkMobile } from './gat-icon-check.js';
|
|
3
3
|
export { GatacaAutoqr, defineCustomElement as defineCustomElementGatacaAutoqr } from './gataca-autoqr.js';
|
|
4
4
|
export { GatacaQr, defineCustomElement as defineCustomElementGatacaQr } from './gataca-qr.js';
|
|
5
5
|
export { GatacaQrdisplay, defineCustomElement as defineCustomElementGatacaQrdisplay } from './gataca-qrdisplay.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
const logoGatacaSvg = 'data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDc2IDcxIiB3aWR0aD0iNzEiIGhlaWdodD0iNjYiPgoJPHRpdGxlPlZlY3RvciAoMyktc3ZnPC90aXRsZT4KCTxzdHlsZT4KCQkuczAgeyBmaWxsOiAjNDc0NWI3IH0gCgk8L3N0eWxlPgoJPHBhdGggaWQ9IkxheWVyIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsYXNzPSJzMCIgZD0ibTcyLjIgMzguNGMyLjIgMy4zIDMuNSA3LjIgMy41IDExLjQgMCAxMS4yLTguOCAyMC4yLTE5LjkgMjAuN3EtMC40IDAtMC44IDBjLTMgMC01LjgtMC42LTguNC0xLjdxLTIuMS0xLTMuOC0yLjMtMS4xLTAuOC0yLjEtMS43LTEuMy0xLjItMi4zLTIuNi0wLjUgMC42LTEgMS4yYy0zLjggNC40LTkuNCA3LjEtMTUuNyA3LjEtNi43IDAtMTIuNi0zLjItMTYuNC04LjEtMi43LTMuNS00LjMtNy44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x) {
|
|
4
4
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
@@ -25,4 +25,10 @@ var qrCodeStyling = createCommonjsModule(function (module, exports) {
|
|
|
25
25
|
|
|
26
26
|
const QRCodeStyling = /*@__PURE__*/getDefaultExportFromCjs(qrCodeStyling);
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
const gatIconRefreshSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTIzIDRWMTBIMTciIHN0cm9rZT0iIzhCOEI4QiIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPHBhdGggZD0iTTIwLjQ4OTkgMTVDMTkuODM5OSAxNi44Mzk5IDE4LjYwOTQgMTguNDE4NyAxNi45ODQgMTkuNDk4NUMxNS4zNTg2IDIwLjU3ODMgMTMuNDI2MyAyMS4xMDA2IDExLjQ3ODMgMjAuOTg2NkM5LjUzMDI2IDIwLjg3MjYgNy42NzIwMyAyMC4xMjg2IDYuMTgzNjMgMTguODY2N0M0LjY5NTI0IDE3LjYwNDcgMy42NTczIDE1Ljg5MzIgMy4yMjYyNSAxMy45OTAxQzIuNzk1MTkgMTIuMDg2OSAyLjk5NDM2IDEwLjA5NTIgMy43OTM3NCA4LjMxNTA4QzQuNTkzMTMgNi41MzQ5NiA1Ljk0OTQyIDUuMDYyODggNy42NTgyMyA0LjEyMDY1QzkuMzY3MDUgMy4xNzg0MyAxMS4zMzU4IDIuODE3MTEgMTMuMjY3OCAzLjA5MTE2QzE1LjE5OTkgMy4zNjUyIDE2Ljk5MDUgNC4yNTk3NSAxOC4zNjk5IDUuNjQwMDFMMjIuOTk5OSA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jk1NTUgMjUuODk2QzE0LjAxNiAyNC44MzU1IDE1LjczNTQgMjQuODM1NSAxNi43OTU4IDI1Ljg5NkwyMS42NjQ1IDMwLjc2NDdMMzQuNjc5NyAxNy43NDk1QzM1Ljc0MDIgMTYuNjg5IDM3LjQ1OTUgMTYuNjg5IDM4LjUyIDE3Ljc0OTVaIiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K';
|
|
33
|
+
|
|
34
|
+
export { QRCodeStyling as Q, gatIconAlertSvg as a, gatIconCheckSvg as b, gatIconRefreshSvg as g, logoGatacaSvg as l };
|
|
@@ -2,7 +2,7 @@ import { r as registerInstance, c as createEvent, h } from './index-2be54f32.js'
|
|
|
2
2
|
|
|
3
3
|
const gatacaAutoqrCss = "@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}";
|
|
4
4
|
|
|
5
|
-
const DEFAULT_REPOSITORY =
|
|
5
|
+
const DEFAULT_REPOSITORY = 'https://studio.gataca.io/api/v1/qrconfigs';
|
|
6
6
|
const fixFunctions = (data) => {
|
|
7
7
|
var _a, _b, _c, _d, _e, _f;
|
|
8
8
|
data.errorCallback = deserializeFunction((_a = data.errorCallback) === null || _a === void 0 ? void 0 : _a.toString());
|
|
@@ -15,7 +15,7 @@ const fixFunctions = (data) => {
|
|
|
15
15
|
};
|
|
16
16
|
const deserializeFunction = (data) => {
|
|
17
17
|
if (data) {
|
|
18
|
-
return new Function(
|
|
18
|
+
return new Function('return ' + data)();
|
|
19
19
|
}
|
|
20
20
|
return undefined;
|
|
21
21
|
};
|
|
@@ -25,7 +25,7 @@ const GatacaAutoQR = class {
|
|
|
25
25
|
this.gatacaLoginCompleted = createEvent(this, "gatacaLoginCompleted", 7);
|
|
26
26
|
this.gatacaLoginFailed = createEvent(this, "gatacaLoginFailed", 7);
|
|
27
27
|
this.configId = undefined;
|
|
28
|
-
this.qrType =
|
|
28
|
+
this.qrType = 'svg';
|
|
29
29
|
this.configRepository = DEFAULT_REPOSITORY;
|
|
30
30
|
this.successCallback = undefined;
|
|
31
31
|
this.errorCallback = undefined;
|
|
@@ -36,11 +36,11 @@ const GatacaAutoQR = class {
|
|
|
36
36
|
this.config = undefined;
|
|
37
37
|
this.loading = undefined;
|
|
38
38
|
this.loading = true;
|
|
39
|
-
fetch(this.configRepository +
|
|
40
|
-
method:
|
|
39
|
+
fetch(this.configRepository + '/' + this.configId, {
|
|
40
|
+
method: 'GET',
|
|
41
41
|
headers: {
|
|
42
|
-
|
|
43
|
-
}
|
|
42
|
+
'Content-Type': 'application/json'
|
|
43
|
+
}
|
|
44
44
|
})
|
|
45
45
|
.then((response) => {
|
|
46
46
|
response
|
|
@@ -51,12 +51,12 @@ const GatacaAutoQR = class {
|
|
|
51
51
|
this.loading = false;
|
|
52
52
|
})
|
|
53
53
|
.catch((err) => {
|
|
54
|
-
console.log(
|
|
54
|
+
console.log('Cannot retrieve selected config', err);
|
|
55
55
|
this.loading = false;
|
|
56
56
|
});
|
|
57
57
|
})
|
|
58
58
|
.catch((err) => {
|
|
59
|
-
console.log(
|
|
59
|
+
console.log('Cannot retrieve selected config', err);
|
|
60
60
|
this.loading = false;
|
|
61
61
|
});
|
|
62
62
|
}
|