@gataca/qr 4.2.1 → 4.2.2

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 (95) hide show
  1. package/dist/cjs/gat-icon-check-6b6780eb.js +37 -0
  2. package/dist/cjs/gataca-autoqr.cjs.entry.js +106 -0
  3. package/dist/cjs/gataca-qr_3.cjs.entry.js +766 -0
  4. package/dist/cjs/gataca-qrws.cjs.entry.js +366 -0
  5. package/dist/cjs/gataca-ssibuttonws.cjs.entry.js +61 -0
  6. package/dist/cjs/gatacaqr.cjs.js +19 -0
  7. package/dist/cjs/index-d8d3dfde.js +1532 -0
  8. package/dist/cjs/index.cjs.js +17 -0
  9. package/dist/cjs/loader.cjs.js +21 -0
  10. package/dist/cjs/utils-17b0a5ba.js +72 -0
  11. package/dist/collection/assets/icons/gat-icon-alert.svg +5 -0
  12. package/dist/collection/assets/icons/gat-icon-check.svg +5 -0
  13. package/dist/collection/assets/icons/gat-icon-refresh.svg +4 -0
  14. package/dist/collection/assets/images/logo_gataca.svg +7 -0
  15. package/dist/collection/collection-manifest.json +17 -0
  16. package/dist/collection/components/gataca-autoqr/gataca-autoqr.css +116 -0
  17. package/dist/collection/components/gataca-autoqr/gataca-autoqr.js +347 -0
  18. package/dist/collection/components/gataca-qr/components/qr/QR.js +13 -0
  19. package/dist/collection/components/gataca-qr/components/readQR/ReadQR.js +16 -0
  20. package/dist/collection/components/gataca-qr/components/readQR/components/AnimatedLoader.js +6 -0
  21. package/dist/collection/components/gataca-qr/components/retryButton/RetryButton.js +19 -0
  22. package/dist/collection/components/gataca-qr/components/success/Success.js +9 -0
  23. package/dist/collection/components/gataca-qr/gataca-qr.css +415 -0
  24. package/dist/collection/components/gataca-qr/gataca-qr.js +1069 -0
  25. package/dist/collection/components/gataca-qrdisplay/gataca-qrdisplay.js +224 -0
  26. package/dist/collection/components/gataca-qrws/components/qr/QR.js +13 -0
  27. package/dist/collection/components/gataca-qrws/components/readQR/ReadQR.js +11 -0
  28. package/dist/collection/components/gataca-qrws/components/readQR/components/AnimatedLoader.js +4 -0
  29. package/dist/collection/components/gataca-qrws/components/retryButton/RetryButton.js +16 -0
  30. package/dist/collection/components/gataca-qrws/components/success/Success.js +8 -0
  31. package/dist/collection/components/gataca-qrws/gataca-qrws.css +407 -0
  32. package/dist/collection/components/gataca-qrws/gataca-qrws.js +1098 -0
  33. package/dist/collection/components/gataca-ssibutton/gataca-ssibutton.css +116 -0
  34. package/dist/collection/components/gataca-ssibutton/gataca-ssibutton.js +1174 -0
  35. package/dist/collection/components/gataca-ssibuttonws/gataca-ssibuttonws.css +116 -0
  36. package/dist/collection/components/gataca-ssibuttonws/gataca-ssibuttonws.js +434 -0
  37. package/dist/collection/components/icons/RefreshIcon.js +6 -0
  38. package/dist/collection/index.js +2 -0
  39. package/dist/collection/utils/index.js +1 -0
  40. package/dist/collection/utils/utils.js +66 -0
  41. package/dist/components/gat-icon-check.js +72 -0
  42. package/dist/components/gataca-autoqr.js +163 -0
  43. package/dist/components/gataca-qr.js +6 -0
  44. package/dist/{gatacaqr/gataca-qr.entry.js → components/gataca-qr2.js} +77 -10
  45. package/dist/components/gataca-qrdisplay.js +6 -0
  46. package/dist/components/gataca-qrdisplay2.js +121 -0
  47. package/dist/components/gataca-qrws.js +6 -0
  48. package/dist/components/gataca-qrws2.js +430 -0
  49. package/dist/components/gataca-ssibutton.js +6 -0
  50. package/dist/{gatacaqr/gataca-ssibutton.entry.js → components/gataca-ssibutton2.js} +82 -9
  51. package/dist/components/gataca-ssibuttonws.js +6 -0
  52. package/dist/components/gataca-ssibuttonws2.js +104 -0
  53. package/dist/components/index.js +8 -0
  54. package/dist/esm/gat-icon-check-7320c81b.js +32 -0
  55. package/dist/{gatacaqr → esm}/gataca-autoqr.entry.js +1 -1
  56. package/dist/esm/gataca-qr_3.entry.js +760 -0
  57. package/dist/{gatacaqr → esm}/gataca-qrws.entry.js +2 -3
  58. package/dist/{gatacaqr → esm}/gataca-ssibuttonws.entry.js +1 -1
  59. package/dist/esm/gatacaqr.js +17 -0
  60. package/dist/esm/index-dca2ab22.js +1506 -0
  61. package/dist/esm/index.js +1 -0
  62. package/dist/esm/loader.js +17 -0
  63. package/dist/esm/polyfills/core-js.js +11 -0
  64. package/dist/esm/polyfills/css-shim.js +1 -0
  65. package/dist/esm/polyfills/dom.js +79 -0
  66. package/dist/esm/polyfills/es5-html-element.js +1 -0
  67. package/dist/esm/polyfills/index.js +34 -0
  68. package/dist/esm/polyfills/system.js +6 -0
  69. package/dist/gatacaqr/gatacaqr.esm.js +1 -129
  70. package/dist/gatacaqr/index.esm.js +1 -1
  71. package/dist/gatacaqr/p-143c0080.js +1 -0
  72. package/dist/gatacaqr/p-29119208.js +1 -0
  73. package/dist/gatacaqr/p-2dc7190a.entry.js +1 -0
  74. package/dist/gatacaqr/p-2e8accf9.entry.js +1 -0
  75. package/dist/gatacaqr/p-36ff5224.entry.js +1 -0
  76. package/dist/gatacaqr/p-85af64b1.js +2 -0
  77. package/dist/gatacaqr/p-d27dabe4.entry.js +1 -0
  78. package/dist/index.cjs.js +1 -0
  79. package/dist/index.js +1 -0
  80. package/package.json +1 -1
  81. package/dist/gatacaqr/app-globals-0f993ce5.js +0 -3
  82. package/dist/gatacaqr/css-shim-8eec97b3.js +0 -4
  83. package/dist/gatacaqr/dom-1b0cf05d.js +0 -73
  84. package/dist/gatacaqr/gat-icon-check-9132c0ad.js +0 -5
  85. package/dist/gatacaqr/gataca-qrdisplay-9a22c242.js +0 -123
  86. package/dist/gatacaqr/gataca-qrdisplay.entry.js +0 -2
  87. package/dist/gatacaqr/index-aea56eb8.js +0 -3262
  88. package/dist/gatacaqr/shadow-css-146f2f6f.js +0 -387
  89. package/dist/types/components/gataca-autoqr/gataca-autoqr.e2e.d.ts +0 -1
  90. package/dist/types/components/gataca-qr/gataca-qr.e2e.d.ts +0 -1
  91. package/dist/types/components/gataca-qrdisplay/gataca-qrdisplay.e2e.d.ts +0 -1
  92. package/dist/types/components/gataca-qrws/gataca-qrws.e2e.d.ts +0 -1
  93. package/dist/types/components/gataca-ssibutton/gataca-ssibutton.e2e.d.ts +0 -1
  94. package/dist/types/components/gataca-ssibuttonws/gataca-ssibuttonws.e2e.d.ts +0 -1
  95. /package/dist/{gatacaqr → esm}/utils-e4a08623.js +0 -0
