@gataca/qr 4.2.0 → 4.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/dist/gatacaqr/app-globals-0f993ce5.js +3 -0
  2. package/dist/gatacaqr/css-shim-8eec97b3.js +4 -0
  3. package/dist/gatacaqr/dom-1b0cf05d.js +73 -0
  4. package/dist/gatacaqr/gat-icon-check-9132c0ad.js +5 -0
  5. package/dist/{esm → gatacaqr}/gataca-autoqr.entry.js +1 -1
  6. package/dist/{components/gataca-qr2.js → gatacaqr/gataca-qr.entry.js} +10 -77
  7. package/dist/gatacaqr/gataca-qrdisplay-9a22c242.js +123 -0
  8. package/dist/gatacaqr/gataca-qrdisplay.entry.js +2 -0
  9. package/dist/{esm → gatacaqr}/gataca-qrws.entry.js +3 -2
  10. package/dist/{components/gataca-ssibutton2.js → gatacaqr/gataca-ssibutton.entry.js} +39 -89
  11. package/dist/{esm → gatacaqr}/gataca-ssibuttonws.entry.js +1 -1
  12. package/dist/gatacaqr/gatacaqr.esm.js +129 -1
  13. package/dist/gatacaqr/index-aea56eb8.js +3262 -0
  14. package/dist/gatacaqr/index.esm.js +1 -1
  15. package/dist/gatacaqr/shadow-css-146f2f6f.js +387 -0
  16. package/dist/types/components/gataca-autoqr/gataca-autoqr.e2e.d.ts +1 -0
  17. package/dist/types/components/gataca-qr/gataca-qr.e2e.d.ts +1 -0
  18. package/dist/types/components/gataca-qrdisplay/gataca-qrdisplay.e2e.d.ts +1 -0
  19. package/dist/types/components/gataca-qrws/gataca-qrws.e2e.d.ts +1 -0
  20. package/dist/types/components/gataca-ssibutton/gataca-ssibutton.d.ts +2 -1
  21. package/dist/types/components/gataca-ssibutton/gataca-ssibutton.e2e.d.ts +1 -0
  22. package/dist/types/components/gataca-ssibuttonws/gataca-ssibuttonws.e2e.d.ts +1 -0
  23. package/package.json +1 -1
  24. package/dist/cjs/gat-icon-check-6b6780eb.js +0 -37
  25. package/dist/cjs/gataca-autoqr.cjs.entry.js +0 -106
  26. package/dist/cjs/gataca-qr_3.cjs.entry.js +0 -743
  27. package/dist/cjs/gataca-qrws.cjs.entry.js +0 -366
  28. package/dist/cjs/gataca-ssibuttonws.cjs.entry.js +0 -61
  29. package/dist/cjs/gatacaqr.cjs.js +0 -19
  30. package/dist/cjs/index-d8d3dfde.js +0 -1532
  31. package/dist/cjs/index.cjs.js +0 -17
  32. package/dist/cjs/loader.cjs.js +0 -21
  33. package/dist/cjs/utils-17b0a5ba.js +0 -72
  34. package/dist/collection/assets/icons/gat-icon-alert.svg +0 -5
  35. package/dist/collection/assets/icons/gat-icon-check.svg +0 -5
  36. package/dist/collection/assets/icons/gat-icon-refresh.svg +0 -4
  37. package/dist/collection/assets/images/logo_gataca.svg +0 -7
  38. package/dist/collection/collection-manifest.json +0 -17
  39. package/dist/collection/components/gataca-autoqr/gataca-autoqr.css +0 -116
  40. package/dist/collection/components/gataca-autoqr/gataca-autoqr.js +0 -347
  41. package/dist/collection/components/gataca-qr/components/qr/QR.js +0 -13
  42. package/dist/collection/components/gataca-qr/components/readQR/ReadQR.js +0 -16
  43. package/dist/collection/components/gataca-qr/components/readQR/components/AnimatedLoader.js +0 -6
  44. package/dist/collection/components/gataca-qr/components/retryButton/RetryButton.js +0 -19
  45. package/dist/collection/components/gataca-qr/components/success/Success.js +0 -9
  46. package/dist/collection/components/gataca-qr/gataca-qr.css +0 -415
  47. package/dist/collection/components/gataca-qr/gataca-qr.js +0 -1069
  48. package/dist/collection/components/gataca-qrdisplay/gataca-qrdisplay.js +0 -224
  49. package/dist/collection/components/gataca-qrws/components/qr/QR.js +0 -13
  50. package/dist/collection/components/gataca-qrws/components/readQR/ReadQR.js +0 -11
  51. package/dist/collection/components/gataca-qrws/components/readQR/components/AnimatedLoader.js +0 -4
  52. package/dist/collection/components/gataca-qrws/components/retryButton/RetryButton.js +0 -16
  53. package/dist/collection/components/gataca-qrws/components/success/Success.js +0 -8
  54. package/dist/collection/components/gataca-qrws/gataca-qrws.css +0 -407
  55. package/dist/collection/components/gataca-qrws/gataca-qrws.js +0 -1098
  56. package/dist/collection/components/gataca-ssibutton/gataca-ssibutton.css +0 -116
  57. package/dist/collection/components/gataca-ssibutton/gataca-ssibutton.js +0 -1151
  58. package/dist/collection/components/gataca-ssibuttonws/gataca-ssibuttonws.css +0 -116
  59. package/dist/collection/components/gataca-ssibuttonws/gataca-ssibuttonws.js +0 -434
  60. package/dist/collection/components/icons/RefreshIcon.js +0 -6
  61. package/dist/collection/index.js +0 -2
  62. package/dist/collection/utils/index.js +0 -1
  63. package/dist/collection/utils/utils.js +0 -66
  64. package/dist/components/gat-icon-check.js +0 -72
  65. package/dist/components/gataca-autoqr.js +0 -163
  66. package/dist/components/gataca-qr.js +0 -6
  67. package/dist/components/gataca-qrdisplay.js +0 -6
  68. package/dist/components/gataca-qrdisplay2.js +0 -121
  69. package/dist/components/gataca-qrws.js +0 -6
  70. package/dist/components/gataca-qrws2.js +0 -430
  71. package/dist/components/gataca-ssibutton.js +0 -6
  72. package/dist/components/gataca-ssibuttonws.js +0 -6
  73. package/dist/components/gataca-ssibuttonws2.js +0 -104
  74. package/dist/components/index.js +0 -8
  75. package/dist/esm/gat-icon-check-7320c81b.js +0 -32
  76. package/dist/esm/gataca-qr_3.entry.js +0 -737
  77. package/dist/esm/gatacaqr.js +0 -17
  78. package/dist/esm/index-dca2ab22.js +0 -1506
  79. package/dist/esm/index.js +0 -1
  80. package/dist/esm/loader.js +0 -17
  81. package/dist/esm/polyfills/core-js.js +0 -11
  82. package/dist/esm/polyfills/css-shim.js +0 -1
  83. package/dist/esm/polyfills/dom.js +0 -79
  84. package/dist/esm/polyfills/es5-html-element.js +0 -1
  85. package/dist/esm/polyfills/index.js +0 -34
  86. package/dist/esm/polyfills/system.js +0 -6
  87. package/dist/gatacaqr/p-143c0080.js +0 -1
  88. package/dist/gatacaqr/p-29119208.js +0 -1
  89. package/dist/gatacaqr/p-2dc7190a.entry.js +0 -1
  90. package/dist/gatacaqr/p-2e8accf9.entry.js +0 -1
  91. package/dist/gatacaqr/p-85af64b1.js +0 -2
  92. package/dist/gatacaqr/p-d27dabe4.entry.js +0 -1
  93. package/dist/gatacaqr/p-e172581d.entry.js +0 -1
  94. package/dist/index.cjs.js +0 -1
  95. package/dist/index.js +0 -1
  96. /package/dist/{esm → gatacaqr}/utils-e4a08623.js +0 -0
