@gataca/qr 0.0.20 → 0.0.21

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/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/{esm/gat-icon-alert-7b06ef3a.js → gatacaqr/gat-icon-alert-13a1894e.js} +1 -3
  5. package/dist/{esm → gatacaqr}/gataca-autoqr.entry.js +1 -1
  6. package/dist/{esm/gataca-qr_2.entry.js → gatacaqr/gataca-qr.entry.js} +14 -78
  7. package/dist/gatacaqr/gataca-qrdisplay-55780157.js +97 -0
  8. package/dist/gatacaqr/gataca-qrdisplay.entry.js +2 -0
  9. package/dist/{esm → gatacaqr}/gataca-qrws.entry.js +3 -3
  10. package/dist/{components/gataca-ssibutton2.js → gatacaqr/gataca-ssibutton.entry.js} +10 -84
  11. package/dist/{components/gataca-ssibuttonws2.js → gatacaqr/gataca-ssibuttonws.entry.js} +7 -53
  12. package/dist/gatacaqr/gatacaqr.esm.js +129 -1
  13. package/dist/gatacaqr/index-4bc6f36b.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-qr/components/qr/QR.d.ts +0 -1
  17. package/dist/types/components/gataca-qr/gataca-qr.d.ts +0 -5
  18. package/dist/types/components/gataca-qrdisplay/gataca-qrdisplay.d.ts +0 -5
  19. package/dist/types/components/gataca-ssibutton/gataca-ssibutton.d.ts +0 -5
  20. package/dist/types/components.d.ts +0 -24
  21. package/package.json +1 -1
  22. package/dist/cjs/gat-icon-alert-0ad19b26.js +0 -14
  23. package/dist/cjs/gataca-autoqr.cjs.entry.js +0 -105
  24. package/dist/cjs/gataca-qr_2.cjs.entry.js +0 -318
  25. package/dist/cjs/gataca-qrws.cjs.entry.js +0 -252
  26. package/dist/cjs/gataca-ssibutton_2.cjs.entry.js +0 -320
  27. package/dist/cjs/gatacaqr.cjs.js +0 -19
  28. package/dist/cjs/index-8638645b.js +0 -1482
  29. package/dist/cjs/index.cjs.js +0 -16
  30. package/dist/cjs/loader.cjs.js +0 -21
  31. package/dist/cjs/qr-code-styling-412bbc7a.js +0 -28
  32. package/dist/cjs/utils-ef28b844.js +0 -27
  33. package/dist/collection/assets/icons/gat-icon-alert.svg +0 -5
  34. package/dist/collection/assets/icons/gat-icon-check.svg +0 -5
  35. package/dist/collection/assets/icons/gat-icon-refresh.svg +0 -4
  36. package/dist/collection/assets/images/logo_gataca.svg +0 -7
  37. package/dist/collection/collection-manifest.json +0 -17
  38. package/dist/collection/components/gataca-autoqr/gataca-autoqr.css +0 -116
  39. package/dist/collection/components/gataca-autoqr/gataca-autoqr.js +0 -323
  40. package/dist/collection/components/gataca-qr/components/qr/QR.js +0 -5
  41. package/dist/collection/components/gataca-qr/components/readQR/ReadQR.js +0 -11
  42. package/dist/collection/components/gataca-qr/components/readQR/components/AnimatedLoader.js +0 -4
  43. package/dist/collection/components/gataca-qr/components/retryButton/RetryButton.js +0 -13
  44. package/dist/collection/components/gataca-qr/components/success/Success.js +0 -8
  45. package/dist/collection/components/gataca-qr/gataca-qr.css +0 -399
  46. package/dist/collection/components/gataca-qr/gataca-qr.js +0 -1001
  47. package/dist/collection/components/gataca-qrdisplay/gataca-qrdisplay.js +0 -176
  48. package/dist/collection/components/gataca-qrws/components/qr/QR.js +0 -5
  49. package/dist/collection/components/gataca-qrws/components/readQR/ReadQR.js +0 -11
  50. package/dist/collection/components/gataca-qrws/components/readQR/components/AnimatedLoader.js +0 -4
  51. package/dist/collection/components/gataca-qrws/components/retryButton/RetryButton.js +0 -13
  52. package/dist/collection/components/gataca-qrws/components/success/Success.js +0 -8
  53. package/dist/collection/components/gataca-qrws/gataca-qrws.css +0 -400
  54. package/dist/collection/components/gataca-qrws/gataca-qrws.js +0 -974
  55. package/dist/collection/components/gataca-ssibutton/gataca-ssibutton.css +0 -116
  56. package/dist/collection/components/gataca-ssibutton/gataca-ssibutton.js +0 -979
  57. package/dist/collection/components/gataca-ssibuttonws/gataca-ssibuttonws.css +0 -116
  58. package/dist/collection/components/gataca-ssibuttonws/gataca-ssibuttonws.js +0 -410
  59. package/dist/collection/index.js +0 -2
  60. package/dist/collection/utils/index.js +0 -1
  61. package/dist/collection/utils/utils.js +0 -22
  62. package/dist/components/gat-icon-alert.js +0 -30
  63. package/dist/components/gataca-autoqr.js +0 -161
  64. package/dist/components/gataca-qr.js +0 -6
  65. package/dist/components/gataca-qr2.js +0 -329
  66. package/dist/components/gataca-qrdisplay.js +0 -6
  67. package/dist/components/gataca-qrdisplay2.js +0 -99
  68. package/dist/components/gataca-qrws.js +0 -6
  69. package/dist/components/gataca-qrws2.js +0 -310
  70. package/dist/components/gataca-ssibutton.js +0 -6
  71. package/dist/components/gataca-ssibuttonws.js +0 -6
  72. package/dist/components/index.js +0 -8
  73. package/dist/esm/gataca-ssibutton_2.entry.js +0 -315
  74. package/dist/esm/gatacaqr.js +0 -17
  75. package/dist/esm/index-af2994f7.js +0 -1455
  76. package/dist/esm/index.js +0 -1
  77. package/dist/esm/loader.js +0 -17
  78. package/dist/esm/polyfills/core-js.js +0 -11
  79. package/dist/esm/polyfills/css-shim.js +0 -1
  80. package/dist/esm/polyfills/dom.js +0 -79
  81. package/dist/esm/polyfills/es5-html-element.js +0 -1
  82. package/dist/esm/polyfills/index.js +0 -34
  83. package/dist/esm/polyfills/system.js +0 -6
  84. package/dist/esm/qr-code-styling-0eeb38d5.js +0 -26
  85. package/dist/gatacaqr/p-0be4566d.js +0 -1
  86. package/dist/gatacaqr/p-2cd7b062.js +0 -1
  87. package/dist/gatacaqr/p-3ca3bb1a.entry.js +0 -1
  88. package/dist/gatacaqr/p-49424123.entry.js +0 -1
  89. package/dist/gatacaqr/p-88af482f.entry.js +0 -1
  90. package/dist/gatacaqr/p-ba0417e2.js +0 -2
  91. package/dist/gatacaqr/p-d59ae0ab.entry.js +0 -1
  92. package/dist/gatacaqr/p-ea783014.js +0 -1
  93. package/dist/index.cjs.js +0 -1
  94. package/dist/index.js +0 -1
  95. /package/dist/{esm → gatacaqr}/utils-63e7a33b.js +0 -0
