@gataca/qr 2.0.2 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/gataca-autoqr_6.cjs.entry.js +638 -0
- package/dist/cjs/gatacaqr.cjs.js +19 -0
- package/dist/cjs/index-4be0cdca.js +1435 -0
- package/dist/cjs/index.cjs.js +16 -0
- package/dist/cjs/loader.cjs.js +21 -0
- package/dist/cjs/utils-383ee834.js +26 -0
- package/dist/collection/assets/icons/gat-icon-alert.svg +5 -0
- package/dist/collection/assets/icons/gat-icon-check.svg +5 -0
- package/dist/collection/assets/icons/gat-icon-refresh.svg +4 -0
- package/dist/collection/assets/images/logo_gataca.svg +26 -0
- package/dist/collection/collection-manifest.json +17 -0
- package/dist/collection/components/gataca-autoqr/gataca-autoqr.css +116 -0
- package/dist/collection/components/gataca-autoqr/gataca-autoqr.js +323 -0
- package/dist/collection/components/gataca-qr/gataca-qr.css +261 -0
- package/dist/collection/components/gataca-qr/gataca-qr.js +828 -0
- package/dist/collection/components/gataca-qrdisplay/gataca-qrdisplay.js +154 -0
- package/dist/collection/components/gataca-qrws/gataca-qrws.css +251 -0
- package/dist/collection/components/gataca-qrws/gataca-qrws.js +566 -0
- package/dist/collection/components/gataca-ssibutton/gataca-ssibutton.css +116 -0
- package/dist/collection/components/gataca-ssibutton/gataca-ssibutton.js +679 -0
- package/dist/collection/components/gataca-ssibuttonws/gataca-ssibuttonws.css +116 -0
- package/dist/collection/components/gataca-ssibuttonws/gataca-ssibuttonws.js +410 -0
- package/dist/collection/index.js +2 -0
- package/dist/collection/utils/index.js +1 -0
- package/dist/collection/utils/utils.js +21 -0
- package/dist/{gatacaqr/gat-icon-refresh-8d3dc25f.js → components/gat-icon-refresh.js} +23 -1
- package/dist/{gatacaqr/gataca-autoqr.entry.js → components/gataca-autoqr.js} +67 -7
- package/dist/components/gataca-qr.js +6 -0
- package/dist/components/gataca-qr2.js +227 -0
- package/dist/components/gataca-qrdisplay.js +6 -0
- package/dist/components/gataca-qrdisplay2.js +93 -0
- package/dist/components/gataca-qrws.js +6 -0
- package/dist/{gatacaqr/gataca-qrws.entry.js → components/gataca-qrws2.js} +50 -10
- package/dist/components/gataca-ssibutton.js +6 -0
- package/dist/{gatacaqr/gataca-ssibutton.entry.js → components/gataca-ssibutton2.js} +83 -9
- package/dist/components/gataca-ssibuttonws.js +6 -0
- package/dist/{gatacaqr/gataca-ssibuttonws.entry.js → components/gataca-ssibuttonws2.js} +53 -7
- package/dist/components/index.js +8 -0
- package/dist/esm/gataca-autoqr_6.entry.js +629 -0
- package/dist/esm/gatacaqr.js +17 -0
- package/dist/esm/index-80311733.js +1409 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +17 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/gatacaqr/gatacaqr.esm.js +1 -129
- package/dist/gatacaqr/index.esm.js +1 -1
- package/dist/gatacaqr/p-a5648391.js +2 -0
- package/dist/gatacaqr/p-b37057bb.entry.js +1 -0
- package/dist/gatacaqr/p-b8ba109f.js +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/components/gataca-qr/gataca-qr.d.ts +75 -0
- package/dist/types/components/gataca-ssibutton/gataca-ssibutton.d.ts +75 -0
- package/dist/types/components.d.ts +240 -0
- package/package.json +1 -1
- package/dist/gatacaqr/app-globals-0f993ce5.js +0 -3
- package/dist/gatacaqr/css-shim-8eec97b3.js +0 -4
- package/dist/gatacaqr/dom-1b0cf05d.js +0 -73
- package/dist/gatacaqr/gataca-qr.entry.js +0 -171
- package/dist/gatacaqr/gataca-qrdisplay-0320bb25.js +0 -97
- package/dist/gatacaqr/gataca-qrdisplay.entry.js +0 -2
- package/dist/gatacaqr/index-d0db23e4.js +0 -3262
- package/dist/gatacaqr/shadow-css-146f2f6f.js +0 -387
- /package/dist/{gatacaqr → esm}/utils-05ba6c9f.js +0 -0
|
@@ -0,0 +1,828 @@
|
|
|
1
|
+
import { h, } from "@stencil/core";
|
|
2
|
+
import alertIcon from "../../assets/icons/gat-icon-alert.svg";
|
|
3
|
+
import successIcon from "../../assets/icons/gat-icon-check.svg";
|
|
4
|
+
import refreshIcon from "../../assets/icons/gat-icon-refresh.svg";
|
|
5
|
+
import logoGataca from "../../assets/images/logo_gataca.svg";
|
|
6
|
+
import "../gataca-qrdisplay/gataca-qrdisplay";
|
|
7
|
+
import { base64UrlEncode, checkMobile, RESULT_STATUS } from "../../utils/utils";
|
|
8
|
+
const DEEP_LINK_PREFIX = "https://gataca.page.link/?apn=com.gatacaapp&ibi=com.gataca.wallet&link=";
|
|
9
|
+
//Default values
|
|
10
|
+
const DEFAULT_SESSION_TIMEOUT = 300; //5mins as in connect
|
|
11
|
+
const DEFAULT_POLLING_FREQ = 3;
|
|
12
|
+
const QR_ROLE_CONNECT = "connect";
|
|
13
|
+
const FUNCTION_ROLES = {
|
|
14
|
+
connect: "scan",
|
|
15
|
+
certify: "credential",
|
|
16
|
+
};
|
|
17
|
+
export class GatacaQR {
|
|
18
|
+
constructor() { this.checkStatus = undefined; this.createSession = undefined; this.successCallback = undefined; this.errorCallback = undefined; this.qrRole = undefined; this.callbackServer = undefined; this.autostart = true; this.autorefresh = false; this.v2 = false; this.qrModalTitle = "Quick Access"; this.modalTitleColor = "#4745B7"; this.qrModalDescription = "Sign up or sign in by scanning the QR Code with the Gataca Wallet"; this.hideBrandTitle = false; this.logoSize = 0; this.logoSrc = logoGataca; this.qrCodeExpiredLabel = "QR Code expired"; this.credentialsNotValidatedLabel = "User credentials not validated"; this.clickInsideBoxLabel = "Click inside the box to"; this.refreshQrLabel = "Refresh QR Code"; this.scanQrLabel = "Scan QR Code"; this.userNotScanInTimeErrorLabel = "User did not scan the QR in the allowed time"; this.credsNotValidatedErrorLabel = "Provided user credentials couldn't be validated"; this.failedLoginErrorLabel = "No successful login"; this.successLoginLabel = "Successful Connection!"; this.byBrandLabel = "by Gataca"; this.waitingStartSessionLabel = "waiting to start a session"; this.hideQrModalDescription = false; this.sessionTimeout = DEFAULT_SESSION_TIMEOUT; this.pollingFrequency = DEFAULT_POLLING_FREQ; this.dynamicLink = true; this.sessionId = undefined; this.authenticationRequest = undefined; this.sessionData = undefined; this.result = RESULT_STATUS.NOT_STARTED; }
|
|
19
|
+
disconnectedCallback() {
|
|
20
|
+
this.stop();
|
|
21
|
+
}
|
|
22
|
+
async componentDidLoad() {
|
|
23
|
+
if (this.autostart) {
|
|
24
|
+
await this.display();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Force manually the display of a QR
|
|
29
|
+
*/
|
|
30
|
+
async display() {
|
|
31
|
+
await this.getSessionId();
|
|
32
|
+
this.result = RESULT_STATUS.ONGOING;
|
|
33
|
+
this.poll()
|
|
34
|
+
.then((data) => {
|
|
35
|
+
this.result = RESULT_STATUS.SUCCESS;
|
|
36
|
+
this.sessionData = data;
|
|
37
|
+
this.gatacaLoginCompleted.emit(data);
|
|
38
|
+
this.successCallback(data);
|
|
39
|
+
})
|
|
40
|
+
.catch((err) => {
|
|
41
|
+
this.clean();
|
|
42
|
+
let expired = err === RESULT_STATUS.EXPIRED;
|
|
43
|
+
if (expired && this.autorefresh) {
|
|
44
|
+
this.display();
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
if (err !== RESULT_STATUS.NOT_STARTED) {
|
|
48
|
+
let error = expired
|
|
49
|
+
? new Error(this.userNotScanInTimeErrorLabel)
|
|
50
|
+
: new Error(this.credsNotValidatedErrorLabel);
|
|
51
|
+
this.result = err;
|
|
52
|
+
this.gatacaLoginFailed.emit(error);
|
|
53
|
+
this.errorCallback(error);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
if (checkMobile() && this.dynamicLink) {
|
|
58
|
+
window.location.href = this.getLink();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Stop manually an ongoing session
|
|
63
|
+
*/
|
|
64
|
+
async stop() {
|
|
65
|
+
this.clean();
|
|
66
|
+
if (this.result === RESULT_STATUS.ONGOING) {
|
|
67
|
+
this.result = RESULT_STATUS.NOT_STARTED;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
clean() {
|
|
71
|
+
this.sessionData = undefined;
|
|
72
|
+
this.sessionId = undefined;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Retrieve manually the session data on a successful login
|
|
76
|
+
*/
|
|
77
|
+
async getSessionData() {
|
|
78
|
+
return this.sessionData
|
|
79
|
+
? Promise.resolve(this.sessionData)
|
|
80
|
+
: Promise.reject(new Error(this.failedLoginErrorLabel));
|
|
81
|
+
}
|
|
82
|
+
async getSessionId() {
|
|
83
|
+
if (this.sessionId) {
|
|
84
|
+
return this.sessionId;
|
|
85
|
+
}
|
|
86
|
+
let { sessionId, authenticationRequest } = await this.createSession();
|
|
87
|
+
this.sessionId = sessionId;
|
|
88
|
+
this.authenticationRequest = authenticationRequest;
|
|
89
|
+
return this.sessionId;
|
|
90
|
+
}
|
|
91
|
+
getLink() {
|
|
92
|
+
if (this.v2 && this.qrRole == QR_ROLE_CONNECT) {
|
|
93
|
+
return this.authenticationRequest;
|
|
94
|
+
}
|
|
95
|
+
let op = FUNCTION_ROLES[this.qrRole];
|
|
96
|
+
let link = "https://gataca.page.link/" + op + "?";
|
|
97
|
+
link +=
|
|
98
|
+
this.qrRole === QR_ROLE_CONNECT
|
|
99
|
+
? "session=" + this.sessionId
|
|
100
|
+
: "process=" + this.sessionId;
|
|
101
|
+
link +=
|
|
102
|
+
"&callback=" + base64UrlEncode(encodeURIComponent(this.callbackServer));
|
|
103
|
+
link = encodeURIComponent(link);
|
|
104
|
+
return this.dynamicLink ? DEEP_LINK_PREFIX + link : link;
|
|
105
|
+
}
|
|
106
|
+
async poll() {
|
|
107
|
+
let endTime = new Date().getTime() +
|
|
108
|
+
(this.sessionTimeout || DEFAULT_SESSION_TIMEOUT) * 1000;
|
|
109
|
+
let interval = (this.pollingFrequency || DEFAULT_POLLING_FREQ) * 1000;
|
|
110
|
+
let checkFunc = async (component) => {
|
|
111
|
+
if (component.result === RESULT_STATUS.NOT_STARTED) {
|
|
112
|
+
return { result: RESULT_STATUS.NOT_STARTED };
|
|
113
|
+
}
|
|
114
|
+
let id = await component.getSessionId();
|
|
115
|
+
return component.checkStatus(id);
|
|
116
|
+
};
|
|
117
|
+
let component = this;
|
|
118
|
+
let checkCondition = async function (resolve, reject) {
|
|
119
|
+
// If the condition is met, we're done!
|
|
120
|
+
let { result, data } = await checkFunc(component);
|
|
121
|
+
switch (result) {
|
|
122
|
+
case RESULT_STATUS.SUCCESS:
|
|
123
|
+
resolve(data);
|
|
124
|
+
break;
|
|
125
|
+
case RESULT_STATUS.ONGOING:
|
|
126
|
+
if (component.sessionTimeout > 0 && new Date().getTime() < endTime) {
|
|
127
|
+
setTimeout(checkCondition, interval, resolve, reject);
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
reject(RESULT_STATUS.EXPIRED);
|
|
131
|
+
}
|
|
132
|
+
break;
|
|
133
|
+
default:
|
|
134
|
+
reject(result);
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
return new Promise(checkCondition);
|
|
139
|
+
}
|
|
140
|
+
renderQRSection() {
|
|
141
|
+
switch (this.result) {
|
|
142
|
+
case RESULT_STATUS.NOT_STARTED:
|
|
143
|
+
return this.renderRetryButton();
|
|
144
|
+
case RESULT_STATUS.ONGOING:
|
|
145
|
+
return this.renderQR(this.getLink(), 300, true);
|
|
146
|
+
case RESULT_STATUS.EXPIRED:
|
|
147
|
+
return this.renderRetryButton(this.qrCodeExpiredLabel);
|
|
148
|
+
case RESULT_STATUS.FAILED:
|
|
149
|
+
return this.renderRetryButton(this.credentialsNotValidatedLabel);
|
|
150
|
+
case RESULT_STATUS.SUCCESS:
|
|
151
|
+
return this.renderSuccess();
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
renderSuccess() {
|
|
155
|
+
return (h("div", { class: "success" }, h("img", { src: successIcon, height: 52, width: 52 }), h("p", { class: "successMsg" }, this.successLoginLabel)));
|
|
156
|
+
}
|
|
157
|
+
renderRetryButton(errorMessage) {
|
|
158
|
+
return (h("div", { class: "reload" }, h("div", { id: "notify", onClick: () => this.display() }, h("img", { src: refreshIcon, height: 24, width: 24 }), h("p", { class: "qrDescription" }, this.clickInsideBoxLabel, " "), errorMessage ? (h("p", { class: "qrDescription bold" }, this.refreshQrLabel)) : (h("p", { class: "qrDescription bold" }, this.scanQrLabel, "e")), errorMessage && (h("div", { class: "alert" }, h("img", { src: alertIcon, height: 24, width: 24 }), h("p", null, errorMessage)))), h("div", { id: "qrwait" }, this.renderQR(this.waitingStartSessionLabel, 250))));
|
|
159
|
+
}
|
|
160
|
+
renderQR(value, size, useLogo) {
|
|
161
|
+
return (h("gataca-qrdisplay", { qrData: value, rounded: true, size: size, "logo-size": useLogo ? 0.33 : 0, "logo-src": this.logoSrc }));
|
|
162
|
+
}
|
|
163
|
+
render() {
|
|
164
|
+
return (h("div", { class: "popUpContainer" }, h("div", { class: "modal-window is-visible", onClick: (event) => {
|
|
165
|
+
event.stopPropagation();
|
|
166
|
+
} }, h("div", { class: "modal-window__content" }, h("div", { class: "qrTitleContainer" }, h("p", { class: "qrTitle", style: { color: this.modalTitleColor || "#1e1e20" } }, this.qrModalTitle), !this.hideBrandTitle && (h("p", { class: "qrBrand" }, this.byBrandLabel, " ", h("span", null, h("img", { src: logoGataca })))), this.result !== RESULT_STATUS.SUCCESS &&
|
|
167
|
+
!this.hideQrModalDescription && (h("p", { class: "qrDescription" }, this.qrModalDescription))), h("div", { class: "qrSection" }, this.renderQRSection())))));
|
|
168
|
+
}
|
|
169
|
+
static get is() { return "gataca-qr"; }
|
|
170
|
+
static get encapsulation() { return "shadow"; }
|
|
171
|
+
static get originalStyleUrls() {
|
|
172
|
+
return {
|
|
173
|
+
"$": ["gataca-qr.scss"]
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
static get styleUrls() {
|
|
177
|
+
return {
|
|
178
|
+
"$": ["gataca-qr.css"]
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
static get properties() {
|
|
182
|
+
return {
|
|
183
|
+
"checkStatus": {
|
|
184
|
+
"type": "unknown",
|
|
185
|
+
"mutable": false,
|
|
186
|
+
"complexType": {
|
|
187
|
+
"original": "(\n id?: string\n ) => Promise<{ result: RESULT_STATUS; data?: any }>",
|
|
188
|
+
"resolved": "(id?: string) => Promise<{ result: RESULT_STATUS; data?: any; }>",
|
|
189
|
+
"references": {
|
|
190
|
+
"Promise": {
|
|
191
|
+
"location": "global"
|
|
192
|
+
},
|
|
193
|
+
"RESULT_STATUS": {
|
|
194
|
+
"location": "import",
|
|
195
|
+
"path": "../../utils/utils"
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
"required": false,
|
|
200
|
+
"optional": true,
|
|
201
|
+
"docs": {
|
|
202
|
+
"tags": [],
|
|
203
|
+
"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."
|
|
204
|
+
},
|
|
205
|
+
"defaultValue": "undefined"
|
|
206
|
+
},
|
|
207
|
+
"createSession": {
|
|
208
|
+
"type": "unknown",
|
|
209
|
+
"mutable": false,
|
|
210
|
+
"complexType": {
|
|
211
|
+
"original": "() => Promise<{\n sessionId: string;\n authenticationRequest?: string;\n }>",
|
|
212
|
+
"resolved": "() => Promise<{ sessionId: string; authenticationRequest?: string; }>",
|
|
213
|
+
"references": {
|
|
214
|
+
"Promise": {
|
|
215
|
+
"location": "global"
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
"required": false,
|
|
220
|
+
"optional": true,
|
|
221
|
+
"docs": {
|
|
222
|
+
"tags": [],
|
|
223
|
+
"text": "***Mandatory***\nCreate session function to generate a new Session\nUsing V1, it can provide just a session Id\nUsing V2, it must provide also the authentication request. The session Id is the id of the presentation definition"
|
|
224
|
+
},
|
|
225
|
+
"defaultValue": "undefined"
|
|
226
|
+
},
|
|
227
|
+
"successCallback": {
|
|
228
|
+
"type": "unknown",
|
|
229
|
+
"mutable": false,
|
|
230
|
+
"complexType": {
|
|
231
|
+
"original": "(data?: any) => void",
|
|
232
|
+
"resolved": "(data?: any) => void",
|
|
233
|
+
"references": {}
|
|
234
|
+
},
|
|
235
|
+
"required": false,
|
|
236
|
+
"optional": false,
|
|
237
|
+
"docs": {
|
|
238
|
+
"tags": [],
|
|
239
|
+
"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"
|
|
240
|
+
},
|
|
241
|
+
"defaultValue": "undefined"
|
|
242
|
+
},
|
|
243
|
+
"errorCallback": {
|
|
244
|
+
"type": "unknown",
|
|
245
|
+
"mutable": false,
|
|
246
|
+
"complexType": {
|
|
247
|
+
"original": "(error?: Error) => void",
|
|
248
|
+
"resolved": "(error?: Error) => void",
|
|
249
|
+
"references": {
|
|
250
|
+
"Error": {
|
|
251
|
+
"location": "global"
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
"required": false,
|
|
256
|
+
"optional": false,
|
|
257
|
+
"docs": {
|
|
258
|
+
"tags": [],
|
|
259
|
+
"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"
|
|
260
|
+
},
|
|
261
|
+
"defaultValue": "undefined"
|
|
262
|
+
},
|
|
263
|
+
"qrRole": {
|
|
264
|
+
"type": "string",
|
|
265
|
+
"mutable": false,
|
|
266
|
+
"complexType": {
|
|
267
|
+
"original": "string",
|
|
268
|
+
"resolved": "string",
|
|
269
|
+
"references": {}
|
|
270
|
+
},
|
|
271
|
+
"required": false,
|
|
272
|
+
"optional": false,
|
|
273
|
+
"docs": {
|
|
274
|
+
"tags": [],
|
|
275
|
+
"text": "***Mandatory***\nDecide if scanning the credential as a verifier to request credentials\nor as an issuer too issue credentials.\nOptions: connect | certify"
|
|
276
|
+
},
|
|
277
|
+
"attribute": "qr-role",
|
|
278
|
+
"reflect": false
|
|
279
|
+
},
|
|
280
|
+
"callbackServer": {
|
|
281
|
+
"type": "string",
|
|
282
|
+
"mutable": false,
|
|
283
|
+
"complexType": {
|
|
284
|
+
"original": "string",
|
|
285
|
+
"resolved": "string",
|
|
286
|
+
"references": {}
|
|
287
|
+
},
|
|
288
|
+
"required": false,
|
|
289
|
+
"optional": false,
|
|
290
|
+
"docs": {
|
|
291
|
+
"tags": [],
|
|
292
|
+
"text": "***Mandatory just for V1***\nConnect/Certify Server where the wallet will send the data"
|
|
293
|
+
},
|
|
294
|
+
"attribute": "callback-server",
|
|
295
|
+
"reflect": false
|
|
296
|
+
},
|
|
297
|
+
"autostart": {
|
|
298
|
+
"type": "boolean",
|
|
299
|
+
"mutable": false,
|
|
300
|
+
"complexType": {
|
|
301
|
+
"original": "boolean",
|
|
302
|
+
"resolved": "boolean",
|
|
303
|
+
"references": {}
|
|
304
|
+
},
|
|
305
|
+
"required": false,
|
|
306
|
+
"optional": false,
|
|
307
|
+
"docs": {
|
|
308
|
+
"tags": [],
|
|
309
|
+
"text": "_[Optional]_\nSet to enable autoload when the QR is displayed. By default it is true"
|
|
310
|
+
},
|
|
311
|
+
"attribute": "autostart",
|
|
312
|
+
"reflect": false,
|
|
313
|
+
"defaultValue": "true"
|
|
314
|
+
},
|
|
315
|
+
"autorefresh": {
|
|
316
|
+
"type": "boolean",
|
|
317
|
+
"mutable": false,
|
|
318
|
+
"complexType": {
|
|
319
|
+
"original": "boolean",
|
|
320
|
+
"resolved": "boolean",
|
|
321
|
+
"references": {}
|
|
322
|
+
},
|
|
323
|
+
"required": false,
|
|
324
|
+
"optional": false,
|
|
325
|
+
"docs": {
|
|
326
|
+
"tags": [],
|
|
327
|
+
"text": "_[Optional]_\nSet to refresh the session automatically upon expiration. By default it is false"
|
|
328
|
+
},
|
|
329
|
+
"attribute": "autorefresh",
|
|
330
|
+
"reflect": false,
|
|
331
|
+
"defaultValue": "false"
|
|
332
|
+
},
|
|
333
|
+
"v2": {
|
|
334
|
+
"type": "boolean",
|
|
335
|
+
"mutable": false,
|
|
336
|
+
"complexType": {
|
|
337
|
+
"original": "boolean",
|
|
338
|
+
"resolved": "boolean",
|
|
339
|
+
"references": {}
|
|
340
|
+
},
|
|
341
|
+
"required": false,
|
|
342
|
+
"optional": true,
|
|
343
|
+
"docs": {
|
|
344
|
+
"tags": [],
|
|
345
|
+
"text": "_[Optional]_\nSet to use v2 links. The create session must be providing both an authentication request and a session Id"
|
|
346
|
+
},
|
|
347
|
+
"attribute": "v-2",
|
|
348
|
+
"reflect": false,
|
|
349
|
+
"defaultValue": "false"
|
|
350
|
+
},
|
|
351
|
+
"qrModalTitle": {
|
|
352
|
+
"type": "string",
|
|
353
|
+
"mutable": false,
|
|
354
|
+
"complexType": {
|
|
355
|
+
"original": "string",
|
|
356
|
+
"resolved": "string",
|
|
357
|
+
"references": {}
|
|
358
|
+
},
|
|
359
|
+
"required": false,
|
|
360
|
+
"optional": true,
|
|
361
|
+
"docs": {
|
|
362
|
+
"tags": [],
|
|
363
|
+
"text": "_[Optional]_\nModifies the qr headline title"
|
|
364
|
+
},
|
|
365
|
+
"attribute": "qr-modal-title",
|
|
366
|
+
"reflect": false,
|
|
367
|
+
"defaultValue": "\"Quick Access\""
|
|
368
|
+
},
|
|
369
|
+
"modalTitleColor": {
|
|
370
|
+
"type": "string",
|
|
371
|
+
"mutable": false,
|
|
372
|
+
"complexType": {
|
|
373
|
+
"original": "string",
|
|
374
|
+
"resolved": "string",
|
|
375
|
+
"references": {}
|
|
376
|
+
},
|
|
377
|
+
"required": false,
|
|
378
|
+
"optional": true,
|
|
379
|
+
"docs": {
|
|
380
|
+
"tags": [],
|
|
381
|
+
"text": "_[Optional]_\nString to set Modal title color"
|
|
382
|
+
},
|
|
383
|
+
"attribute": "modal-title-color",
|
|
384
|
+
"reflect": false,
|
|
385
|
+
"defaultValue": "\"#4745B7\""
|
|
386
|
+
},
|
|
387
|
+
"qrModalDescription": {
|
|
388
|
+
"type": "string",
|
|
389
|
+
"mutable": false,
|
|
390
|
+
"complexType": {
|
|
391
|
+
"original": "string",
|
|
392
|
+
"resolved": "string",
|
|
393
|
+
"references": {}
|
|
394
|
+
},
|
|
395
|
+
"required": false,
|
|
396
|
+
"optional": true,
|
|
397
|
+
"docs": {
|
|
398
|
+
"tags": [],
|
|
399
|
+
"text": "_[Optional]_\nModifies the Modal description"
|
|
400
|
+
},
|
|
401
|
+
"attribute": "qr-modal-description",
|
|
402
|
+
"reflect": false,
|
|
403
|
+
"defaultValue": "\"Sign up or sign in by scanning the QR Code with the Gataca Wallet\""
|
|
404
|
+
},
|
|
405
|
+
"hideBrandTitle": {
|
|
406
|
+
"type": "boolean",
|
|
407
|
+
"mutable": false,
|
|
408
|
+
"complexType": {
|
|
409
|
+
"original": "boolean",
|
|
410
|
+
"resolved": "boolean",
|
|
411
|
+
"references": {}
|
|
412
|
+
},
|
|
413
|
+
"required": false,
|
|
414
|
+
"optional": true,
|
|
415
|
+
"docs": {
|
|
416
|
+
"tags": [],
|
|
417
|
+
"text": "_[Optional]_\nBoolean to show or not show the gataca brand title"
|
|
418
|
+
},
|
|
419
|
+
"attribute": "hide-brand-title",
|
|
420
|
+
"reflect": false,
|
|
421
|
+
"defaultValue": "false"
|
|
422
|
+
},
|
|
423
|
+
"logoSize": {
|
|
424
|
+
"type": "number",
|
|
425
|
+
"mutable": false,
|
|
426
|
+
"complexType": {
|
|
427
|
+
"original": "number",
|
|
428
|
+
"resolved": "number",
|
|
429
|
+
"references": {}
|
|
430
|
+
},
|
|
431
|
+
"required": false,
|
|
432
|
+
"optional": true,
|
|
433
|
+
"docs": {
|
|
434
|
+
"tags": [],
|
|
435
|
+
"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"
|
|
436
|
+
},
|
|
437
|
+
"attribute": "logo-size",
|
|
438
|
+
"reflect": false,
|
|
439
|
+
"defaultValue": "0"
|
|
440
|
+
},
|
|
441
|
+
"logoSrc": {
|
|
442
|
+
"type": "string",
|
|
443
|
+
"mutable": false,
|
|
444
|
+
"complexType": {
|
|
445
|
+
"original": "string",
|
|
446
|
+
"resolved": "string",
|
|
447
|
+
"references": {}
|
|
448
|
+
},
|
|
449
|
+
"required": false,
|
|
450
|
+
"optional": true,
|
|
451
|
+
"docs": {
|
|
452
|
+
"tags": [],
|
|
453
|
+
"text": "_[Optional]_\nLogo to display, just if the logo size is greater than 0. No logo is the GATACA logo."
|
|
454
|
+
},
|
|
455
|
+
"attribute": "logo-src",
|
|
456
|
+
"reflect": false,
|
|
457
|
+
"defaultValue": "logoGataca"
|
|
458
|
+
},
|
|
459
|
+
"qrCodeExpiredLabel": {
|
|
460
|
+
"type": "string",
|
|
461
|
+
"mutable": false,
|
|
462
|
+
"complexType": {
|
|
463
|
+
"original": "string",
|
|
464
|
+
"resolved": "string",
|
|
465
|
+
"references": {}
|
|
466
|
+
},
|
|
467
|
+
"required": false,
|
|
468
|
+
"optional": true,
|
|
469
|
+
"docs": {
|
|
470
|
+
"tags": [],
|
|
471
|
+
"text": "_[Optional]_\nString to show when qr code expired"
|
|
472
|
+
},
|
|
473
|
+
"attribute": "qr-code-expired-label",
|
|
474
|
+
"reflect": false,
|
|
475
|
+
"defaultValue": "\"QR Code expired\""
|
|
476
|
+
},
|
|
477
|
+
"credentialsNotValidatedLabel": {
|
|
478
|
+
"type": "string",
|
|
479
|
+
"mutable": false,
|
|
480
|
+
"complexType": {
|
|
481
|
+
"original": "string",
|
|
482
|
+
"resolved": "string",
|
|
483
|
+
"references": {}
|
|
484
|
+
},
|
|
485
|
+
"required": false,
|
|
486
|
+
"optional": true,
|
|
487
|
+
"docs": {
|
|
488
|
+
"tags": [],
|
|
489
|
+
"text": "_[Optional]_\nString to show when credentials not validatedd"
|
|
490
|
+
},
|
|
491
|
+
"attribute": "credentials-not-validated-label",
|
|
492
|
+
"reflect": false,
|
|
493
|
+
"defaultValue": "\"User credentials not validated\""
|
|
494
|
+
},
|
|
495
|
+
"clickInsideBoxLabel": {
|
|
496
|
+
"type": "string",
|
|
497
|
+
"mutable": false,
|
|
498
|
+
"complexType": {
|
|
499
|
+
"original": "string",
|
|
500
|
+
"resolved": "string",
|
|
501
|
+
"references": {}
|
|
502
|
+
},
|
|
503
|
+
"required": false,
|
|
504
|
+
"optional": true,
|
|
505
|
+
"docs": {
|
|
506
|
+
"tags": [],
|
|
507
|
+
"text": "_[Optional]_\nString to show \"click inside\" label"
|
|
508
|
+
},
|
|
509
|
+
"attribute": "click-inside-box-label",
|
|
510
|
+
"reflect": false,
|
|
511
|
+
"defaultValue": "\"Click inside the box to\""
|
|
512
|
+
},
|
|
513
|
+
"refreshQrLabel": {
|
|
514
|
+
"type": "string",
|
|
515
|
+
"mutable": false,
|
|
516
|
+
"complexType": {
|
|
517
|
+
"original": "string",
|
|
518
|
+
"resolved": "string",
|
|
519
|
+
"references": {}
|
|
520
|
+
},
|
|
521
|
+
"required": false,
|
|
522
|
+
"optional": true,
|
|
523
|
+
"docs": {
|
|
524
|
+
"tags": [],
|
|
525
|
+
"text": "_[Optional]_\nString to show \"refresh QR\" label"
|
|
526
|
+
},
|
|
527
|
+
"attribute": "refresh-qr-label",
|
|
528
|
+
"reflect": false,
|
|
529
|
+
"defaultValue": "\"Refresh QR Code\""
|
|
530
|
+
},
|
|
531
|
+
"scanQrLabel": {
|
|
532
|
+
"type": "string",
|
|
533
|
+
"mutable": false,
|
|
534
|
+
"complexType": {
|
|
535
|
+
"original": "string",
|
|
536
|
+
"resolved": "string",
|
|
537
|
+
"references": {}
|
|
538
|
+
},
|
|
539
|
+
"required": false,
|
|
540
|
+
"optional": true,
|
|
541
|
+
"docs": {
|
|
542
|
+
"tags": [],
|
|
543
|
+
"text": "_[Optional]_\nString to show \"scan QR\" label"
|
|
544
|
+
},
|
|
545
|
+
"attribute": "scan-qr-label",
|
|
546
|
+
"reflect": false,
|
|
547
|
+
"defaultValue": "\"Scan QR Code\""
|
|
548
|
+
},
|
|
549
|
+
"userNotScanInTimeErrorLabel": {
|
|
550
|
+
"type": "string",
|
|
551
|
+
"mutable": false,
|
|
552
|
+
"complexType": {
|
|
553
|
+
"original": "string",
|
|
554
|
+
"resolved": "string",
|
|
555
|
+
"references": {}
|
|
556
|
+
},
|
|
557
|
+
"required": false,
|
|
558
|
+
"optional": true,
|
|
559
|
+
"docs": {
|
|
560
|
+
"tags": [],
|
|
561
|
+
"text": "_[Optional]_\nString to show \"user not scan in time\" error"
|
|
562
|
+
},
|
|
563
|
+
"attribute": "user-not-scan-in-time-error-label",
|
|
564
|
+
"reflect": false,
|
|
565
|
+
"defaultValue": "\"User did not scan the QR in the allowed time\""
|
|
566
|
+
},
|
|
567
|
+
"credsNotValidatedErrorLabel": {
|
|
568
|
+
"type": "string",
|
|
569
|
+
"mutable": false,
|
|
570
|
+
"complexType": {
|
|
571
|
+
"original": "string",
|
|
572
|
+
"resolved": "string",
|
|
573
|
+
"references": {}
|
|
574
|
+
},
|
|
575
|
+
"required": false,
|
|
576
|
+
"optional": true,
|
|
577
|
+
"docs": {
|
|
578
|
+
"tags": [],
|
|
579
|
+
"text": "_[Optional]_\nString to show \"provided credentials not validates\" error"
|
|
580
|
+
},
|
|
581
|
+
"attribute": "creds-not-validated-error-label",
|
|
582
|
+
"reflect": false,
|
|
583
|
+
"defaultValue": "\"Provided user credentials couldn't be validated\""
|
|
584
|
+
},
|
|
585
|
+
"failedLoginErrorLabel": {
|
|
586
|
+
"type": "string",
|
|
587
|
+
"mutable": false,
|
|
588
|
+
"complexType": {
|
|
589
|
+
"original": "string",
|
|
590
|
+
"resolved": "string",
|
|
591
|
+
"references": {}
|
|
592
|
+
},
|
|
593
|
+
"required": false,
|
|
594
|
+
"optional": true,
|
|
595
|
+
"docs": {
|
|
596
|
+
"tags": [],
|
|
597
|
+
"text": "_[Optional]_\nString to show \"failed login\" error"
|
|
598
|
+
},
|
|
599
|
+
"attribute": "failed-login-error-label",
|
|
600
|
+
"reflect": false,
|
|
601
|
+
"defaultValue": "\"No successful login\""
|
|
602
|
+
},
|
|
603
|
+
"successLoginLabel": {
|
|
604
|
+
"type": "string",
|
|
605
|
+
"mutable": false,
|
|
606
|
+
"complexType": {
|
|
607
|
+
"original": "string",
|
|
608
|
+
"resolved": "string",
|
|
609
|
+
"references": {}
|
|
610
|
+
},
|
|
611
|
+
"required": false,
|
|
612
|
+
"optional": true,
|
|
613
|
+
"docs": {
|
|
614
|
+
"tags": [],
|
|
615
|
+
"text": "_[Optional]_\nString to show \"successful login\" label"
|
|
616
|
+
},
|
|
617
|
+
"attribute": "success-login-label",
|
|
618
|
+
"reflect": false,
|
|
619
|
+
"defaultValue": "\"Successful Connection!\""
|
|
620
|
+
},
|
|
621
|
+
"byBrandLabel": {
|
|
622
|
+
"type": "string",
|
|
623
|
+
"mutable": false,
|
|
624
|
+
"complexType": {
|
|
625
|
+
"original": "string",
|
|
626
|
+
"resolved": "string",
|
|
627
|
+
"references": {}
|
|
628
|
+
},
|
|
629
|
+
"required": false,
|
|
630
|
+
"optional": true,
|
|
631
|
+
"docs": {
|
|
632
|
+
"tags": [],
|
|
633
|
+
"text": "_[Optional]_\nString to show \"by brand\" label"
|
|
634
|
+
},
|
|
635
|
+
"attribute": "by-brand-label",
|
|
636
|
+
"reflect": false,
|
|
637
|
+
"defaultValue": "\"by Gataca\""
|
|
638
|
+
},
|
|
639
|
+
"waitingStartSessionLabel": {
|
|
640
|
+
"type": "string",
|
|
641
|
+
"mutable": false,
|
|
642
|
+
"complexType": {
|
|
643
|
+
"original": "string",
|
|
644
|
+
"resolved": "string",
|
|
645
|
+
"references": {}
|
|
646
|
+
},
|
|
647
|
+
"required": false,
|
|
648
|
+
"optional": true,
|
|
649
|
+
"docs": {
|
|
650
|
+
"tags": [],
|
|
651
|
+
"text": "_[Optional]_\nString to show \"waiting start session\" label"
|
|
652
|
+
},
|
|
653
|
+
"attribute": "waiting-start-session-label",
|
|
654
|
+
"reflect": false,
|
|
655
|
+
"defaultValue": "\"waiting to start a session\""
|
|
656
|
+
},
|
|
657
|
+
"hideQrModalDescription": {
|
|
658
|
+
"type": "boolean",
|
|
659
|
+
"mutable": false,
|
|
660
|
+
"complexType": {
|
|
661
|
+
"original": "boolean",
|
|
662
|
+
"resolved": "boolean",
|
|
663
|
+
"references": {}
|
|
664
|
+
},
|
|
665
|
+
"required": false,
|
|
666
|
+
"optional": true,
|
|
667
|
+
"docs": {
|
|
668
|
+
"tags": [],
|
|
669
|
+
"text": "_[Optional]_\nBoolean to show or not show the QR Modal description"
|
|
670
|
+
},
|
|
671
|
+
"attribute": "hide-qr-modal-description",
|
|
672
|
+
"reflect": false,
|
|
673
|
+
"defaultValue": "false"
|
|
674
|
+
},
|
|
675
|
+
"sessionTimeout": {
|
|
676
|
+
"type": "number",
|
|
677
|
+
"mutable": false,
|
|
678
|
+
"complexType": {
|
|
679
|
+
"original": "number",
|
|
680
|
+
"resolved": "number",
|
|
681
|
+
"references": {}
|
|
682
|
+
},
|
|
683
|
+
"required": false,
|
|
684
|
+
"optional": true,
|
|
685
|
+
"docs": {
|
|
686
|
+
"tags": [],
|
|
687
|
+
"text": "_[Optional]_\nMaximum time window to display the session"
|
|
688
|
+
},
|
|
689
|
+
"attribute": "session-timeout",
|
|
690
|
+
"reflect": false,
|
|
691
|
+
"defaultValue": "DEFAULT_SESSION_TIMEOUT"
|
|
692
|
+
},
|
|
693
|
+
"pollingFrequency": {
|
|
694
|
+
"type": "number",
|
|
695
|
+
"mutable": false,
|
|
696
|
+
"complexType": {
|
|
697
|
+
"original": "number",
|
|
698
|
+
"resolved": "number",
|
|
699
|
+
"references": {}
|
|
700
|
+
},
|
|
701
|
+
"required": false,
|
|
702
|
+
"optional": true,
|
|
703
|
+
"docs": {
|
|
704
|
+
"tags": [],
|
|
705
|
+
"text": "_[Optional]_\nFrequency in seconds to check if the session has been validated"
|
|
706
|
+
},
|
|
707
|
+
"attribute": "polling-frequency",
|
|
708
|
+
"reflect": false,
|
|
709
|
+
"defaultValue": "DEFAULT_POLLING_FREQ"
|
|
710
|
+
},
|
|
711
|
+
"dynamicLink": {
|
|
712
|
+
"type": "boolean",
|
|
713
|
+
"mutable": false,
|
|
714
|
+
"complexType": {
|
|
715
|
+
"original": "boolean",
|
|
716
|
+
"resolved": "boolean",
|
|
717
|
+
"references": {}
|
|
718
|
+
},
|
|
719
|
+
"required": false,
|
|
720
|
+
"optional": true,
|
|
721
|
+
"docs": {
|
|
722
|
+
"tags": [],
|
|
723
|
+
"text": "_[Optional]_\nDisplay a link containing a dynamic link to invoke the wallet if closed"
|
|
724
|
+
},
|
|
725
|
+
"attribute": "dynamic-link",
|
|
726
|
+
"reflect": false,
|
|
727
|
+
"defaultValue": "true"
|
|
728
|
+
}
|
|
729
|
+
};
|
|
730
|
+
}
|
|
731
|
+
static get states() {
|
|
732
|
+
return {
|
|
733
|
+
"sessionId": {},
|
|
734
|
+
"authenticationRequest": {},
|
|
735
|
+
"sessionData": {},
|
|
736
|
+
"result": {}
|
|
737
|
+
};
|
|
738
|
+
}
|
|
739
|
+
static get events() {
|
|
740
|
+
return [{
|
|
741
|
+
"method": "gatacaLoginCompleted",
|
|
742
|
+
"name": "gatacaLoginCompleted",
|
|
743
|
+
"bubbles": true,
|
|
744
|
+
"cancelable": true,
|
|
745
|
+
"composed": true,
|
|
746
|
+
"docs": {
|
|
747
|
+
"tags": [],
|
|
748
|
+
"text": "GatacaLoginCompleted event, triggered with session data upon login success"
|
|
749
|
+
},
|
|
750
|
+
"complexType": {
|
|
751
|
+
"original": "any",
|
|
752
|
+
"resolved": "any",
|
|
753
|
+
"references": {}
|
|
754
|
+
}
|
|
755
|
+
}, {
|
|
756
|
+
"method": "gatacaLoginFailed",
|
|
757
|
+
"name": "gatacaLoginFailed",
|
|
758
|
+
"bubbles": true,
|
|
759
|
+
"cancelable": true,
|
|
760
|
+
"composed": true,
|
|
761
|
+
"docs": {
|
|
762
|
+
"tags": [],
|
|
763
|
+
"text": "GatacaLoginFailed event, triggered with error upon login failure"
|
|
764
|
+
},
|
|
765
|
+
"complexType": {
|
|
766
|
+
"original": "any",
|
|
767
|
+
"resolved": "any",
|
|
768
|
+
"references": {}
|
|
769
|
+
}
|
|
770
|
+
}];
|
|
771
|
+
}
|
|
772
|
+
static get methods() {
|
|
773
|
+
return {
|
|
774
|
+
"display": {
|
|
775
|
+
"complexType": {
|
|
776
|
+
"signature": "() => Promise<void>",
|
|
777
|
+
"parameters": [],
|
|
778
|
+
"references": {
|
|
779
|
+
"Promise": {
|
|
780
|
+
"location": "global"
|
|
781
|
+
},
|
|
782
|
+
"RESULT_STATUS": {
|
|
783
|
+
"location": "import",
|
|
784
|
+
"path": "../../utils/utils"
|
|
785
|
+
}
|
|
786
|
+
},
|
|
787
|
+
"return": "Promise<void>"
|
|
788
|
+
},
|
|
789
|
+
"docs": {
|
|
790
|
+
"text": "Force manually the display of a QR",
|
|
791
|
+
"tags": []
|
|
792
|
+
}
|
|
793
|
+
},
|
|
794
|
+
"stop": {
|
|
795
|
+
"complexType": {
|
|
796
|
+
"signature": "() => Promise<void>",
|
|
797
|
+
"parameters": [],
|
|
798
|
+
"references": {
|
|
799
|
+
"Promise": {
|
|
800
|
+
"location": "global"
|
|
801
|
+
}
|
|
802
|
+
},
|
|
803
|
+
"return": "Promise<void>"
|
|
804
|
+
},
|
|
805
|
+
"docs": {
|
|
806
|
+
"text": "Stop manually an ongoing session",
|
|
807
|
+
"tags": []
|
|
808
|
+
}
|
|
809
|
+
},
|
|
810
|
+
"getSessionData": {
|
|
811
|
+
"complexType": {
|
|
812
|
+
"signature": "() => Promise<any>",
|
|
813
|
+
"parameters": [],
|
|
814
|
+
"references": {
|
|
815
|
+
"Promise": {
|
|
816
|
+
"location": "global"
|
|
817
|
+
}
|
|
818
|
+
},
|
|
819
|
+
"return": "Promise<any>"
|
|
820
|
+
},
|
|
821
|
+
"docs": {
|
|
822
|
+
"text": "Retrieve manually the session data on a successful login",
|
|
823
|
+
"tags": []
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
};
|
|
827
|
+
}
|
|
828
|
+
}
|