@@ -1,1151 +0,0 @@
1
- import { h } from '@stencil/core';
2
- import '../gataca-qrdisplay/gataca-qrdisplay';
3
- import { RESULT_STATUS } from '../../utils/utils';
4
- 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=';
5
- //Default values
6
- const DEFAULT_SESSION_TIMEOUT = 300; //5mins as in connect
7
- const DEFAULT_POLLING_FREQ = 3;
8
- export class GatacaSSIButton {
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
- };
29
- this.buttonText = 'Easy login';
30
- this.buttonDCAPIText = 'Login with Device Credentials';
31
- this.qrType = 'svg';
32
- this.autostart = true;
33
- this.checkStatus = undefined;
34
- this.createSession = undefined;
35
- this.fillSession = undefined;
36
- this.successCallback = undefined;
37
- this.errorCallback = undefined;
38
- this.handleCheckAppLoading = undefined;
39
- this.checkAppTimeout = 6;
40
- this.qrRole = undefined;
41
- this.callbackServer = undefined;
42
- this.sessionTimeout = undefined;
43
- this.pollingFrequency = undefined;
44
- this.autorefresh = false;
45
- this.v = '3';
46
- this.qrModalTitle = 'Quick Access';
47
- this.modalTitleColor = '#4745B7';
48
- this.qrModalDescription = 'Sign up or sign in by scanning the QR Code with the Gataca Wallet';
49
- this.hideBrandTitle = false;
50
- this.dynamicLink = true;
51
- this.logoSize = 0;
52
- this.logoSrc = undefined;
53
- this.qrCodeExpiredLabel = 'QR Code expired';
54
- this.credentialsNotValidatedLabel = 'User credentials not validated';
55
- this.clickInsideBoxLabel = 'Click inside the box to';
56
- this.refreshQrLabel = 'Refresh QR Code';
57
- this.scanQrLabel = 'Scan QR Code';
58
- this.userNotScanInTimeErrorLabel = 'User did not scan the QR in the allowed time';
59
- this.credsNotValidatedErrorLabel = "Provided user credentials couldn't be validated";
60
- this.failedLoginErrorLabel = 'No successful login';
61
- this.successLoginLabel = 'Successful Connection!';
62
- this.byBrandLabel = 'by Gataca';
63
- this.waitingStartSessionLabel = 'waiting to start a session';
64
- this.enableDcApi = false;
65
- this.hideQrModalDescription = false;
66
- this.qrStyle = undefined;
67
- this.open = false;
68
- this.sessionId = undefined;
69
- this.authenticationRequest = undefined;
70
- this.sessionData = undefined;
71
- this.result = RESULT_STATUS.NOT_STARTED;
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;
88
- }
89
- /**
90
- * Retrieve manually the session data on a successful login
91
- */
92
- async getSessionData() {
93
- return this.qr.getSessionData();
94
- }
95
- async getSessionId() {
96
- if (this.sessionId) {
97
- return this.sessionId;
98
- }
99
- let { sessionId, authenticationRequest } = await this.createSession();
100
- this.sessionId = sessionId;
101
- this.authenticationRequest = authenticationRequest;
102
- return this.sessionId;
103
- }
104
- /**
105
- * Force manually the start polling
106
- */
107
- async startMobilePolling() {
108
- await this.getSessionId();
109
- this.result = RESULT_STATUS.ONGOING;
110
- this.poll()
111
- .then((data) => {
112
- this.result = RESULT_STATUS.SUCCESS;
113
- this.sessionData = data;
114
- this.gatacaLoginCompleted.emit(data);
115
- this.successCallback(data);
116
- })
117
- .catch((err) => {
118
- this.clean();
119
- let expired = err === RESULT_STATUS.EXPIRED;
120
- if (expired && this.autorefresh) {
121
- this.startMobilePolling();
122
- }
123
- else {
124
- if (err !== RESULT_STATUS.NOT_STARTED) {
125
- let error = expired ? new Error(this.userNotScanInTimeErrorLabel) : new Error(this.credsNotValidatedErrorLabel);
126
- this.result = err;
127
- this.gatacaLoginFailed.emit(error);
128
- this.errorCallback(error);
129
- }
130
- }
131
- });
132
- }
133
- /**
134
- * Stop manually an ongoing session
135
- */
136
- async stop() {
137
- this.clean();
138
- if (this.result === RESULT_STATUS.ONGOING || RESULT_STATUS.READ) {
139
- this.result = RESULT_STATUS.NOT_STARTED;
140
- }
141
- }
142
- clean() {
143
- this.sessionData = undefined;
144
- this.sessionId = undefined;
145
- }
146
- renderModal() {
147
- return this.qr;
148
- }
149
- async poll() {
150
- let endTime = new Date().getTime() + (this.sessionTimeout || DEFAULT_SESSION_TIMEOUT) * 1000;
151
- let interval = (this.pollingFrequency || DEFAULT_POLLING_FREQ) * 1000;
152
- let checkFunc = async (component) => {
153
- if (component.result === RESULT_STATUS.NOT_STARTED) {
154
- return { result: RESULT_STATUS.NOT_STARTED };
155
- }
156
- let id = await component.getSessionId();
157
- return component.checkStatus(id);
158
- };
159
- let component = this;
160
- let checkCondition = async function (resolve, reject) {
161
- // If the condition is met, we're done!
162
- let { result, data } = await checkFunc(component);
163
- switch (result) {
164
- case RESULT_STATUS.SUCCESS:
165
- resolve(data);
166
- break;
167
- case RESULT_STATUS.READ:
168
- component.result = RESULT_STATUS.READ;
169
- case RESULT_STATUS.ONGOING:
170
- if (component.sessionTimeout > 0 && new Date().getTime() < endTime) {
171
- setTimeout(checkCondition, interval, resolve, reject);
172
- }
173
- else {
174
- reject(RESULT_STATUS.EXPIRED);
175
- }
176
- break;
177
- default:
178
- reject(result);
179
- break;
180
- }
181
- };
182
- return new Promise(checkCondition);
183
- }
184
- isAppInstalled(appScheme, callback) {
185
- let timeout;
186
- let detected = false;
187
- if (appScheme === null || appScheme === void 0 ? void 0 : appScheme.length) {
188
- window.location.href = appScheme;
189
- }
190
- const waitTimeToCheckApp = this.checkAppTimeout * 1000;
191
- timeout = setTimeout(() => {
192
- if (!detected) {
193
- callback(false);
194
- }
195
- cleanup();
196
- }, waitTimeToCheckApp);
197
- const handleVisibilityChange = () => {
198
- if (document.hidden) {
199
- detected = true;
200
- callback(true);
201
- if (!this.autostart) {
202
- this.startMobilePolling();
203
- }
204
- cleanup();
205
- }
206
- };
207
- document.addEventListener('visibilitychange', handleVisibilityChange);
208
- function cleanup() {
209
- clearTimeout(timeout);
210
- document.removeEventListener('visibilitychange', handleVisibilityChange);
211
- }
212
- }
213
- renderDesktopButton() {
214
- return (h("div", { class: "gatacaButtonWrapper" }, h("button", { class: "gatacaButton", onClick: () => {
215
- this.open = !this.open;
216
- setTimeout(() => {
217
- var _a, _b;
218
- if (this.open) {
219
- (_a = this.qrElement) === null || _a === void 0 ? void 0 : _a.display();
220
- }
221
- else {
222
- (_b = this.qrElement) === null || _b === void 0 ? void 0 : _b.stop();
223
- }
224
- }, 0);
225
- } }, h("img", { src: PHONE_ICON, class: "buttonImg", alt: this.buttonText }), h("span", null, this.buttonText))));
226
- }
227
- async getAuthRequest() {
228
- let { authenticationRequest } = await this.createSession();
229
- return authenticationRequest;
230
- }
231
- renderMobileButton(isAndroid, isIos) {
232
- if (this.autostart && !this.supportsDCAPI()) {
233
- this.startMobilePolling();
234
- }
235
- let loading = false;
236
- const handleLoading = (isLoading) => {
237
- loading = isLoading;
238
- if (this.handleCheckAppLoading) {
239
- this.handleCheckAppLoading(isLoading);
240
- }
241
- };
242
- const executeRedirection = async () => {
243
- handleLoading(true);
244
- const androidStoreLink = 'https://play.google.com/store/apps/details?id=com.gataca.identity';
245
- const iosStoreLink = 'https://apps.apple.com/us/app/gataca/id1498607616';
246
- try {
247
- const appScheme = await this.getAuthRequest();
248
- this.isAppInstalled(appScheme, (installed) => {
249
- if (!installed) {
250
- this.stop();
251
- if (isAndroid) {
252
- window.location.href = androidStoreLink;
253
- }
254
- else if (isIos) {
255
- window.location.href = iosStoreLink;
256
- }
257
- }
258
- handleLoading(false);
259
- });
260
- }
261
- catch (error) {
262
- this.stop();
263
- handleLoading(false);
264
- }
265
- };
266
- return (h("div", { class: "gatacaButtonWrapper" }, h("button", { class: "gatacaButton", onClick: () => {
267
- this.gatacaButtonPushed.emit();
268
- executeRedirection();
269
- }, disabled: loading }, h("img", { src: PHONE_ICON, class: "buttonImg", alt: this.buttonText }), h("span", null, this.buttonText))));
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
- }
312
- render() {
313
- const userAgent =
314
- // @ts-ignore
315
- (navigator === null || navigator === void 0 ? void 0 : navigator.userAgent) || (navigator === null || navigator === void 0 ? void 0 : navigator.vendor) || (window === null || window === void 0 ? void 0 : window.opera);
316
- const isAndroid = /android/i.test(userAgent);
317
- const isIos =
318
- // @ts-ignore
319
- (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);
320
- const isMobile = isAndroid || isIos;
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))));
323
- }
324
- static get is() { return "gataca-ssibutton"; }
325
- static get encapsulation() { return "shadow"; }
326
- static get originalStyleUrls() {
327
- return {
328
- "$": ["gataca-ssibutton.scss"]
329
- };
330
- }
331
- static get styleUrls() {
332
- return {
333
- "$": ["gataca-ssibutton.css"]
334
- };
335
- }
336
- static get properties() {
337
- return {
338
- "buttonText": {
339
- "type": "string",
340
- "mutable": false,
341
- "complexType": {
342
- "original": "string",
343
- "resolved": "string",
344
- "references": {}
345
- },
346
- "required": false,
347
- "optional": true,
348
- "docs": {
349
- "tags": [],
350
- "text": "_[Optional]_\nIn the case of being a button, modifies its text"
351
- },
352
- "attribute": "button-text",
353
- "reflect": false,
354
- "defaultValue": "'Easy login'"
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
- },
374
- "qrType": {
375
- "type": "string",
376
- "mutable": false,
377
- "complexType": {
378
- "original": "DrawType",
379
- "resolved": "\"canvas\" | \"svg\"",
380
- "references": {
381
- "DrawType": {
382
- "location": "import",
383
- "path": "qr-code-styling"
384
- }
385
- }
386
- },
387
- "required": false,
388
- "optional": true,
389
- "docs": {
390
- "tags": [],
391
- "text": "_[Optional]_\nSets the qr type. It can be \"svg\" or \"canvas\". \"svg\" by default."
392
- },
393
- "attribute": "qr-type",
394
- "reflect": false,
395
- "defaultValue": "'svg'"
396
- },
397
- "autostart": {
398
- "type": "boolean",
399
- "mutable": false,
400
- "complexType": {
401
- "original": "boolean",
402
- "resolved": "boolean",
403
- "references": {}
404
- },
405
- "required": false,
406
- "optional": false,
407
- "docs": {
408
- "tags": [],
409
- "text": "_[Optional]_\nSet to start polling when button or QR is displayed. By default it is true"
410
- },
411
- "attribute": "autostart",
412
- "reflect": false,
413
- "defaultValue": "true"
414
- },
415
- "checkStatus": {
416
- "type": "unknown",
417
- "mutable": false,
418
- "complexType": {
419
- "original": "(id?: string) => Promise<{result: RESULT_STATUS; data?: any}>",
420
- "resolved": "(id?: string) => Promise<{ result: RESULT_STATUS; data?: any; }>",
421
- "references": {
422
- "Promise": {
423
- "location": "global"
424
- },
425
- "RESULT_STATUS": {
426
- "location": "import",
427
- "path": "../../utils/utils"
428
- }
429
- }
430
- },
431
- "required": false,
432
- "optional": true,
433
- "docs": {
434
- "tags": [],
435
- "text": "***Mandatory***\nCheck status function to query the current status of the session\nThe function must query a client endpoint to check the status. That endpoint must return an error if the session has expired."
436
- },
437
- "defaultValue": "undefined"
438
- },
439
- "createSession": {
440
- "type": "unknown",
441
- "mutable": false,
442
- "complexType": {
443
- "original": "() => Promise<{\n sessionId: string;\n authenticationRequest?: string;\n }>",
444
- "resolved": "() => Promise<{ sessionId: string; authenticationRequest?: string; }>",
445
- "references": {
446
- "Promise": {
447
- "location": "global"
448
- }
449
- }
450
- },
451
- "required": false,
452
- "optional": true,
453
- "docs": {
454
- "tags": [],
455
- "text": "***Mandatory***\nCreate session function to generate a new Session\nUsing v=\"3\", it can provide just a session Id\nUsing another version, it must provide also the authentication request. The session Id is the id of the presentation definition"
456
- },
457
- "defaultValue": "undefined"
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
- },
483
- "successCallback": {
484
- "type": "unknown",
485
- "mutable": false,
486
- "complexType": {
487
- "original": "(data?: any) => void",
488
- "resolved": "(data?: any) => void",
489
- "references": {}
490
- },
491
- "required": false,
492
- "optional": false,
493
- "docs": {
494
- "tags": [],
495
- "text": "***Mandatory***\nCallback fired upon session correctly verified\nIf not set, session validation wouldn't trigger any action\nThe session data and a possible token will be sent as parameters to the callback"
496
- },
497
- "defaultValue": "undefined"
498
- },
499
- "errorCallback": {
500
- "type": "unknown",
501
- "mutable": false,
502
- "complexType": {
503
- "original": "(error?: Error) => void",
504
- "resolved": "(error?: Error) => void",
505
- "references": {
506
- "Error": {
507
- "location": "global"
508
- }
509
- }
510
- },
511
- "required": false,
512
- "optional": false,
513
- "docs": {
514
- "tags": [],
515
- "text": "***Mandatory***\nCallback fired upon session expired or invalid\nIf not set, session error would not be handled\nAn error containing information will be passed as parameter"
516
- },
517
- "defaultValue": "undefined"
518
- },
519
- "handleCheckAppLoading": {
520
- "type": "unknown",
521
- "mutable": false,
522
- "complexType": {
523
- "original": "(isCheckingApp?: boolean) => void",
524
- "resolved": "(isCheckingApp?: boolean) => void",
525
- "references": {}
526
- },
527
- "required": false,
528
- "optional": true,
529
- "docs": {
530
- "tags": [],
531
- "text": "_[Optional]_\nFunction that runs every time the loading state changes while checking if the App is installed. Only on mobile with v3."
532
- },
533
- "defaultValue": "undefined"
534
- },
535
- "checkAppTimeout": {
536
- "type": "number",
537
- "mutable": false,
538
- "complexType": {
539
- "original": "number",
540
- "resolved": "number",
541
- "references": {}
542
- },
543
- "required": false,
544
- "optional": true,
545
- "docs": {
546
- "tags": [],
547
- "text": "_[Optional]_\nMaximum time window to check if the App is installed"
548
- },
549
- "attribute": "check-app-timeout",
550
- "reflect": false,
551
- "defaultValue": "6"
552
- },
553
- "qrRole": {
554
- "type": "string",
555
- "mutable": false,
556
- "complexType": {
557
- "original": "string",
558
- "resolved": "string",
559
- "references": {}
560
- },
561
- "required": false,
562
- "optional": false,
563
- "docs": {
564
- "tags": [],
565
- "text": "***Mandatory***\nDecide if scanning the credential as a verifier to request credentials\nor as an issuer too issue credentials.\nOptions: connect | certify"
566
- },
567
- "attribute": "qr-role",
568
- "reflect": false
569
- },
570
- "callbackServer": {
571
- "type": "string",
572
- "mutable": false,
573
- "complexType": {
574
- "original": "string",
575
- "resolved": "string",
576
- "references": {}
577
- },
578
- "required": false,
579
- "optional": false,
580
- "docs": {
581
- "tags": [],
582
- "text": "***Mandatory just for V1***\nConnect/Certify Server where the wallet will send the data"
583
- },
584
- "attribute": "callback-server",
585
- "reflect": false
586
- },
587
- "sessionTimeout": {
588
- "type": "number",
589
- "mutable": false,
590
- "complexType": {
591
- "original": "number",
592
- "resolved": "number",
593
- "references": {}
594
- },
595
- "required": false,
596
- "optional": true,
597
- "docs": {
598
- "tags": [],
599
- "text": "_[Optional]_\nMaximum time window to display the session"
600
- },
601
- "attribute": "session-timeout",
602
- "reflect": false
603
- },
604
- "pollingFrequency": {
605
- "type": "number",
606
- "mutable": false,
607
- "complexType": {
608
- "original": "number",
609
- "resolved": "number",
610
- "references": {}
611
- },
612
- "required": false,
613
- "optional": true,
614
- "docs": {
615
- "tags": [],
616
- "text": "_[Optional]_\nFrequency in seconds to check if the session has been validated"
617
- },
618
- "attribute": "polling-frequency",
619
- "reflect": false
620
- },
621
- "autorefresh": {
622
- "type": "boolean",
623
- "mutable": false,
624
- "complexType": {
625
- "original": "boolean",
626
- "resolved": "boolean",
627
- "references": {}
628
- },
629
- "required": false,
630
- "optional": false,
631
- "docs": {
632
- "tags": [],
633
- "text": "_[Optional]_\nSet to refresh the session automatically upon expiration. By default it is false"
634
- },
635
- "attribute": "autorefresh",
636
- "reflect": false,
637
- "defaultValue": "false"
638
- },
639
- "v": {
640
- "type": "string",
641
- "mutable": false,
642
- "complexType": {
643
- "original": "string",
644
- "resolved": "string",
645
- "references": {}
646
- },
647
- "required": false,
648
- "optional": true,
649
- "docs": {
650
- "tags": [],
651
- "text": "_[Optional]_\nIf 3, handle deeplink redirects and deprecates (remove) v1 functionality. If not, the create session must be providing both an authentication request and a session Id"
652
- },
653
- "attribute": "v",
654
- "reflect": false,
655
- "defaultValue": "'3'"
656
- },
657
- "qrModalTitle": {
658
- "type": "string",
659
- "mutable": false,
660
- "complexType": {
661
- "original": "string",
662
- "resolved": "string",
663
- "references": {}
664
- },
665
- "required": false,
666
- "optional": true,
667
- "docs": {
668
- "tags": [],
669
- "text": "_[Optional]_\nModifies the qr headline title"
670
- },
671
- "attribute": "qr-modal-title",
672
- "reflect": false,
673
- "defaultValue": "'Quick Access'"
674
- },
675
- "modalTitleColor": {
676
- "type": "string",
677
- "mutable": false,
678
- "complexType": {
679
- "original": "string",
680
- "resolved": "string",
681
- "references": {}
682
- },
683
- "required": false,
684
- "optional": true,
685
- "docs": {
686
- "tags": [],
687
- "text": "_[Optional]_\nString to set Modal title color"
688
- },
689
- "attribute": "modal-title-color",
690
- "reflect": false,
691
- "defaultValue": "'#4745B7'"
692
- },
693
- "qrModalDescription": {
694
- "type": "string",
695
- "mutable": false,
696
- "complexType": {
697
- "original": "string",
698
- "resolved": "string",
699
- "references": {}
700
- },
701
- "required": false,
702
- "optional": true,
703
- "docs": {
704
- "tags": [],
705
- "text": "_[Optional]_\nModifies the Modal description"
706
- },
707
- "attribute": "qr-modal-description",
708
- "reflect": false,
709
- "defaultValue": "'Sign up or sign in by scanning the QR Code with the Gataca Wallet'"
710
- },
711
- "hideBrandTitle": {
712
- "type": "boolean",
713
- "mutable": false,
714
- "complexType": {
715
- "original": "boolean",
716
- "resolved": "boolean",
717
- "references": {}
718
- },
719
- "required": false,
720
- "optional": true,
721
- "docs": {
722
- "tags": [],
723
- "text": "_[Optional]_\nBoolean to show or not show the gataca brand title"
724
- },
725
- "attribute": "hide-brand-title",
726
- "reflect": false,
727
- "defaultValue": "false"
728
- },
729
- "dynamicLink": {
730
- "type": "boolean",
731
- "mutable": false,
732
- "complexType": {
733
- "original": "boolean",
734
- "resolved": "boolean",
735
- "references": {}
736
- },
737
- "required": false,
738
- "optional": true,
739
- "docs": {
740
- "tags": [],
741
- "text": "_[Optional]_\nDisplay a link containing a dynamic link to invoke the wallet if closed"
742
- },
743
- "attribute": "dynamic-link",
744
- "reflect": false,
745
- "defaultValue": "true"
746
- },
747
- "logoSize": {
748
- "type": "number",
749
- "mutable": false,
750
- "complexType": {
751
- "original": "number",
752
- "resolved": "number",
753
- "references": {}
754
- },
755
- "required": false,
756
- "optional": true,
757
- "docs": {
758
- "tags": [],
759
- "text": "_[Optional]_\nSize of the logo to display in percentage to the total size [0-1]. 0 means no logo will be displayed. Default is the GATACA logo. Recommended size is around 0.33"
760
- },
761
- "attribute": "logo-size",
762
- "reflect": false,
763
- "defaultValue": "0"
764
- },
765
- "logoSrc": {
766
- "type": "string",
767
- "mutable": false,
768
- "complexType": {
769
- "original": "string",
770
- "resolved": "string",
771
- "references": {}
772
- },
773
- "required": false,
774
- "optional": true,
775
- "docs": {
776
- "tags": [],
777
- "text": "_[Optional]_\nLogo to display, just if the logo size is greater than 0. No logo is the GATACA logo."
778
- },
779
- "attribute": "logo-src",
780
- "reflect": false
781
- },
782
- "qrCodeExpiredLabel": {
783
- "type": "string",
784
- "mutable": false,
785
- "complexType": {
786
- "original": "string",
787
- "resolved": "string",
788
- "references": {}
789
- },
790
- "required": false,
791
- "optional": true,
792
- "docs": {
793
- "tags": [],
794
- "text": "_[Optional]_\nString to show when qr code expired"
795
- },
796
- "attribute": "qr-code-expired-label",
797
- "reflect": false,
798
- "defaultValue": "'QR Code expired'"
799
- },
800
- "credentialsNotValidatedLabel": {
801
- "type": "string",
802
- "mutable": false,
803
- "complexType": {
804
- "original": "string",
805
- "resolved": "string",
806
- "references": {}
807
- },
808
- "required": false,
809
- "optional": true,
810
- "docs": {
811
- "tags": [],
812
- "text": "_[Optional]_\nString to show when credentials not validatedd"
813
- },
814
- "attribute": "credentials-not-validated-label",
815
- "reflect": false,
816
- "defaultValue": "'User credentials not validated'"
817
- },
818
- "clickInsideBoxLabel": {
819
- "type": "string",
820
- "mutable": false,
821
- "complexType": {
822
- "original": "string",
823
- "resolved": "string",
824
- "references": {}
825
- },
826
- "required": false,
827
- "optional": true,
828
- "docs": {
829
- "tags": [],
830
- "text": "_[Optional]_\nString to show \"click inside\" label"
831
- },
832
- "attribute": "click-inside-box-label",
833
- "reflect": false,
834
- "defaultValue": "'Click inside the box to'"
835
- },
836
- "refreshQrLabel": {
837
- "type": "string",
838
- "mutable": false,
839
- "complexType": {
840
- "original": "string",
841
- "resolved": "string",
842
- "references": {}
843
- },
844
- "required": false,
845
- "optional": true,
846
- "docs": {
847
- "tags": [],
848
- "text": "_[Optional]_\nString to show \"refresh QR\" label"
849
- },
850
- "attribute": "refresh-qr-label",
851
- "reflect": false,
852
- "defaultValue": "'Refresh QR Code'"
853
- },
854
- "scanQrLabel": {
855
- "type": "string",
856
- "mutable": false,
857
- "complexType": {
858
- "original": "string",
859
- "resolved": "string",
860
- "references": {}
861
- },
862
- "required": false,
863
- "optional": true,
864
- "docs": {
865
- "tags": [],
866
- "text": "_[Optional]_\nString to show \"scan QR\" label"
867
- },
868
- "attribute": "scan-qr-label",
869
- "reflect": false,
870
- "defaultValue": "'Scan QR Code'"
871
- },
872
- "userNotScanInTimeErrorLabel": {
873
- "type": "string",
874
- "mutable": false,
875
- "complexType": {
876
- "original": "string",
877
- "resolved": "string",
878
- "references": {}
879
- },
880
- "required": false,
881
- "optional": true,
882
- "docs": {
883
- "tags": [],
884
- "text": "_[Optional]_\nString to show \"user not scan in time\" error"
885
- },
886
- "attribute": "user-not-scan-in-time-error-label",
887
- "reflect": false,
888
- "defaultValue": "'User did not scan the QR in the allowed time'"
889
- },
890
- "credsNotValidatedErrorLabel": {
891
- "type": "string",
892
- "mutable": false,
893
- "complexType": {
894
- "original": "string",
895
- "resolved": "string",
896
- "references": {}
897
- },
898
- "required": false,
899
- "optional": true,
900
- "docs": {
901
- "tags": [],
902
- "text": "_[Optional]_\nString to show \"provided credentials not validates\" error"
903
- },
904
- "attribute": "creds-not-validated-error-label",
905
- "reflect": false,
906
- "defaultValue": "\"Provided user credentials couldn't be validated\""
907
- },
908
- "failedLoginErrorLabel": {
909
- "type": "string",
910
- "mutable": false,
911
- "complexType": {
912
- "original": "string",
913
- "resolved": "string",
914
- "references": {}
915
- },
916
- "required": false,
917
- "optional": true,
918
- "docs": {
919
- "tags": [],
920
- "text": "_[Optional]_\nString to show \"failed login\" error"
921
- },
922
- "attribute": "failed-login-error-label",
923
- "reflect": false,
924
- "defaultValue": "'No successful login'"
925
- },
926
- "successLoginLabel": {
927
- "type": "string",
928
- "mutable": false,
929
- "complexType": {
930
- "original": "string",
931
- "resolved": "string",
932
- "references": {}
933
- },
934
- "required": false,
935
- "optional": true,
936
- "docs": {
937
- "tags": [],
938
- "text": "_[Optional]_\nString to show \"successful login\" label"
939
- },
940
- "attribute": "success-login-label",
941
- "reflect": false,
942
- "defaultValue": "'Successful Connection!'"
943
- },
944
- "byBrandLabel": {
945
- "type": "string",
946
- "mutable": false,
947
- "complexType": {
948
- "original": "string",
949
- "resolved": "string",
950
- "references": {}
951
- },
952
- "required": false,
953
- "optional": true,
954
- "docs": {
955
- "tags": [],
956
- "text": "_[Optional]_\nString to show \"by brand\" label"
957
- },
958
- "attribute": "by-brand-label",
959
- "reflect": false,
960
- "defaultValue": "'by Gataca'"
961
- },
962
- "waitingStartSessionLabel": {
963
- "type": "string",
964
- "mutable": false,
965
- "complexType": {
966
- "original": "string",
967
- "resolved": "string",
968
- "references": {}
969
- },
970
- "required": false,
971
- "optional": true,
972
- "docs": {
973
- "tags": [],
974
- "text": "_[Optional]_\nString to show \"waiting start session\" label"
975
- },
976
- "attribute": "waiting-start-session-label",
977
- "reflect": false,
978
- "defaultValue": "'waiting to start a session'"
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
- },
998
- "hideQrModalDescription": {
999
- "type": "boolean",
1000
- "mutable": false,
1001
- "complexType": {
1002
- "original": "boolean",
1003
- "resolved": "boolean",
1004
- "references": {}
1005
- },
1006
- "required": false,
1007
- "optional": true,
1008
- "docs": {
1009
- "tags": [],
1010
- "text": "_[Optional]_\nBoolean to show or not show the QR Modal description"
1011
- },
1012
- "attribute": "hide-qr-modal-description",
1013
- "reflect": false,
1014
- "defaultValue": "false"
1015
- },
1016
- "qrStyle": {
1017
- "type": "unknown",
1018
- "mutable": false,
1019
- "complexType": {
1020
- "original": "qrStyle",
1021
- "resolved": "{ color: string; bgColor: string; alertBgColor?: string; alertBorderColor?: string; boxShadow?: 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
- }
1035
- }
1036
- };
1037
- }
1038
- static get states() {
1039
- return {
1040
- "open": {},
1041
- "sessionId": {},
1042
- "authenticationRequest": {},
1043
- "sessionData": {},
1044
- "result": {}
1045
- };
1046
- }
1047
- static get events() {
1048
- return [{
1049
- "method": "gatacaLoginCompleted",
1050
- "name": "gatacaLoginCompleted",
1051
- "bubbles": true,
1052
- "cancelable": true,
1053
- "composed": true,
1054
- "docs": {
1055
- "tags": [],
1056
- "text": "GatacaLoginCompleted event, triggered with session data upon login success"
1057
- },
1058
- "complexType": {
1059
- "original": "any",
1060
- "resolved": "any",
1061
- "references": {}
1062
- }
1063
- }, {
1064
- "method": "gatacaLoginFailed",
1065
- "name": "gatacaLoginFailed",
1066
- "bubbles": true,
1067
- "cancelable": true,
1068
- "composed": true,
1069
- "docs": {
1070
- "tags": [],
1071
- "text": "GatacaLoginFailed event, triggered with error upon login failure"
1072
- },
1073
- "complexType": {
1074
- "original": "any",
1075
- "resolved": "any",
1076
- "references": {}
1077
- }
1078
- }, {
1079
- "method": "gatacaButtonPushed",
1080
- "name": "gatacaButtonPushed",
1081
- "bubbles": true,
1082
- "cancelable": true,
1083
- "composed": true,
1084
- "docs": {
1085
- "tags": [],
1086
- "text": "GatacaLoginCompleted event, triggered with session data upon login success"
1087
- },
1088
- "complexType": {
1089
- "original": "any",
1090
- "resolved": "any",
1091
- "references": {}
1092
- }
1093
- }];
1094
- }
1095
- static get methods() {
1096
- return {
1097
- "getSessionData": {
1098
- "complexType": {
1099
- "signature": "() => Promise<any>",
1100
- "parameters": [],
1101
- "references": {
1102
- "Promise": {
1103
- "location": "global"
1104
- }
1105
- },
1106
- "return": "Promise<any>"
1107
- },
1108
- "docs": {
1109
- "text": "Retrieve manually the session data on a successful login",
1110
- "tags": []
1111
- }
1112
- },
1113
- "startMobilePolling": {
1114
- "complexType": {
1115
- "signature": "() => Promise<void>",
1116
- "parameters": [],
1117
- "references": {
1118
- "Promise": {
1119
- "location": "global"
1120
- },
1121
- "RESULT_STATUS": {
1122
- "location": "import",
1123
- "path": "../../utils/utils"
1124
- }
1125
- },
1126
- "return": "Promise<void>"
1127
- },
1128
- "docs": {
1129
- "text": "Force manually the start polling",
1130
- "tags": []
1131
- }
1132
- },
1133
- "stop": {
1134
- "complexType": {
1135
- "signature": "() => Promise<void>",
1136
- "parameters": [],
1137
- "references": {
1138
- "Promise": {
1139
- "location": "global"
1140
- }
1141
- },
1142
- "return": "Promise<void>"
1143
- },
1144
- "docs": {
1145
- "text": "Stop manually an ongoing session",
1146
- "tags": []
1147
- }
1148
- }
1149
- };
1150
- }
1151
- }