@gataca/qr 0.0.7

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