@@ -0,0 +1,1069 @@
1
+ import { h } from '@stencil/core';
2
+ import logoGataca from '../../assets/images/logo_gataca.svg';
3
+ import { base64UrlEncode, checkMobile, RESULT_STATUS, shortenUrlIfPossible } from '../../utils/utils';
4
+ import '../gataca-qrdisplay/gataca-qrdisplay';
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
+ const DEEP_LINK_PREFIX = 'https://api.gataca.io/qr/redirect.html';
10
+ //Default values
11
+ const DEFAULT_SESSION_TIMEOUT = 300; //5mins as in connect
12
+ const DEFAULT_POLLING_FREQ = 3;
13
+ export class GatacaQR {
14
+ constructor() {
15
+ this.lastShortenRaw = null;
16
+ this.checkStatus = undefined;
17
+ this.createSession = undefined;
18
+ this.successCallback = undefined;
19
+ this.errorCallback = undefined;
20
+ this.qrRole = undefined;
21
+ this.qrType = 'svg';
22
+ this.callbackServer = undefined;
23
+ this.autostart = true;
24
+ this.autorefresh = false;
25
+ this.v = '3';
26
+ this.qrModalTitle = 'Quick Access';
27
+ this.modalTitleColor = '#4745B7';
28
+ this.qrModalDescription = 'Sign up or sign in by scanning the QR Code with the Gataca Wallet';
29
+ this.hideModalTexts = false;
30
+ this.hideModalBoxShadow = false;
31
+ this.hideBrandTitle = false;
32
+ this.logoSize = 0;
33
+ this.logoSrc = logoGataca;
34
+ this.qrSize = 300;
35
+ this.modalWidth = 300;
36
+ this.modalHeight = undefined;
37
+ this.qrCodeExpiredLabel = 'QR Code expired';
38
+ this.credentialsNotValidatedLabel = 'User credentials not validated';
39
+ this.clickInsideBoxLabel = 'Click inside the box to';
40
+ this.refreshQrLabel = 'Refresh QR Code';
41
+ this.scanQrLabel = 'Scan QR Code';
42
+ this.userNotScanInTimeErrorLabel = 'User did not scan the QR in the allowed time';
43
+ this.credsNotValidatedErrorLabel = "Provided user credentials couldn't be validated";
44
+ this.failedLoginErrorLabel = 'No successful login';
45
+ this.successLoginLabel = 'Successful Connection!';
46
+ this.byBrandLabel = 'by Gataca';
47
+ this.waitingStartSessionLabel = 'waiting to start a session';
48
+ this.readQrTitle = 'Processing...';
49
+ this.readQrDescription = 'Please wait a moment';
50
+ this.hideQrModalDescription = false;
51
+ this.sessionTimeout = DEFAULT_SESSION_TIMEOUT;
52
+ this.pollingFrequency = DEFAULT_POLLING_FREQ;
53
+ this.dynamicLink = true;
54
+ this.qrStyle = undefined;
55
+ this.sessionId = undefined;
56
+ this.authenticationRequest = undefined;
57
+ this.sessionData = undefined;
58
+ this.result = RESULT_STATUS.NOT_STARTED;
59
+ this.qrHref = '';
60
+ }
61
+ disconnectedCallback() {
62
+ this.stop();
63
+ }
64
+ async componentDidLoad() {
65
+ if (this.autostart) {
66
+ await this.display();
67
+ }
68
+ }
69
+ /**
70
+ * Force manually the display of a QR
71
+ */
72
+ async display() {
73
+ await this.getSessionId();
74
+ await this.refreshQrHref();
75
+ this.result = RESULT_STATUS.ONGOING;
76
+ this.poll()
77
+ .then((data) => {
78
+ this.result = RESULT_STATUS.SUCCESS;
79
+ this.sessionData = data;
80
+ this.gatacaLoginCompleted.emit(data);
81
+ this.successCallback(data);
82
+ })
83
+ .catch((err) => {
84
+ this.clean();
85
+ let expired = err === RESULT_STATUS.EXPIRED;
86
+ if (expired && this.autorefresh) {
87
+ this.display();
88
+ }
89
+ else {
90
+ if (err !== RESULT_STATUS.NOT_STARTED) {
91
+ let error = expired ? new Error(this.userNotScanInTimeErrorLabel) : new Error(this.credsNotValidatedErrorLabel);
92
+ this.result = err;
93
+ this.gatacaLoginFailed.emit(error);
94
+ this.errorCallback(error);
95
+ }
96
+ }
97
+ });
98
+ if (checkMobile() && this.dynamicLink) {
99
+ window.location.href = this.getLink();
100
+ }
101
+ }
102
+ buildRawLink() {
103
+ var _a;
104
+ if (this.v === '2') {
105
+ return (_a = this.authenticationRequest) !== null && _a !== void 0 ? _a : '';
106
+ }
107
+ const authRequestEncoded = '?dl=' + base64UrlEncode(this.authenticationRequest);
108
+ return DEEP_LINK_PREFIX + authRequestEncoded;
109
+ }
110
+ async refreshQrHref() {
111
+ var _a;
112
+ const raw = this.buildRawLink();
113
+ if (raw === this.lastShortenRaw) {
114
+ return;
115
+ }
116
+ this.lastShortenRaw = raw;
117
+ const shortened = await shortenUrlIfPossible(raw !== null && raw !== void 0 ? raw : '');
118
+ const now = this.buildRawLink();
119
+ if (now === raw) {
120
+ this.qrHref = shortened;
121
+ }
122
+ else if (!((_a = this.qrHref) === null || _a === void 0 ? void 0 : _a.trim())) {
123
+ this.qrHref = now;
124
+ }
125
+ }
126
+ /**
127
+ * Stop manually an ongoing session
128
+ */
129
+ async stop() {
130
+ this.clean();
131
+ if (this.result === RESULT_STATUS.ONGOING || RESULT_STATUS.READ) {
132
+ this.result = RESULT_STATUS.NOT_STARTED;
133
+ }
134
+ }
135
+ clean() {
136
+ this.sessionData = undefined;
137
+ this.sessionId = undefined;
138
+ this.qrHref = '';
139
+ this.lastShortenRaw = null;
140
+ }
141
+ /**
142
+ * Retrieve manually the session data on a successful login
143
+ */
144
+ async getSessionData() {
145
+ return this.sessionData ? Promise.resolve(this.sessionData) : Promise.reject(new Error(this.failedLoginErrorLabel));
146
+ }
147
+ async getSessionId() {
148
+ if (this.sessionId) {
149
+ return this.sessionId;
150
+ }
151
+ let { sessionId, authenticationRequest } = await this.createSession();
152
+ this.sessionId = sessionId;
153
+ this.authenticationRequest = authenticationRequest;
154
+ return this.sessionId;
155
+ }
156
+ getLink() {
157
+ return this.qrHref || this.buildRawLink();
158
+ }
159
+ async poll() {
160
+ let endTime = new Date().getTime() + (this.sessionTimeout || DEFAULT_SESSION_TIMEOUT) * 1000;
161
+ let interval = (this.pollingFrequency || DEFAULT_POLLING_FREQ) * 1000;
162
+ let checkFunc = async (component) => {
163
+ if (component.result === RESULT_STATUS.NOT_STARTED) {
164
+ return { result: RESULT_STATUS.NOT_STARTED };
165
+ }
166
+ let id = await component.getSessionId();
167
+ return component.checkStatus(id);
168
+ };
169
+ let component = this;
170
+ let checkCondition = async function (resolve, reject) {
171
+ // If the condition is met, we're done!
172
+ let { result, data } = await checkFunc(component);
173
+ switch (result) {
174
+ case RESULT_STATUS.SUCCESS:
175
+ resolve(data);
176
+ break;
177
+ case RESULT_STATUS.READ:
178
+ component.result = RESULT_STATUS.READ;
179
+ case RESULT_STATUS.ONGOING:
180
+ if (component.sessionTimeout > 0 && new Date().getTime() < endTime) {
181
+ setTimeout(checkCondition, interval, resolve, reject);
182
+ }
183
+ else {
184
+ reject(RESULT_STATUS.EXPIRED);
185
+ }
186
+ break;
187
+ default:
188
+ reject(result);
189
+ break;
190
+ }
191
+ };
192
+ return new Promise(checkCondition);
193
+ }
194
+ renderQRSection() {
195
+ var _a;
196
+ switch (this.result) {
197
+ case RESULT_STATUS.NOT_STARTED:
198
+ return this.renderRetryButton();
199
+ case RESULT_STATUS.ONGOING:
200
+ return this.renderQR(this.getLink(), true, undefined, !!((_a = this.qrHref) === null || _a === void 0 ? void 0 : _a.trim()));
201
+ case RESULT_STATUS.EXPIRED:
202
+ return this.renderRetryButton(this.qrCodeExpiredLabel);
203
+ case RESULT_STATUS.FAILED:
204
+ return this.renderRetryButton(this.credentialsNotValidatedLabel);
205
+ case RESULT_STATUS.SUCCESS:
206
+ return this.renderSuccess();
207
+ case RESULT_STATUS.READ:
208
+ return this.renderReadQR({
209
+ title: this === null || this === void 0 ? void 0 : this.readQrTitle,
210
+ description: this === null || this === void 0 ? void 0 : this.readQrDescription
211
+ });
212
+ }
213
+ }
214
+ renderSuccess() {
215
+ return h(Success, { modalHeight: this === null || this === void 0 ? void 0 : this.modalHeight, successLoginLabel: this === null || this === void 0 ? void 0 : this.successLoginLabel, style: this === null || this === void 0 ? void 0 : this.qrStyle });
216
+ }
217
+ renderRetryButton(errorMessage) {
218
+ return (h(RetryButton, { errorMessage: errorMessage, modalWidth: this === null || this === void 0 ? void 0 : this.modalWidth, clickInsideBoxLabel: this === null || this === void 0 ? void 0 : this.clickInsideBoxLabel, refreshQrLabel: this === null || this === void 0 ? void 0 : this.refreshQrLabel, scanQrLabel: this === null || this === void 0 ? void 0 : this.scanQrLabel, display: this.display.bind(this), style: this === null || this === void 0 ? void 0 : this.qrStyle }));
219
+ }
220
+ renderReadQR(readQrMessages) {
221
+ var _a;
222
+ const linkReady = !!((_a = this.qrHref) === null || _a === void 0 ? void 0 : _a.trim());
223
+ 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: (url, useLogo, size) => this.renderQR(url, useLogo, size, linkReady), style: this.qrStyle }));
224
+ }
225
+ renderQR(value, useLogo, sizeQR, linkReady = true) {
226
+ 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, linkReady: linkReady }));
227
+ }
228
+ render() {
229
+ var _a, _b, _c, _d, _e, _f;
230
+ return (h("div", { class: "popUpContainer" }, h("div", { class: `is-visible modal-window ${this.hideModalTexts ? '' : 'large-modal'} ${this.hideModalBoxShadow ? 'noBoxShadow' : ''}`, style: {
231
+ width: (this.modalWidth - 2).toString() + 'px',
232
+ height: this.modalHeight ? ((_a = (this.modalHeight - 2)) === null || _a === void 0 ? void 0 : _a.toString()) + 'px' : '',
233
+ backgroundColor: ((_b = this === null || this === void 0 ? void 0 : this.qrStyle) === null || _b === void 0 ? void 0 : _b.bgColor) ? (_c = this === null || this === void 0 ? void 0 : this.qrStyle) === null || _c === void 0 ? void 0 : _c.bgColor : 'white',
234
+ boxShadow: ((_d = this === null || this === void 0 ? void 0 : this.qrStyle) === null || _d === void 0 ? void 0 : _d.boxShadow) ? (_e = this === null || this === void 0 ? void 0 : this.qrStyle) === null || _e === void 0 ? void 0 : _e.boxShadow : '0px 3px 10px rgba(48, 48, 48, 0.1);'
235
+ }, onClick: (event) => {
236
+ event.stopPropagation();
237
+ } }, h("div", { class: "modal-window__content" }, h("div", { class: `qrTitleContainer ${this.hideModalTexts ? 'hidenText' : ''}` }, h("p", { class: "qrTitle modalText", style: { color: this.modalTitleColor || '#1e1e20' } }, this.qrModalTitle), !this.hideBrandTitle && (h("p", { class: "qrBrand modalText" }, this.byBrandLabel, ' ', h("span", null, h("img", { src: logoGataca })))), this.result !== RESULT_STATUS.SUCCESS && !this.hideQrModalDescription && h("p", { class: "qrDescription modalText" }, this.qrModalDescription)), h("div", { class: "qrSection", style: {
238
+ width: this.modalWidth.toString() + 'px',
239
+ height: this.modalWidth ? ((_f = this.modalWidth) === null || _f === void 0 ? void 0 : _f.toString()) + 'px' : ''
240
+ } }, this.renderQRSection())))));
241
+ }
242
+ static get is() { return "gataca-qr"; }
243
+ static get encapsulation() { return "shadow"; }
244
+ static get originalStyleUrls() {
245
+ return {
246
+ "$": ["gataca-qr.scss"]
247
+ };
248
+ }
249
+ static get styleUrls() {
250
+ return {
251
+ "$": ["gataca-qr.css"]
252
+ };
253
+ }
254
+ static get properties() {
255
+ return {
256
+ "checkStatus": {
257
+ "type": "unknown",
258
+ "mutable": false,
259
+ "complexType": {
260
+ "original": "(id?: string) => Promise<{result: RESULT_STATUS; data?: any}>",
261
+ "resolved": "(id?: string) => Promise<{ result: RESULT_STATUS; data?: any; }>",
262
+ "references": {
263
+ "Promise": {
264
+ "location": "global"
265
+ },
266
+ "RESULT_STATUS": {
267
+ "location": "import",
268
+ "path": "../../utils/utils"
269
+ }
270
+ }
271
+ },
272
+ "required": false,
273
+ "optional": true,
274
+ "docs": {
275
+ "tags": [],
276
+ "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."
277
+ },
278
+ "defaultValue": "undefined"
279
+ },
280
+ "createSession": {
281
+ "type": "unknown",
282
+ "mutable": false,
283
+ "complexType": {
284
+ "original": "() => Promise<{\n sessionId: string;\n authenticationRequest?: string;\n }>",
285
+ "resolved": "() => Promise<{ sessionId: string; authenticationRequest?: string; }>",
286
+ "references": {
287
+ "Promise": {
288
+ "location": "global"
289
+ }
290
+ }
291
+ },
292
+ "required": false,
293
+ "optional": true,
294
+ "docs": {
295
+ "tags": [],
296
+ "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"
297
+ },
298
+ "defaultValue": "undefined"
299
+ },
300
+ "successCallback": {
301
+ "type": "unknown",
302
+ "mutable": false,
303
+ "complexType": {
304
+ "original": "(data?: any) => void",
305
+ "resolved": "(data?: any) => void",
306
+ "references": {}
307
+ },
308
+ "required": false,
309
+ "optional": false,
310
+ "docs": {
311
+ "tags": [],
312
+ "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"
313
+ },
314
+ "defaultValue": "undefined"
315
+ },
316
+ "errorCallback": {
317
+ "type": "unknown",
318
+ "mutable": false,
319
+ "complexType": {
320
+ "original": "(error?: Error) => void",
321
+ "resolved": "(error?: Error) => void",
322
+ "references": {
323
+ "Error": {
324
+ "location": "global"
325
+ }
326
+ }
327
+ },
328
+ "required": false,
329
+ "optional": false,
330
+ "docs": {
331
+ "tags": [],
332
+ "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"
333
+ },
334
+ "defaultValue": "undefined"
335
+ },
336
+ "qrRole": {
337
+ "type": "string",
338
+ "mutable": false,
339
+ "complexType": {
340
+ "original": "string",
341
+ "resolved": "string",
342
+ "references": {}
343
+ },
344
+ "required": false,
345
+ "optional": false,
346
+ "docs": {
347
+ "tags": [],
348
+ "text": "***Mandatory just for V1***\nDecide if scanning the credential as a verifier to request credentials\nor as an issuer too issue credentials.\nOptions: connect | certify"
349
+ },
350
+ "attribute": "qr-role",
351
+ "reflect": false
352
+ },
353
+ "qrType": {
354
+ "type": "string",
355
+ "mutable": false,
356
+ "complexType": {
357
+ "original": "DrawType",
358
+ "resolved": "\"canvas\" | \"svg\"",
359
+ "references": {
360
+ "DrawType": {
361
+ "location": "import",
362
+ "path": "qr-code-styling"
363
+ }
364
+ }
365
+ },
366
+ "required": false,
367
+ "optional": true,
368
+ "docs": {
369
+ "tags": [],
370
+ "text": "_[Optional]_\nSets the qr type. It can be \"svg\" or \"canvas\". \"svg\" by default."
371
+ },
372
+ "attribute": "qr-type",
373
+ "reflect": false,
374
+ "defaultValue": "'svg'"
375
+ },
376
+ "callbackServer": {
377
+ "type": "string",
378
+ "mutable": false,
379
+ "complexType": {
380
+ "original": "string",
381
+ "resolved": "string",
382
+ "references": {}
383
+ },
384
+ "required": false,
385
+ "optional": false,
386
+ "docs": {
387
+ "tags": [],
388
+ "text": "***Mandatory just for V1***\nConnect/Certify Server where the wallet will send the data"
389
+ },
390
+ "attribute": "callback-server",
391
+ "reflect": false
392
+ },
393
+ "autostart": {
394
+ "type": "boolean",
395
+ "mutable": false,
396
+ "complexType": {
397
+ "original": "boolean",
398
+ "resolved": "boolean",
399
+ "references": {}
400
+ },
401
+ "required": false,
402
+ "optional": false,
403
+ "docs": {
404
+ "tags": [],
405
+ "text": "_[Optional]_\nSet to enable autoload when the QR is displayed. By default it is true"
406
+ },
407
+ "attribute": "autostart",
408
+ "reflect": false,
409
+ "defaultValue": "true"
410
+ },
411
+ "autorefresh": {
412
+ "type": "boolean",
413
+ "mutable": false,
414
+ "complexType": {
415
+ "original": "boolean",
416
+ "resolved": "boolean",
417
+ "references": {}
418
+ },
419
+ "required": false,
420
+ "optional": false,
421
+ "docs": {
422
+ "tags": [],
423
+ "text": "_[Optional]_\nSet to refresh the session automatically upon expiration. By default it is false"
424
+ },
425
+ "attribute": "autorefresh",
426
+ "reflect": false,
427
+ "defaultValue": "false"
428
+ },
429
+ "v": {
430
+ "type": "string",
431
+ "mutable": false,
432
+ "complexType": {
433
+ "original": "string",
434
+ "resolved": "string",
435
+ "references": {}
436
+ },
437
+ "required": false,
438
+ "optional": true,
439
+ "docs": {
440
+ "tags": [],
441
+ "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"
442
+ },
443
+ "attribute": "v",
444
+ "reflect": false,
445
+ "defaultValue": "'3'"
446
+ },
447
+ "qrModalTitle": {
448
+ "type": "string",
449
+ "mutable": false,
450
+ "complexType": {
451
+ "original": "string",
452
+ "resolved": "string",
453
+ "references": {}
454
+ },
455
+ "required": false,
456
+ "optional": true,
457
+ "docs": {
458
+ "tags": [],
459
+ "text": "_[Optional]_\nModifies the qr headline title"
460
+ },
461
+ "attribute": "qr-modal-title",
462
+ "reflect": false,
463
+ "defaultValue": "'Quick Access'"
464
+ },
465
+ "modalTitleColor": {
466
+ "type": "string",
467
+ "mutable": false,
468
+ "complexType": {
469
+ "original": "string",
470
+ "resolved": "string",
471
+ "references": {}
472
+ },
473
+ "required": false,
474
+ "optional": true,
475
+ "docs": {
476
+ "tags": [],
477
+ "text": "_[Optional]_\nString to set Modal title color"
478
+ },
479
+ "attribute": "modal-title-color",
480
+ "reflect": false,
481
+ "defaultValue": "'#4745B7'"
482
+ },
483
+ "qrModalDescription": {
484
+ "type": "string",
485
+ "mutable": false,
486
+ "complexType": {
487
+ "original": "string",
488
+ "resolved": "string",
489
+ "references": {}
490
+ },
491
+ "required": false,
492
+ "optional": true,
493
+ "docs": {
494
+ "tags": [],
495
+ "text": "_[Optional]_\nModifies the Modal description"
496
+ },
497
+ "attribute": "qr-modal-description",
498
+ "reflect": false,
499
+ "defaultValue": "'Sign up or sign in by scanning the QR Code with the Gataca Wallet'"
500
+ },
501
+ "hideModalTexts": {
502
+ "type": "boolean",
503
+ "mutable": false,
504
+ "complexType": {
505
+ "original": "boolean",
506
+ "resolved": "boolean",
507
+ "references": {}
508
+ },
509
+ "required": false,
510
+ "optional": true,
511
+ "docs": {
512
+ "tags": [],
513
+ "text": "_[Optional]_\nBoolean to show or not show the modal title, brandTitle and description"
514
+ },
515
+ "attribute": "hide-modal-texts",
516
+ "reflect": false,
517
+ "defaultValue": "false"
518
+ },
519
+ "hideModalBoxShadow": {
520
+ "type": "boolean",
521
+ "mutable": false,
522
+ "complexType": {
523
+ "original": "boolean",
524
+ "resolved": "boolean",
525
+ "references": {}
526
+ },
527
+ "required": false,
528
+ "optional": true,
529
+ "docs": {
530
+ "tags": [],
531
+ "text": "_[Optional]_\nBoolean to show or not show the modal title, brandTitle and description"
532
+ },
533
+ "attribute": "hide-modal-box-shadow",
534
+ "reflect": false,
535
+ "defaultValue": "false"
536
+ },
537
+ "hideBrandTitle": {
538
+ "type": "boolean",
539
+ "mutable": false,
540
+ "complexType": {
541
+ "original": "boolean",
542
+ "resolved": "boolean",
543
+ "references": {}
544
+ },
545
+ "required": false,
546
+ "optional": true,
547
+ "docs": {
548
+ "tags": [],
549
+ "text": "_[Optional]_\nBoolean to show or not show the gataca brand title"
550
+ },
551
+ "attribute": "hide-brand-title",
552
+ "reflect": false,
553
+ "defaultValue": "false"
554
+ },
555
+ "logoSize": {
556
+ "type": "number",
557
+ "mutable": false,
558
+ "complexType": {
559
+ "original": "number",
560
+ "resolved": "number",
561
+ "references": {}
562
+ },
563
+ "required": false,
564
+ "optional": true,
565
+ "docs": {
566
+ "tags": [],
567
+ "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"
568
+ },
569
+ "attribute": "logo-size",
570
+ "reflect": false,
571
+ "defaultValue": "0"
572
+ },
573
+ "logoSrc": {
574
+ "type": "string",
575
+ "mutable": false,
576
+ "complexType": {
577
+ "original": "string",
578
+ "resolved": "string",
579
+ "references": {}
580
+ },
581
+ "required": false,
582
+ "optional": true,
583
+ "docs": {
584
+ "tags": [],
585
+ "text": "_[Optional]_\nLogo to display, just if the logo size is greater than 0. No logo is the GATACA logo."
586
+ },
587
+ "attribute": "logo-src",
588
+ "reflect": false,
589
+ "defaultValue": "logoGataca"
590
+ },
591
+ "qrSize": {
592
+ "type": "number",
593
+ "mutable": false,
594
+ "complexType": {
595
+ "original": "number",
596
+ "resolved": "number",
597
+ "references": {}
598
+ },
599
+ "required": false,
600
+ "optional": true,
601
+ "docs": {
602
+ "tags": [],
603
+ "text": "_[Optional]_\nSize of QR Displayed"
604
+ },
605
+ "attribute": "qr-size",
606
+ "reflect": false,
607
+ "defaultValue": "300"
608
+ },
609
+ "modalWidth": {
610
+ "type": "number",
611
+ "mutable": false,
612
+ "complexType": {
613
+ "original": "number",
614
+ "resolved": "number",
615
+ "references": {}
616
+ },
617
+ "required": false,
618
+ "optional": true,
619
+ "docs": {
620
+ "tags": [],
621
+ "text": "_[Optional]_\nWidth of the modal"
622
+ },
623
+ "attribute": "modal-width",
624
+ "reflect": false,
625
+ "defaultValue": "300"
626
+ },
627
+ "modalHeight": {
628
+ "type": "number",
629
+ "mutable": false,
630
+ "complexType": {
631
+ "original": "number",
632
+ "resolved": "number",
633
+ "references": {}
634
+ },
635
+ "required": false,
636
+ "optional": true,
637
+ "docs": {
638
+ "tags": [],
639
+ "text": "_[Optional]_\nHeight of the modal"
640
+ },
641
+ "attribute": "modal-height",
642
+ "reflect": false
643
+ },
644
+ "qrCodeExpiredLabel": {
645
+ "type": "string",
646
+ "mutable": false,
647
+ "complexType": {
648
+ "original": "string",
649
+ "resolved": "string",
650
+ "references": {}
651
+ },
652
+ "required": false,
653
+ "optional": true,
654
+ "docs": {
655
+ "tags": [],
656
+ "text": "_[Optional]_\nString to show when qr code expired"
657
+ },
658
+ "attribute": "qr-code-expired-label",
659
+ "reflect": false,
660
+ "defaultValue": "'QR Code expired'"
661
+ },
662
+ "credentialsNotValidatedLabel": {
663
+ "type": "string",
664
+ "mutable": false,
665
+ "complexType": {
666
+ "original": "string",
667
+ "resolved": "string",
668
+ "references": {}
669
+ },
670
+ "required": false,
671
+ "optional": true,
672
+ "docs": {
673
+ "tags": [],
674
+ "text": "_[Optional]_\nString to show when credentials not validatedd"
675
+ },
676
+ "attribute": "credentials-not-validated-label",
677
+ "reflect": false,
678
+ "defaultValue": "'User credentials not validated'"
679
+ },
680
+ "clickInsideBoxLabel": {
681
+ "type": "string",
682
+ "mutable": false,
683
+ "complexType": {
684
+ "original": "string",
685
+ "resolved": "string",
686
+ "references": {}
687
+ },
688
+ "required": false,
689
+ "optional": true,
690
+ "docs": {
691
+ "tags": [],
692
+ "text": "_[Optional]_\nString to show \"click inside\" label"
693
+ },
694
+ "attribute": "click-inside-box-label",
695
+ "reflect": false,
696
+ "defaultValue": "'Click inside the box to'"
697
+ },
698
+ "refreshQrLabel": {
699
+ "type": "string",
700
+ "mutable": false,
701
+ "complexType": {
702
+ "original": "string",
703
+ "resolved": "string",
704
+ "references": {}
705
+ },
706
+ "required": false,
707
+ "optional": true,
708
+ "docs": {
709
+ "tags": [],
710
+ "text": "_[Optional]_\nString to show \"refresh QR\" label"
711
+ },
712
+ "attribute": "refresh-qr-label",
713
+ "reflect": false,
714
+ "defaultValue": "'Refresh QR Code'"
715
+ },
716
+ "scanQrLabel": {
717
+ "type": "string",
718
+ "mutable": false,
719
+ "complexType": {
720
+ "original": "string",
721
+ "resolved": "string",
722
+ "references": {}
723
+ },
724
+ "required": false,
725
+ "optional": true,
726
+ "docs": {
727
+ "tags": [],
728
+ "text": "_[Optional]_\nString to show \"scan QR\" label"
729
+ },
730
+ "attribute": "scan-qr-label",
731
+ "reflect": false,
732
+ "defaultValue": "'Scan QR Code'"
733
+ },
734
+ "userNotScanInTimeErrorLabel": {
735
+ "type": "string",
736
+ "mutable": false,
737
+ "complexType": {
738
+ "original": "string",
739
+ "resolved": "string",
740
+ "references": {}
741
+ },
742
+ "required": false,
743
+ "optional": true,
744
+ "docs": {
745
+ "tags": [],
746
+ "text": "_[Optional]_\nString to show \"user not scan in time\" error"
747
+ },
748
+ "attribute": "user-not-scan-in-time-error-label",
749
+ "reflect": false,
750
+ "defaultValue": "'User did not scan the QR in the allowed time'"
751
+ },
752
+ "credsNotValidatedErrorLabel": {
753
+ "type": "string",
754
+ "mutable": false,
755
+ "complexType": {
756
+ "original": "string",
757
+ "resolved": "string",
758
+ "references": {}
759
+ },
760
+ "required": false,
761
+ "optional": true,
762
+ "docs": {
763
+ "tags": [],
764
+ "text": "_[Optional]_\nString to show \"provided credentials not validates\" error"
765
+ },
766
+ "attribute": "creds-not-validated-error-label",
767
+ "reflect": false,
768
+ "defaultValue": "\"Provided user credentials couldn't be validated\""
769
+ },
770
+ "failedLoginErrorLabel": {
771
+ "type": "string",
772
+ "mutable": false,
773
+ "complexType": {
774
+ "original": "string",
775
+ "resolved": "string",
776
+ "references": {}
777
+ },
778
+ "required": false,
779
+ "optional": true,
780
+ "docs": {
781
+ "tags": [],
782
+ "text": "_[Optional]_\nString to show \"failed login\" error"
783
+ },
784
+ "attribute": "failed-login-error-label",
785
+ "reflect": false,
786
+ "defaultValue": "'No successful login'"
787
+ },
788
+ "successLoginLabel": {
789
+ "type": "string",
790
+ "mutable": false,
791
+ "complexType": {
792
+ "original": "string",
793
+ "resolved": "string",
794
+ "references": {}
795
+ },
796
+ "required": false,
797
+ "optional": true,
798
+ "docs": {
799
+ "tags": [],
800
+ "text": "_[Optional]_\nString to show \"successful login\" label"
801
+ },
802
+ "attribute": "success-login-label",
803
+ "reflect": false,
804
+ "defaultValue": "'Successful Connection!'"
805
+ },
806
+ "byBrandLabel": {
807
+ "type": "string",
808
+ "mutable": false,
809
+ "complexType": {
810
+ "original": "string",
811
+ "resolved": "string",
812
+ "references": {}
813
+ },
814
+ "required": false,
815
+ "optional": true,
816
+ "docs": {
817
+ "tags": [],
818
+ "text": "_[Optional]_\nString to show \"by brand\" label"
819
+ },
820
+ "attribute": "by-brand-label",
821
+ "reflect": false,
822
+ "defaultValue": "'by Gataca'"
823
+ },
824
+ "waitingStartSessionLabel": {
825
+ "type": "string",
826
+ "mutable": false,
827
+ "complexType": {
828
+ "original": "string",
829
+ "resolved": "string",
830
+ "references": {}
831
+ },
832
+ "required": false,
833
+ "optional": true,
834
+ "docs": {
835
+ "tags": [],
836
+ "text": "_[Optional]_\nString to show \"waiting start session\" label"
837
+ },
838
+ "attribute": "waiting-start-session-label",
839
+ "reflect": false,
840
+ "defaultValue": "'waiting to start a session'"
841
+ },
842
+ "readQrTitle": {
843
+ "type": "string",
844
+ "mutable": false,
845
+ "complexType": {
846
+ "original": "string",
847
+ "resolved": "string",
848
+ "references": {}
849
+ },
850
+ "required": false,
851
+ "optional": true,
852
+ "docs": {
853
+ "tags": [],
854
+ "text": "_[Optional]_\nString title to show when QR already read"
855
+ },
856
+ "attribute": "read-qr-title",
857
+ "reflect": false,
858
+ "defaultValue": "'Processing...'"
859
+ },
860
+ "readQrDescription": {
861
+ "type": "string",
862
+ "mutable": false,
863
+ "complexType": {
864
+ "original": "string",
865
+ "resolved": "string",
866
+ "references": {}
867
+ },
868
+ "required": false,
869
+ "optional": true,
870
+ "docs": {
871
+ "tags": [],
872
+ "text": "_[Optional]_\nString description to show when QR already read"
873
+ },
874
+ "attribute": "read-qr-description",
875
+ "reflect": false,
876
+ "defaultValue": "'Please wait a moment'"
877
+ },
878
+ "hideQrModalDescription": {
879
+ "type": "boolean",
880
+ "mutable": false,
881
+ "complexType": {
882
+ "original": "boolean",
883
+ "resolved": "boolean",
884
+ "references": {}
885
+ },
886
+ "required": false,
887
+ "optional": true,
888
+ "docs": {
889
+ "tags": [],
890
+ "text": "_[Optional]_\nBoolean to show or not show the QR Modal description"
891
+ },
892
+ "attribute": "hide-qr-modal-description",
893
+ "reflect": false,
894
+ "defaultValue": "false"
895
+ },
896
+ "sessionTimeout": {
897
+ "type": "number",
898
+ "mutable": false,
899
+ "complexType": {
900
+ "original": "number",
901
+ "resolved": "number",
902
+ "references": {}
903
+ },
904
+ "required": false,
905
+ "optional": true,
906
+ "docs": {
907
+ "tags": [],
908
+ "text": "_[Optional]_\nMaximum time window to display the session"
909
+ },
910
+ "attribute": "session-timeout",
911
+ "reflect": false,
912
+ "defaultValue": "DEFAULT_SESSION_TIMEOUT"
913
+ },
914
+ "pollingFrequency": {
915
+ "type": "number",
916
+ "mutable": false,
917
+ "complexType": {
918
+ "original": "number",
919
+ "resolved": "number",
920
+ "references": {}
921
+ },
922
+ "required": false,
923
+ "optional": true,
924
+ "docs": {
925
+ "tags": [],
926
+ "text": "_[Optional]_\nFrequency in seconds to check if the session has been validated"
927
+ },
928
+ "attribute": "polling-frequency",
929
+ "reflect": false,
930
+ "defaultValue": "DEFAULT_POLLING_FREQ"
931
+ },
932
+ "dynamicLink": {
933
+ "type": "boolean",
934
+ "mutable": false,
935
+ "complexType": {
936
+ "original": "boolean",
937
+ "resolved": "boolean",
938
+ "references": {}
939
+ },
940
+ "required": false,
941
+ "optional": true,
942
+ "docs": {
943
+ "tags": [],
944
+ "text": "_[Optional]_\nDisplay a link containing a dynamic link to invoke the wallet if closed"
945
+ },
946
+ "attribute": "dynamic-link",
947
+ "reflect": false,
948
+ "defaultValue": "true"
949
+ },
950
+ "qrStyle": {
951
+ "type": "unknown",
952
+ "mutable": false,
953
+ "complexType": {
954
+ "original": "qrStyle",
955
+ "resolved": "{ color: string; bgColor: string; alertBgColor?: string; alertBorderColor?: string; boxShadow?: string; }",
956
+ "references": {
957
+ "qrStyle": {
958
+ "location": "local"
959
+ }
960
+ }
961
+ },
962
+ "required": false,
963
+ "optional": true,
964
+ "docs": {
965
+ "tags": [],
966
+ "text": "_[Optional]_\nAdjust the color styles of the QR"
967
+ }
968
+ }
969
+ };
970
+ }
971
+ static get states() {
972
+ return {
973
+ "sessionId": {},
974
+ "authenticationRequest": {},
975
+ "sessionData": {},
976
+ "result": {},
977
+ "qrHref": {}
978
+ };
979
+ }
980
+ static get events() {
981
+ return [{
982
+ "method": "gatacaLoginCompleted",
983
+ "name": "gatacaLoginCompleted",
984
+ "bubbles": true,
985
+ "cancelable": true,
986
+ "composed": true,
987
+ "docs": {
988
+ "tags": [],
989
+ "text": "GatacaLoginCompleted event, triggered with session data upon login success"
990
+ },
991
+ "complexType": {
992
+ "original": "any",
993
+ "resolved": "any",
994
+ "references": {}
995
+ }
996
+ }, {
997
+ "method": "gatacaLoginFailed",
998
+ "name": "gatacaLoginFailed",
999
+ "bubbles": true,
1000
+ "cancelable": true,
1001
+ "composed": true,
1002
+ "docs": {
1003
+ "tags": [],
1004
+ "text": "GatacaLoginFailed event, triggered with error upon login failure"
1005
+ },
1006
+ "complexType": {
1007
+ "original": "any",
1008
+ "resolved": "any",
1009
+ "references": {}
1010
+ }
1011
+ }];
1012
+ }
1013
+ static get methods() {
1014
+ return {
1015
+ "display": {
1016
+ "complexType": {
1017
+ "signature": "() => Promise<void>",
1018
+ "parameters": [],
1019
+ "references": {
1020
+ "Promise": {
1021
+ "location": "global"
1022
+ },
1023
+ "RESULT_STATUS": {
1024
+ "location": "import",
1025
+ "path": "../../utils/utils"
1026
+ }
1027
+ },
1028
+ "return": "Promise<void>"
1029
+ },
1030
+ "docs": {
1031
+ "text": "Force manually the display of a QR",
1032
+ "tags": []
1033
+ }
1034
+ },
1035
+ "stop": {
1036
+ "complexType": {
1037
+ "signature": "() => Promise<void>",
1038
+ "parameters": [],
1039
+ "references": {
1040
+ "Promise": {
1041
+ "location": "global"
1042
+ }
1043
+ },
1044
+ "return": "Promise<void>"
1045
+ },
1046
+ "docs": {
1047
+ "text": "Stop manually an ongoing session",
1048
+ "tags": []
1049
+ }
1050
+ },
1051
+ "getSessionData": {
1052
+ "complexType": {
1053
+ "signature": "() => Promise<any>",
1054
+ "parameters": [],
1055
+ "references": {
1056
+ "Promise": {
1057
+ "location": "global"
1058
+ }
1059
+ },
1060
+ "return": "Promise<any>"
1061
+ },
1062
+ "docs": {
1063
+ "text": "Retrieve manually the session data on a successful login",
1064
+ "tags": []
1065
+ }
1066
+ }
1067
+ };
1068
+ }
1069
+ }