@@ -1,979 +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.qrId = undefined;
11
- this.buttonText = "Easy login";
12
- this.autostart = true;
13
- this.checkStatus = undefined;
14
- this.createSession = undefined;
15
- this.successCallback = undefined;
16
- this.errorCallback = undefined;
17
- this.handleCheckAppLoading = undefined;
18
- this.checkAppTimeout = 6;
19
- this.qrRole = undefined;
20
- this.callbackServer = undefined;
21
- this.sessionTimeout = undefined;
22
- this.pollingFrequency = undefined;
23
- this.autorefresh = false;
24
- this.v = "3";
25
- this.qrModalTitle = "Quick Access";
26
- this.modalTitleColor = "#4745B7";
27
- this.qrModalDescription = "Sign up or sign in by scanning the QR Code with the Gataca Wallet";
28
- this.hideBrandTitle = false;
29
- this.dynamicLink = true;
30
- this.logoSize = 0;
31
- this.logoSrc = undefined;
32
- this.qrCodeExpiredLabel = "QR Code expired";
33
- this.credentialsNotValidatedLabel = "User credentials not validated";
34
- this.clickInsideBoxLabel = "Click inside the box to";
35
- this.refreshQrLabel = "Refresh QR Code";
36
- this.scanQrLabel = "Scan QR Code";
37
- this.userNotScanInTimeErrorLabel = "User did not scan the QR in the allowed time";
38
- this.credsNotValidatedErrorLabel = "Provided user credentials couldn't be validated";
39
- this.failedLoginErrorLabel = "No successful login";
40
- this.successLoginLabel = "Successful Connection!";
41
- this.byBrandLabel = "by Gataca";
42
- this.waitingStartSessionLabel = "waiting to start a session";
43
- this.hideQrModalDescription = false;
44
- this.open = false;
45
- this.sessionId = undefined;
46
- this.authenticationRequest = undefined;
47
- this.sessionData = undefined;
48
- this.result = RESULT_STATUS.NOT_STARTED;
49
- // console.log("qrId2", this.qrId);
50
- this.qr = (h("gataca-qr", { ref: (el) => (this.qrElement = el), qrId: this.qrId, checkStatus: this.checkStatus, createSession: this.createSession, successCallback: this.successCallback, errorCallback: this.errorCallback, qrRole: this.qrRole, 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 }));
51
- this.qr.qrId = this.qrId;
52
- }
53
- /**
54
- * Retrieve manually the session data on a successful login
55
- */
56
- async getSessionData() {
57
- return this.qr.getSessionData();
58
- }
59
- async getSessionId() {
60
- if (this.sessionId) {
61
- return this.sessionId;
62
- }
63
- let { sessionId, authenticationRequest } = await this.createSession();
64
- this.sessionId = sessionId;
65
- this.authenticationRequest = authenticationRequest;
66
- return this.sessionId;
67
- }
68
- /**
69
- * Force manually the start polling
70
- */
71
- async startMobilePolling() {
72
- await this.getSessionId();
73
- this.result = RESULT_STATUS.ONGOING;
74
- this.poll()
75
- .then((data) => {
76
- this.result = RESULT_STATUS.SUCCESS;
77
- this.sessionData = data;
78
- this.gatacaLoginCompleted.emit(data);
79
- this.successCallback(data);
80
- })
81
- .catch((err) => {
82
- this.clean();
83
- let expired = err === RESULT_STATUS.EXPIRED;
84
- if (expired && this.autorefresh) {
85
- this.startMobilePolling();
86
- }
87
- else {
88
- if (err !== RESULT_STATUS.NOT_STARTED) {
89
- let error = expired
90
- ? new Error(this.userNotScanInTimeErrorLabel)
91
- : new Error(this.credsNotValidatedErrorLabel);
92
- this.result = err;
93
- this.gatacaLoginFailed.emit(error);
94
- this.errorCallback(error);
95
- }
96
- }
97
- });
98
- }
99
- /**
100
- * Stop manually an ongoing session
101
- */
102
- async stop() {
103
- this.clean();
104
- if (this.result === RESULT_STATUS.ONGOING || RESULT_STATUS.READ) {
105
- this.result = RESULT_STATUS.NOT_STARTED;
106
- }
107
- }
108
- clean() {
109
- this.sessionData = undefined;
110
- this.sessionId = undefined;
111
- }
112
- renderModal() {
113
- return this.qr;
114
- }
115
- async poll() {
116
- let endTime = new Date().getTime() +
117
- (this.sessionTimeout || DEFAULT_SESSION_TIMEOUT) * 1000;
118
- let interval = (this.pollingFrequency || DEFAULT_POLLING_FREQ) * 1000;
119
- let checkFunc = async (component) => {
120
- if (component.result === RESULT_STATUS.NOT_STARTED) {
121
- return { result: RESULT_STATUS.NOT_STARTED };
122
- }
123
- let id = await component.getSessionId();
124
- return component.checkStatus(id);
125
- };
126
- let component = this;
127
- let checkCondition = async function (resolve, reject) {
128
- // If the condition is met, we're done!
129
- let { result, data } = await checkFunc(component);
130
- switch (result) {
131
- case RESULT_STATUS.SUCCESS:
132
- resolve(data);
133
- break;
134
- case RESULT_STATUS.READ:
135
- component.result = RESULT_STATUS.READ;
136
- case RESULT_STATUS.ONGOING:
137
- if (component.sessionTimeout > 0 && new Date().getTime() < endTime) {
138
- setTimeout(checkCondition, interval, resolve, reject);
139
- }
140
- else {
141
- reject(RESULT_STATUS.EXPIRED);
142
- }
143
- break;
144
- default:
145
- reject(result);
146
- break;
147
- }
148
- };
149
- return new Promise(checkCondition);
150
- }
151
- isAppInstalled(appScheme, callback) {
152
- let timeout;
153
- let detected = false;
154
- if (appScheme === null || appScheme === void 0 ? void 0 : appScheme.length) {
155
- window.location.href = appScheme;
156
- }
157
- const waitTimeToCheckApp = this.checkAppTimeout * 1000;
158
- timeout = setTimeout(() => {
159
- if (!detected) {
160
- callback(false);
161
- }
162
- cleanup();
163
- }, waitTimeToCheckApp);
164
- const handleVisibilityChange = () => {
165
- if (document.hidden) {
166
- detected = true;
167
- callback(true);
168
- if (!this.autostart) {
169
- this.startMobilePolling();
170
- }
171
- cleanup();
172
- }
173
- };
174
- document.addEventListener("visibilitychange", handleVisibilityChange);
175
- function cleanup() {
176
- clearTimeout(timeout);
177
- document.removeEventListener("visibilitychange", handleVisibilityChange);
178
- }
179
- }
180
- renderDesktopButton() {
181
- // console.log("this.qrId333", this.qrId);
182
- return (h("div", { class: "gatacaButtonWrapper" }, h("button", { class: "gatacaButton", onClick: () => {
183
- this.open = !this.open;
184
- setTimeout(() => {
185
- var _a, _b;
186
- this.qrElement.id = this.qrId;
187
- if (this.open) {
188
- (_a = this.qrElement) === null || _a === void 0 ? void 0 : _a.display();
189
- }
190
- else {
191
- (_b = this.qrElement) === null || _b === void 0 ? void 0 : _b.stop();
192
- }
193
- }, 0);
194
- } }, h("img", { src: PHONE_ICON, class: "buttonImg", alt: this.buttonText }), h("span", null, this.buttonText))));
195
- }
196
- async getAuthRequest() {
197
- let { authenticationRequest } = await this.createSession();
198
- return authenticationRequest;
199
- }
200
- renderMobileButton(isAndroid, isIos) {
201
- if (this.autostart) {
202
- this.startMobilePolling();
203
- }
204
- let loading = false;
205
- const handleLoading = (isLoading) => {
206
- loading = isLoading;
207
- if (this.handleCheckAppLoading) {
208
- this.handleCheckAppLoading(isLoading);
209
- }
210
- };
211
- const executeRedirection = async () => {
212
- handleLoading(true);
213
- const androidStoreLink = "https://play.google.com/store/apps/details?id=com.gataca.identity";
214
- const iosStoreLink = "https://apps.apple.com/us/app/gataca/id1498607616";
215
- try {
216
- const appScheme = await this.getAuthRequest();
217
- this.isAppInstalled(appScheme, (installed) => {
218
- if (!installed) {
219
- this.stop();
220
- if (isAndroid) {
221
- window.location.href = androidStoreLink;
222
- }
223
- else if (isIos) {
224
- window.location.href = iosStoreLink;
225
- }
226
- }
227
- handleLoading(false);
228
- });
229
- }
230
- catch (error) {
231
- this.stop();
232
- handleLoading(false);
233
- }
234
- };
235
- return (h("div", { class: "gatacaButtonWrapper" }, h("button", { class: "gatacaButton", onClick: () => {
236
- executeRedirection();
237
- }, disabled: loading }, h("img", { src: PHONE_ICON, class: "buttonImg", alt: this.buttonText }), h("span", null, this.buttonText))));
238
- }
239
- render() {
240
- const userAgent =
241
- // @ts-ignore
242
- (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);
243
- const isAndroid = /android/i.test(userAgent);
244
- const isIos =
245
- // @ts-ignore
246
- (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) ||
247
- (navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1);
248
- const isMobile = isAndroid || isIos;
249
- return (h("div", { class: "buttonContainer" }, isMobile && this.v === "3"
250
- ? this.renderMobileButton(isAndroid, isIos)
251
- : this.renderDesktopButton(), this.open && (!isMobile || this.v === "3") && this.renderModal()));
252
- }
253
- static get is() { return "gataca-ssibutton"; }
254
- static get encapsulation() { return "shadow"; }
255
- static get originalStyleUrls() {
256
- return {
257
- "$": ["gataca-ssibutton.scss"]
258
- };
259
- }
260
- static get styleUrls() {
261
- return {
262
- "$": ["gataca-ssibutton.css"]
263
- };
264
- }
265
- static get properties() {
266
- return {
267
- "qrId": {
268
- "type": "string",
269
- "mutable": false,
270
- "complexType": {
271
- "original": "string",
272
- "resolved": "string",
273
- "references": {}
274
- },
275
- "required": false,
276
- "optional": true,
277
- "docs": {
278
- "tags": [],
279
- "text": "_[Optional]_\nUnique identificator for html tag"
280
- },
281
- "attribute": "qr-id",
282
- "reflect": false
283
- },
284
- "buttonText": {
285
- "type": "string",
286
- "mutable": false,
287
- "complexType": {
288
- "original": "string",
289
- "resolved": "string",
290
- "references": {}
291
- },
292
- "required": false,
293
- "optional": true,
294
- "docs": {
295
- "tags": [],
296
- "text": "_[Optional]_\nIn the case of being a button, modifies its text"
297
- },
298
- "attribute": "button-text",
299
- "reflect": false,
300
- "defaultValue": "\"Easy login\""
301
- },
302
- "autostart": {
303
- "type": "boolean",
304
- "mutable": false,
305
- "complexType": {
306
- "original": "boolean",
307
- "resolved": "boolean",
308
- "references": {}
309
- },
310
- "required": false,
311
- "optional": false,
312
- "docs": {
313
- "tags": [],
314
- "text": "_[Optional]_\nSet to start polling when button or QR is displayed. By default it is true"
315
- },
316
- "attribute": "autostart",
317
- "reflect": false,
318
- "defaultValue": "true"
319
- },
320
- "checkStatus": {
321
- "type": "unknown",
322
- "mutable": false,
323
- "complexType": {
324
- "original": "(\n id?: string\n ) => Promise<{ result: RESULT_STATUS; data?: any }>",
325
- "resolved": "(id?: string) => Promise<{ result: RESULT_STATUS; data?: any; }>",
326
- "references": {
327
- "Promise": {
328
- "location": "global"
329
- },
330
- "RESULT_STATUS": {
331
- "location": "import",
332
- "path": "../../utils/utils"
333
- }
334
- }
335
- },
336
- "required": false,
337
- "optional": true,
338
- "docs": {
339
- "tags": [],
340
- "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."
341
- },
342
- "defaultValue": "undefined"
343
- },
344
- "createSession": {
345
- "type": "unknown",
346
- "mutable": false,
347
- "complexType": {
348
- "original": "() => Promise<{\n sessionId: string;\n authenticationRequest?: string;\n }>",
349
- "resolved": "() => Promise<{ sessionId: string; authenticationRequest?: string; }>",
350
- "references": {
351
- "Promise": {
352
- "location": "global"
353
- }
354
- }
355
- },
356
- "required": false,
357
- "optional": true,
358
- "docs": {
359
- "tags": [],
360
- "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"
361
- },
362
- "defaultValue": "undefined"
363
- },
364
- "successCallback": {
365
- "type": "unknown",
366
- "mutable": false,
367
- "complexType": {
368
- "original": "(data?: any) => void",
369
- "resolved": "(data?: any) => void",
370
- "references": {}
371
- },
372
- "required": false,
373
- "optional": false,
374
- "docs": {
375
- "tags": [],
376
- "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"
377
- },
378
- "defaultValue": "undefined"
379
- },
380
- "errorCallback": {
381
- "type": "unknown",
382
- "mutable": false,
383
- "complexType": {
384
- "original": "(error?: Error) => void",
385
- "resolved": "(error?: Error) => void",
386
- "references": {
387
- "Error": {
388
- "location": "global"
389
- }
390
- }
391
- },
392
- "required": false,
393
- "optional": false,
394
- "docs": {
395
- "tags": [],
396
- "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"
397
- },
398
- "defaultValue": "undefined"
399
- },
400
- "handleCheckAppLoading": {
401
- "type": "unknown",
402
- "mutable": false,
403
- "complexType": {
404
- "original": "(isCheckingApp?: boolean) => void",
405
- "resolved": "(isCheckingApp?: boolean) => void",
406
- "references": {}
407
- },
408
- "required": false,
409
- "optional": true,
410
- "docs": {
411
- "tags": [],
412
- "text": "_[Optional]_\nFunction that runs every time the loading state changes while checking if the App is installed. Only on mobile with v3."
413
- },
414
- "defaultValue": "undefined"
415
- },
416
- "checkAppTimeout": {
417
- "type": "number",
418
- "mutable": false,
419
- "complexType": {
420
- "original": "number",
421
- "resolved": "number",
422
- "references": {}
423
- },
424
- "required": false,
425
- "optional": true,
426
- "docs": {
427
- "tags": [],
428
- "text": "_[Optional]_\nMaximum time window to check if the App is installed"
429
- },
430
- "attribute": "check-app-timeout",
431
- "reflect": false,
432
- "defaultValue": "6"
433
- },
434
- "qrRole": {
435
- "type": "string",
436
- "mutable": false,
437
- "complexType": {
438
- "original": "string",
439
- "resolved": "string",
440
- "references": {}
441
- },
442
- "required": false,
443
- "optional": false,
444
- "docs": {
445
- "tags": [],
446
- "text": "***Mandatory***\nDecide if scanning the credential as a verifier to request credentials\nor as an issuer too issue credentials.\nOptions: connect | certify"
447
- },
448
- "attribute": "qr-role",
449
- "reflect": false
450
- },
451
- "callbackServer": {
452
- "type": "string",
453
- "mutable": false,
454
- "complexType": {
455
- "original": "string",
456
- "resolved": "string",
457
- "references": {}
458
- },
459
- "required": false,
460
- "optional": false,
461
- "docs": {
462
- "tags": [],
463
- "text": "***Mandatory just for V1***\nConnect/Certify Server where the wallet will send the data"
464
- },
465
- "attribute": "callback-server",
466
- "reflect": false
467
- },
468
- "sessionTimeout": {
469
- "type": "number",
470
- "mutable": false,
471
- "complexType": {
472
- "original": "number",
473
- "resolved": "number",
474
- "references": {}
475
- },
476
- "required": false,
477
- "optional": true,
478
- "docs": {
479
- "tags": [],
480
- "text": "_[Optional]_\nMaximum time window to display the session"
481
- },
482
- "attribute": "session-timeout",
483
- "reflect": false
484
- },
485
- "pollingFrequency": {
486
- "type": "number",
487
- "mutable": false,
488
- "complexType": {
489
- "original": "number",
490
- "resolved": "number",
491
- "references": {}
492
- },
493
- "required": false,
494
- "optional": true,
495
- "docs": {
496
- "tags": [],
497
- "text": "_[Optional]_\nFrequency in seconds to check if the session has been validated"
498
- },
499
- "attribute": "polling-frequency",
500
- "reflect": false
501
- },
502
- "autorefresh": {
503
- "type": "boolean",
504
- "mutable": false,
505
- "complexType": {
506
- "original": "boolean",
507
- "resolved": "boolean",
508
- "references": {}
509
- },
510
- "required": false,
511
- "optional": false,
512
- "docs": {
513
- "tags": [],
514
- "text": "_[Optional]_\nSet to refresh the session automatically upon expiration. By default it is false"
515
- },
516
- "attribute": "autorefresh",
517
- "reflect": false,
518
- "defaultValue": "false"
519
- },
520
- "v": {
521
- "type": "string",
522
- "mutable": false,
523
- "complexType": {
524
- "original": "string",
525
- "resolved": "string",
526
- "references": {}
527
- },
528
- "required": false,
529
- "optional": true,
530
- "docs": {
531
- "tags": [],
532
- "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"
533
- },
534
- "attribute": "v",
535
- "reflect": false,
536
- "defaultValue": "\"3\""
537
- },
538
- "qrModalTitle": {
539
- "type": "string",
540
- "mutable": false,
541
- "complexType": {
542
- "original": "string",
543
- "resolved": "string",
544
- "references": {}
545
- },
546
- "required": false,
547
- "optional": true,
548
- "docs": {
549
- "tags": [],
550
- "text": "_[Optional]_\nModifies the qr headline title"
551
- },
552
- "attribute": "qr-modal-title",
553
- "reflect": false,
554
- "defaultValue": "\"Quick Access\""
555
- },
556
- "modalTitleColor": {
557
- "type": "string",
558
- "mutable": false,
559
- "complexType": {
560
- "original": "string",
561
- "resolved": "string",
562
- "references": {}
563
- },
564
- "required": false,
565
- "optional": true,
566
- "docs": {
567
- "tags": [],
568
- "text": "_[Optional]_\nString to set Modal title color"
569
- },
570
- "attribute": "modal-title-color",
571
- "reflect": false,
572
- "defaultValue": "\"#4745B7\""
573
- },
574
- "qrModalDescription": {
575
- "type": "string",
576
- "mutable": false,
577
- "complexType": {
578
- "original": "string",
579
- "resolved": "string",
580
- "references": {}
581
- },
582
- "required": false,
583
- "optional": true,
584
- "docs": {
585
- "tags": [],
586
- "text": "_[Optional]_\nModifies the Modal description"
587
- },
588
- "attribute": "qr-modal-description",
589
- "reflect": false,
590
- "defaultValue": "\"Sign up or sign in by scanning the QR Code with the Gataca Wallet\""
591
- },
592
- "hideBrandTitle": {
593
- "type": "boolean",
594
- "mutable": false,
595
- "complexType": {
596
- "original": "boolean",
597
- "resolved": "boolean",
598
- "references": {}
599
- },
600
- "required": false,
601
- "optional": true,
602
- "docs": {
603
- "tags": [],
604
- "text": "_[Optional]_\nBoolean to show or not show the gataca brand title"
605
- },
606
- "attribute": "hide-brand-title",
607
- "reflect": false,
608
- "defaultValue": "false"
609
- },
610
- "dynamicLink": {
611
- "type": "boolean",
612
- "mutable": false,
613
- "complexType": {
614
- "original": "boolean",
615
- "resolved": "boolean",
616
- "references": {}
617
- },
618
- "required": false,
619
- "optional": true,
620
- "docs": {
621
- "tags": [],
622
- "text": "_[Optional]_\nDisplay a link containing a dynamic link to invoke the wallet if closed"
623
- },
624
- "attribute": "dynamic-link",
625
- "reflect": false,
626
- "defaultValue": "true"
627
- },
628
- "logoSize": {
629
- "type": "number",
630
- "mutable": false,
631
- "complexType": {
632
- "original": "number",
633
- "resolved": "number",
634
- "references": {}
635
- },
636
- "required": false,
637
- "optional": true,
638
- "docs": {
639
- "tags": [],
640
- "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"
641
- },
642
- "attribute": "logo-size",
643
- "reflect": false,
644
- "defaultValue": "0"
645
- },
646
- "logoSrc": {
647
- "type": "string",
648
- "mutable": false,
649
- "complexType": {
650
- "original": "string",
651
- "resolved": "string",
652
- "references": {}
653
- },
654
- "required": false,
655
- "optional": true,
656
- "docs": {
657
- "tags": [],
658
- "text": "_[Optional]_\nLogo to display, just if the logo size is greater than 0. No logo is the GATACA logo."
659
- },
660
- "attribute": "logo-src",
661
- "reflect": false
662
- },
663
- "qrCodeExpiredLabel": {
664
- "type": "string",
665
- "mutable": false,
666
- "complexType": {
667
- "original": "string",
668
- "resolved": "string",
669
- "references": {}
670
- },
671
- "required": false,
672
- "optional": true,
673
- "docs": {
674
- "tags": [],
675
- "text": "_[Optional]_\nString to show when qr code expired"
676
- },
677
- "attribute": "qr-code-expired-label",
678
- "reflect": false,
679
- "defaultValue": "\"QR Code expired\""
680
- },
681
- "credentialsNotValidatedLabel": {
682
- "type": "string",
683
- "mutable": false,
684
- "complexType": {
685
- "original": "string",
686
- "resolved": "string",
687
- "references": {}
688
- },
689
- "required": false,
690
- "optional": true,
691
- "docs": {
692
- "tags": [],
693
- "text": "_[Optional]_\nString to show when credentials not validatedd"
694
- },
695
- "attribute": "credentials-not-validated-label",
696
- "reflect": false,
697
- "defaultValue": "\"User credentials not validated\""
698
- },
699
- "clickInsideBoxLabel": {
700
- "type": "string",
701
- "mutable": false,
702
- "complexType": {
703
- "original": "string",
704
- "resolved": "string",
705
- "references": {}
706
- },
707
- "required": false,
708
- "optional": true,
709
- "docs": {
710
- "tags": [],
711
- "text": "_[Optional]_\nString to show \"click inside\" label"
712
- },
713
- "attribute": "click-inside-box-label",
714
- "reflect": false,
715
- "defaultValue": "\"Click inside the box to\""
716
- },
717
- "refreshQrLabel": {
718
- "type": "string",
719
- "mutable": false,
720
- "complexType": {
721
- "original": "string",
722
- "resolved": "string",
723
- "references": {}
724
- },
725
- "required": false,
726
- "optional": true,
727
- "docs": {
728
- "tags": [],
729
- "text": "_[Optional]_\nString to show \"refresh QR\" label"
730
- },
731
- "attribute": "refresh-qr-label",
732
- "reflect": false,
733
- "defaultValue": "\"Refresh QR Code\""
734
- },
735
- "scanQrLabel": {
736
- "type": "string",
737
- "mutable": false,
738
- "complexType": {
739
- "original": "string",
740
- "resolved": "string",
741
- "references": {}
742
- },
743
- "required": false,
744
- "optional": true,
745
- "docs": {
746
- "tags": [],
747
- "text": "_[Optional]_\nString to show \"scan QR\" label"
748
- },
749
- "attribute": "scan-qr-label",
750
- "reflect": false,
751
- "defaultValue": "\"Scan QR Code\""
752
- },
753
- "userNotScanInTimeErrorLabel": {
754
- "type": "string",
755
- "mutable": false,
756
- "complexType": {
757
- "original": "string",
758
- "resolved": "string",
759
- "references": {}
760
- },
761
- "required": false,
762
- "optional": true,
763
- "docs": {
764
- "tags": [],
765
- "text": "_[Optional]_\nString to show \"user not scan in time\" error"
766
- },
767
- "attribute": "user-not-scan-in-time-error-label",
768
- "reflect": false,
769
- "defaultValue": "\"User did not scan the QR in the allowed time\""
770
- },
771
- "credsNotValidatedErrorLabel": {
772
- "type": "string",
773
- "mutable": false,
774
- "complexType": {
775
- "original": "string",
776
- "resolved": "string",
777
- "references": {}
778
- },
779
- "required": false,
780
- "optional": true,
781
- "docs": {
782
- "tags": [],
783
- "text": "_[Optional]_\nString to show \"provided credentials not validates\" error"
784
- },
785
- "attribute": "creds-not-validated-error-label",
786
- "reflect": false,
787
- "defaultValue": "\"Provided user credentials couldn't be validated\""
788
- },
789
- "failedLoginErrorLabel": {
790
- "type": "string",
791
- "mutable": false,
792
- "complexType": {
793
- "original": "string",
794
- "resolved": "string",
795
- "references": {}
796
- },
797
- "required": false,
798
- "optional": true,
799
- "docs": {
800
- "tags": [],
801
- "text": "_[Optional]_\nString to show \"failed login\" error"
802
- },
803
- "attribute": "failed-login-error-label",
804
- "reflect": false,
805
- "defaultValue": "\"No successful login\""
806
- },
807
- "successLoginLabel": {
808
- "type": "string",
809
- "mutable": false,
810
- "complexType": {
811
- "original": "string",
812
- "resolved": "string",
813
- "references": {}
814
- },
815
- "required": false,
816
- "optional": true,
817
- "docs": {
818
- "tags": [],
819
- "text": "_[Optional]_\nString to show \"successful login\" label"
820
- },
821
- "attribute": "success-login-label",
822
- "reflect": false,
823
- "defaultValue": "\"Successful Connection!\""
824
- },
825
- "byBrandLabel": {
826
- "type": "string",
827
- "mutable": false,
828
- "complexType": {
829
- "original": "string",
830
- "resolved": "string",
831
- "references": {}
832
- },
833
- "required": false,
834
- "optional": true,
835
- "docs": {
836
- "tags": [],
837
- "text": "_[Optional]_\nString to show \"by brand\" label"
838
- },
839
- "attribute": "by-brand-label",
840
- "reflect": false,
841
- "defaultValue": "\"by Gataca\""
842
- },
843
- "waitingStartSessionLabel": {
844
- "type": "string",
845
- "mutable": false,
846
- "complexType": {
847
- "original": "string",
848
- "resolved": "string",
849
- "references": {}
850
- },
851
- "required": false,
852
- "optional": true,
853
- "docs": {
854
- "tags": [],
855
- "text": "_[Optional]_\nString to show \"waiting start session\" label"
856
- },
857
- "attribute": "waiting-start-session-label",
858
- "reflect": false,
859
- "defaultValue": "\"waiting to start a session\""
860
- },
861
- "hideQrModalDescription": {
862
- "type": "boolean",
863
- "mutable": false,
864
- "complexType": {
865
- "original": "boolean",
866
- "resolved": "boolean",
867
- "references": {}
868
- },
869
- "required": false,
870
- "optional": true,
871
- "docs": {
872
- "tags": [],
873
- "text": "_[Optional]_\nBoolean to show or not show the QR Modal description"
874
- },
875
- "attribute": "hide-qr-modal-description",
876
- "reflect": false,
877
- "defaultValue": "false"
878
- }
879
- };
880
- }
881
- static get states() {
882
- return {
883
- "open": {},
884
- "sessionId": {},
885
- "authenticationRequest": {},
886
- "sessionData": {},
887
- "result": {}
888
- };
889
- }
890
- static get events() {
891
- return [{
892
- "method": "gatacaLoginCompleted",
893
- "name": "gatacaLoginCompleted",
894
- "bubbles": true,
895
- "cancelable": true,
896
- "composed": true,
897
- "docs": {
898
- "tags": [],
899
- "text": "GatacaLoginCompleted event, triggered with session data upon login success"
900
- },
901
- "complexType": {
902
- "original": "any",
903
- "resolved": "any",
904
- "references": {}
905
- }
906
- }, {
907
- "method": "gatacaLoginFailed",
908
- "name": "gatacaLoginFailed",
909
- "bubbles": true,
910
- "cancelable": true,
911
- "composed": true,
912
- "docs": {
913
- "tags": [],
914
- "text": "GatacaLoginFailed event, triggered with error upon login failure"
915
- },
916
- "complexType": {
917
- "original": "any",
918
- "resolved": "any",
919
- "references": {}
920
- }
921
- }];
922
- }
923
- static get methods() {
924
- return {
925
- "getSessionData": {
926
- "complexType": {
927
- "signature": "() => Promise<any>",
928
- "parameters": [],
929
- "references": {
930
- "Promise": {
931
- "location": "global"
932
- }
933
- },
934
- "return": "Promise<any>"
935
- },
936
- "docs": {
937
- "text": "Retrieve manually the session data on a successful login",
938
- "tags": []
939
- }
940
- },
941
- "startMobilePolling": {
942
- "complexType": {
943
- "signature": "() => Promise<void>",
944
- "parameters": [],
945
- "references": {
946
- "Promise": {
947
- "location": "global"
948
- },
949
- "RESULT_STATUS": {
950
- "location": "import",
951
- "path": "../../utils/utils"
952
- }
953
- },
954
- "return": "Promise<void>"
955
- },
956
- "docs": {
957
- "text": "Force manually the start polling",
958
- "tags": []
959
- }
960
- },
961
- "stop": {
962
- "complexType": {
963
- "signature": "() => Promise<void>",
964
- "parameters": [],
965
- "references": {
966
- "Promise": {
967
- "location": "global"
968
- }
969
- },
970
- "return": "Promise<void>"
971
- },
972
- "docs": {
973
- "text": "Stop manually an ongoing session",
974
- "tags": []
975
- }
976
- }
977
- };
978
- }
979
- }