@gataca/qr 2.0.2 → 2.0.4
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.cjs.entry.js +105 -0
- package/dist/cjs/gataca-qr_2.cjs.entry.js +219 -0
- package/dist/cjs/gataca-qrws.cjs.entry.js +176 -0
- package/dist/cjs/gataca-ssibutton_2.cjs.entry.js +129 -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/logo_gataca-f3dc6840.js +14 -0
- package/dist/cjs/qr-code-styling-412bbc7a.js +28 -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/components/gataca-autoqr.js +161 -0
- 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/components/gataca-qrws2.js +212 -0
- 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/{gatacaqr → esm}/gataca-autoqr.entry.js +1 -1
- package/dist/esm/gataca-qr_2.entry.js +214 -0
- package/dist/{gatacaqr → esm}/gataca-qrws.entry.js +4 -4
- package/dist/esm/gataca-ssibutton_2.entry.js +124 -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/logo_gataca-57ad0363.js +9 -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/esm/qr-code-styling-0eeb38d5.js +26 -0
- package/dist/gatacaqr/gatacaqr.esm.js +1 -129
- package/dist/gatacaqr/index.esm.js +1 -1
- package/dist/gatacaqr/p-0be4566d.js +1 -0
- package/dist/gatacaqr/p-5b17ef39.entry.js +1 -0
- package/dist/gatacaqr/p-5eb106c0.entry.js +1 -0
- package/dist/gatacaqr/p-66ad21ac.entry.js +1 -0
- package/dist/gatacaqr/p-6adc6933.js +1 -0
- package/dist/gatacaqr/p-a5648391.js +2 -0
- package/dist/gatacaqr/p-b834ef88.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 +76 -1
- package/dist/types/components/gataca-ssibutton/gataca-ssibutton.d.ts +75 -0
- package/dist/types/components.d.ts +242 -2
- package/package.json +2 -2
- 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,566 @@
|
|
|
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
|
+
const DEFAULT_SESSION_TIMEOUT = 300;
|
|
10
|
+
const QR_ROLE_CONNECT = "connect";
|
|
11
|
+
const FUNCTION_ROLES = {
|
|
12
|
+
connect: "scan",
|
|
13
|
+
certify: "credential",
|
|
14
|
+
};
|
|
15
|
+
export class GatacaQRWS {
|
|
16
|
+
constructor() { this.successCallback = undefined; this.errorCallback = undefined; this.qrRole = undefined; this.callbackServer = undefined; this.socketEndpoint = undefined; this.sessionTimeout = DEFAULT_SESSION_TIMEOUT; this.wsOnOpen = undefined; this.wsOnMessage = undefined; this.autostart = true; this.autorefresh = false; this.v2 = false; this.qrModalTitle = "Quick Access"; this.qrModalDescription = "Sign up or sign in by scanning the QR Code with the Gataca Wallet"; this.hideBrandTitle = false; this.dynamicLink = true; this.sessionId = undefined; this.authenticationRequest = undefined; this.sessionData = undefined; this.result = RESULT_STATUS.NOT_STARTED; }
|
|
17
|
+
disconnectedCallback() {
|
|
18
|
+
this.stop();
|
|
19
|
+
}
|
|
20
|
+
async componentDidLoad() {
|
|
21
|
+
if (this.autostart) {
|
|
22
|
+
await this.display();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Force manually the display of a QR
|
|
27
|
+
*/
|
|
28
|
+
async display() {
|
|
29
|
+
let socket = new WebSocket(this.socketEndpoint);
|
|
30
|
+
setTimeout(() => {
|
|
31
|
+
this.socket.close(1000, "");
|
|
32
|
+
}, 1000 * this.sessionTimeout);
|
|
33
|
+
this.socket = socket;
|
|
34
|
+
socket.onopen = () => {
|
|
35
|
+
if (this.wsOnOpen)
|
|
36
|
+
this.wsOnOpen(this.socket);
|
|
37
|
+
};
|
|
38
|
+
socket.onmessage = (msg) => {
|
|
39
|
+
if (this.wsOnMessage) {
|
|
40
|
+
this.wsOnMessage(this.socket, msg);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
let wsresp = JSON.parse(msg.data);
|
|
44
|
+
if (!!wsresp.sessionId) {
|
|
45
|
+
this.handleWSResponse(wsresp);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
socket.onerror = () => {
|
|
50
|
+
let error = new Error("Error connecting with server");
|
|
51
|
+
this.result = RESULT_STATUS.FAILED;
|
|
52
|
+
this.gatacaLoginFailed.emit(error);
|
|
53
|
+
this.errorCallback(error);
|
|
54
|
+
socket.close(1000, "");
|
|
55
|
+
};
|
|
56
|
+
socket.onclose = () => {
|
|
57
|
+
if (this.result === RESULT_STATUS.ONGOING) {
|
|
58
|
+
this.result = RESULT_STATUS.EXPIRED;
|
|
59
|
+
}
|
|
60
|
+
if (this.result === RESULT_STATUS.EXPIRED) {
|
|
61
|
+
if (this.autorefresh) {
|
|
62
|
+
this.display();
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
let error = new Error("User did not scan the QR in the alloted time");
|
|
66
|
+
this.gatacaLoginFailed.emit(error);
|
|
67
|
+
this.errorCallback(error);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
if (checkMobile() && this.dynamicLink) {
|
|
72
|
+
window.location.href = this.getLink();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
sessionMsgReceived(event) {
|
|
76
|
+
let wsresp = event.detail;
|
|
77
|
+
this.handleWSResponse(wsresp);
|
|
78
|
+
}
|
|
79
|
+
handleWSResponse(wsresp) {
|
|
80
|
+
this.result = wsresp.result;
|
|
81
|
+
switch (wsresp.result) {
|
|
82
|
+
case RESULT_STATUS.ONGOING:
|
|
83
|
+
this.sessionId = wsresp.sessionId;
|
|
84
|
+
this.authenticationRequest = wsresp.authenticationRequest;
|
|
85
|
+
break;
|
|
86
|
+
case RESULT_STATUS.SUCCESS:
|
|
87
|
+
this.sessionData = wsresp.authenticatedUserData;
|
|
88
|
+
this.gatacaLoginCompleted.emit(wsresp.authenticatedUserData);
|
|
89
|
+
this.successCallback(wsresp.authenticatedUserData);
|
|
90
|
+
this.socket.close(1000, "");
|
|
91
|
+
break;
|
|
92
|
+
case RESULT_STATUS.FAILED:
|
|
93
|
+
this.socket.close();
|
|
94
|
+
let error = new Error("Provided user credentials couldn't be validated");
|
|
95
|
+
this.gatacaLoginFailed.emit(error);
|
|
96
|
+
this.errorCallback(error);
|
|
97
|
+
break;
|
|
98
|
+
case RESULT_STATUS.EXPIRED:
|
|
99
|
+
this.socket.close();
|
|
100
|
+
if (this.autorefresh) {
|
|
101
|
+
this.display();
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
let error = new Error("User did not scan the QR in the alloted time");
|
|
105
|
+
this.gatacaLoginFailed.emit(error);
|
|
106
|
+
this.errorCallback(error);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Stop manually an ongoing session
|
|
112
|
+
*/
|
|
113
|
+
async stop() {
|
|
114
|
+
this.sessionData = undefined;
|
|
115
|
+
this.sessionId = undefined;
|
|
116
|
+
this.socket.close(1000, "Client stopped the connection");
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Retrieve manually the session data on a successful login
|
|
120
|
+
*/
|
|
121
|
+
async getSessionData() {
|
|
122
|
+
return this.sessionData
|
|
123
|
+
? Promise.resolve(this.sessionData)
|
|
124
|
+
: Promise.reject(new Error("No successful login"));
|
|
125
|
+
}
|
|
126
|
+
getLink() {
|
|
127
|
+
if (this.v2 && this.qrRole == QR_ROLE_CONNECT) {
|
|
128
|
+
return this.authenticationRequest;
|
|
129
|
+
}
|
|
130
|
+
let op = FUNCTION_ROLES[this.qrRole];
|
|
131
|
+
let link = "https://gataca.page.link/" + op + "?";
|
|
132
|
+
link +=
|
|
133
|
+
this.qrRole === QR_ROLE_CONNECT
|
|
134
|
+
? "session=" + this.sessionId
|
|
135
|
+
: "process=" + this.sessionId;
|
|
136
|
+
link +=
|
|
137
|
+
"&callback=" + base64UrlEncode(encodeURIComponent(this.callbackServer));
|
|
138
|
+
link = encodeURIComponent(link);
|
|
139
|
+
return this.dynamicLink ? DEEP_LINK_PREFIX + link : link;
|
|
140
|
+
}
|
|
141
|
+
renderQRSection() {
|
|
142
|
+
switch (this.result) {
|
|
143
|
+
case RESULT_STATUS.NOT_STARTED:
|
|
144
|
+
return this.renderRetryButton();
|
|
145
|
+
case RESULT_STATUS.ONGOING:
|
|
146
|
+
return this.renderQR(this.getLink(), 300, true);
|
|
147
|
+
case RESULT_STATUS.EXPIRED:
|
|
148
|
+
return this.renderRetryButton("QR Code expired");
|
|
149
|
+
case RESULT_STATUS.FAILED:
|
|
150
|
+
return this.renderRetryButton("User credentials not validated");
|
|
151
|
+
case RESULT_STATUS.SUCCESS:
|
|
152
|
+
return this.renderSuccess();
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
renderSuccess() {
|
|
156
|
+
return (h("div", { class: "success" }, h("img", { src: successIcon, height: 52, width: 52 }), h("p", { class: "successMsg" }, "Successful Connection!")));
|
|
157
|
+
}
|
|
158
|
+
renderRetryButton(errorMessage) {
|
|
159
|
+
return (h("div", { class: "reload" }, h("div", { id: "notify", onClick: () => this.display() }, h("img", { src: refreshIcon, height: 24, width: 24 }), h("p", { class: "qrDescription" }, "Click inside the box to "), errorMessage ? (h("p", { class: "qrDescription bold" }, "Refresh QR Code")) : (h("p", { class: "qrDescription bold" }, "Scan QR Code")), errorMessage && (h("div", { class: "alert" }, h("img", { src: alertIcon, height: 24, width: 24 }), h("p", null, errorMessage)))), h("div", { id: "qrwait" }, this.renderQR("waiting to start a session", 250))));
|
|
160
|
+
}
|
|
161
|
+
renderQR(value, size, useLogo) {
|
|
162
|
+
return (h("gataca-qrdisplay", { qrData: value, rounded: true, size: size, "logo-size": useLogo ? 0.33 : 0 }));
|
|
163
|
+
}
|
|
164
|
+
render() {
|
|
165
|
+
return (h("div", { class: "popUpContainer" }, h("div", { class: "modal-window is-visible", onClick: (event) => {
|
|
166
|
+
event.stopPropagation();
|
|
167
|
+
} }, h("div", { class: "modal-window__content" }, h("div", { class: "qrTitleContainer" }, h("p", { class: "qrTitle" }, this.qrModalTitle), !this.hideBrandTitle && (h("p", { class: "qrBrand" }, "by Gataca", " ", h("span", null, h("img", { src: logoGataca })))), this.result !== RESULT_STATUS.SUCCESS && (h("p", { class: "qrDescription" }, this.qrModalDescription))), h("div", { class: "qrSection" }, this.renderQRSection())))));
|
|
168
|
+
}
|
|
169
|
+
static get is() { return "gataca-qrws"; }
|
|
170
|
+
static get encapsulation() { return "shadow"; }
|
|
171
|
+
static get originalStyleUrls() {
|
|
172
|
+
return {
|
|
173
|
+
"$": ["gataca-qrws.scss"]
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
static get styleUrls() {
|
|
177
|
+
return {
|
|
178
|
+
"$": ["gataca-qrws.css"]
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
static get properties() {
|
|
182
|
+
return {
|
|
183
|
+
"successCallback": {
|
|
184
|
+
"type": "unknown",
|
|
185
|
+
"mutable": false,
|
|
186
|
+
"complexType": {
|
|
187
|
+
"original": "(data?: any) => void",
|
|
188
|
+
"resolved": "(data?: any) => void",
|
|
189
|
+
"references": {}
|
|
190
|
+
},
|
|
191
|
+
"required": false,
|
|
192
|
+
"optional": false,
|
|
193
|
+
"docs": {
|
|
194
|
+
"tags": [],
|
|
195
|
+
"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"
|
|
196
|
+
},
|
|
197
|
+
"defaultValue": "undefined"
|
|
198
|
+
},
|
|
199
|
+
"errorCallback": {
|
|
200
|
+
"type": "unknown",
|
|
201
|
+
"mutable": false,
|
|
202
|
+
"complexType": {
|
|
203
|
+
"original": "(error?: Error) => void",
|
|
204
|
+
"resolved": "(error?: Error) => void",
|
|
205
|
+
"references": {
|
|
206
|
+
"Error": {
|
|
207
|
+
"location": "global"
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
"required": false,
|
|
212
|
+
"optional": false,
|
|
213
|
+
"docs": {
|
|
214
|
+
"tags": [],
|
|
215
|
+
"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"
|
|
216
|
+
},
|
|
217
|
+
"defaultValue": "undefined"
|
|
218
|
+
},
|
|
219
|
+
"qrRole": {
|
|
220
|
+
"type": "string",
|
|
221
|
+
"mutable": false,
|
|
222
|
+
"complexType": {
|
|
223
|
+
"original": "string",
|
|
224
|
+
"resolved": "string",
|
|
225
|
+
"references": {}
|
|
226
|
+
},
|
|
227
|
+
"required": false,
|
|
228
|
+
"optional": false,
|
|
229
|
+
"docs": {
|
|
230
|
+
"tags": [],
|
|
231
|
+
"text": "***Mandatory***\nDecide if scanning the credential as a verifier to request credentials\nor as an issuer too issue credentials.\nOptions: connect | certify"
|
|
232
|
+
},
|
|
233
|
+
"attribute": "qr-role",
|
|
234
|
+
"reflect": false
|
|
235
|
+
},
|
|
236
|
+
"callbackServer": {
|
|
237
|
+
"type": "string",
|
|
238
|
+
"mutable": false,
|
|
239
|
+
"complexType": {
|
|
240
|
+
"original": "string",
|
|
241
|
+
"resolved": "string",
|
|
242
|
+
"references": {}
|
|
243
|
+
},
|
|
244
|
+
"required": false,
|
|
245
|
+
"optional": false,
|
|
246
|
+
"docs": {
|
|
247
|
+
"tags": [],
|
|
248
|
+
"text": "***Mandatory just for V1***\nConnect/Certify Server where the wallet will send the data"
|
|
249
|
+
},
|
|
250
|
+
"attribute": "callback-server",
|
|
251
|
+
"reflect": false
|
|
252
|
+
},
|
|
253
|
+
"socketEndpoint": {
|
|
254
|
+
"type": "string",
|
|
255
|
+
"mutable": false,
|
|
256
|
+
"complexType": {
|
|
257
|
+
"original": "string",
|
|
258
|
+
"resolved": "string",
|
|
259
|
+
"references": {}
|
|
260
|
+
},
|
|
261
|
+
"required": false,
|
|
262
|
+
"optional": false,
|
|
263
|
+
"docs": {
|
|
264
|
+
"tags": [],
|
|
265
|
+
"text": "***Mandatory***\nWS Endpoint on your service to be invoked upon display"
|
|
266
|
+
},
|
|
267
|
+
"attribute": "socket-endpoint",
|
|
268
|
+
"reflect": false
|
|
269
|
+
},
|
|
270
|
+
"sessionTimeout": {
|
|
271
|
+
"type": "number",
|
|
272
|
+
"mutable": false,
|
|
273
|
+
"complexType": {
|
|
274
|
+
"original": "number",
|
|
275
|
+
"resolved": "number",
|
|
276
|
+
"references": {}
|
|
277
|
+
},
|
|
278
|
+
"required": false,
|
|
279
|
+
"optional": true,
|
|
280
|
+
"docs": {
|
|
281
|
+
"tags": [],
|
|
282
|
+
"text": "***Mandatory***\nMaximum time window to display the session and keep the websocket connection. It's needed to ensure the socket is closed."
|
|
283
|
+
},
|
|
284
|
+
"attribute": "session-timeout",
|
|
285
|
+
"reflect": false,
|
|
286
|
+
"defaultValue": "DEFAULT_SESSION_TIMEOUT"
|
|
287
|
+
},
|
|
288
|
+
"wsOnOpen": {
|
|
289
|
+
"type": "unknown",
|
|
290
|
+
"mutable": false,
|
|
291
|
+
"complexType": {
|
|
292
|
+
"original": "(socket: WebSocket) => void",
|
|
293
|
+
"resolved": "(socket: WebSocket) => void",
|
|
294
|
+
"references": {
|
|
295
|
+
"WebSocket": {
|
|
296
|
+
"location": "global"
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
"required": false,
|
|
301
|
+
"optional": false,
|
|
302
|
+
"docs": {
|
|
303
|
+
"tags": [],
|
|
304
|
+
"text": "[Optional]\nFunction to send a message to the server upon socket creation"
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
"wsOnMessage": {
|
|
308
|
+
"type": "unknown",
|
|
309
|
+
"mutable": false,
|
|
310
|
+
"complexType": {
|
|
311
|
+
"original": "(socket: WebSocket, msg: MessageEvent) => void",
|
|
312
|
+
"resolved": "(socket: WebSocket, msg: MessageEvent<any>) => void",
|
|
313
|
+
"references": {
|
|
314
|
+
"WebSocket": {
|
|
315
|
+
"location": "global"
|
|
316
|
+
},
|
|
317
|
+
"MessageEvent": {
|
|
318
|
+
"location": "global"
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
"required": false,
|
|
323
|
+
"optional": false,
|
|
324
|
+
"docs": {
|
|
325
|
+
"tags": [],
|
|
326
|
+
"text": "**RECOMMENDED**\nCallback to invoke an a message has been received on the socket. It provides the socket itself and the message as parameters.\nIf not used, the messages provided by the server on the Socket connection must conform to the WSReponse interface\nIf used, an Event named **sessionMsg** must be triggered with a WSReponse as data"
|
|
327
|
+
}
|
|
328
|
+
},
|
|
329
|
+
"autostart": {
|
|
330
|
+
"type": "boolean",
|
|
331
|
+
"mutable": false,
|
|
332
|
+
"complexType": {
|
|
333
|
+
"original": "boolean",
|
|
334
|
+
"resolved": "boolean",
|
|
335
|
+
"references": {}
|
|
336
|
+
},
|
|
337
|
+
"required": false,
|
|
338
|
+
"optional": false,
|
|
339
|
+
"docs": {
|
|
340
|
+
"tags": [],
|
|
341
|
+
"text": "_[Optional]_\nSet to enable autoload when the QR is displayed. By default it is true"
|
|
342
|
+
},
|
|
343
|
+
"attribute": "autostart",
|
|
344
|
+
"reflect": false,
|
|
345
|
+
"defaultValue": "true"
|
|
346
|
+
},
|
|
347
|
+
"autorefresh": {
|
|
348
|
+
"type": "boolean",
|
|
349
|
+
"mutable": false,
|
|
350
|
+
"complexType": {
|
|
351
|
+
"original": "boolean",
|
|
352
|
+
"resolved": "boolean",
|
|
353
|
+
"references": {}
|
|
354
|
+
},
|
|
355
|
+
"required": false,
|
|
356
|
+
"optional": false,
|
|
357
|
+
"docs": {
|
|
358
|
+
"tags": [],
|
|
359
|
+
"text": "_[Optional]_\nSet to refresh the session automatically upon expiration. By default it is false"
|
|
360
|
+
},
|
|
361
|
+
"attribute": "autorefresh",
|
|
362
|
+
"reflect": false,
|
|
363
|
+
"defaultValue": "false"
|
|
364
|
+
},
|
|
365
|
+
"v2": {
|
|
366
|
+
"type": "boolean",
|
|
367
|
+
"mutable": false,
|
|
368
|
+
"complexType": {
|
|
369
|
+
"original": "boolean",
|
|
370
|
+
"resolved": "boolean",
|
|
371
|
+
"references": {}
|
|
372
|
+
},
|
|
373
|
+
"required": false,
|
|
374
|
+
"optional": true,
|
|
375
|
+
"docs": {
|
|
376
|
+
"tags": [],
|
|
377
|
+
"text": "**RECOMMENDED**\nSet to use v2 links. The create session must be providing both an authentication request and a session Id"
|
|
378
|
+
},
|
|
379
|
+
"attribute": "v-2",
|
|
380
|
+
"reflect": false,
|
|
381
|
+
"defaultValue": "false"
|
|
382
|
+
},
|
|
383
|
+
"qrModalTitle": {
|
|
384
|
+
"type": "string",
|
|
385
|
+
"mutable": false,
|
|
386
|
+
"complexType": {
|
|
387
|
+
"original": "string",
|
|
388
|
+
"resolved": "string",
|
|
389
|
+
"references": {}
|
|
390
|
+
},
|
|
391
|
+
"required": false,
|
|
392
|
+
"optional": true,
|
|
393
|
+
"docs": {
|
|
394
|
+
"tags": [],
|
|
395
|
+
"text": "_[Optional]_\nModifies the qr headline title"
|
|
396
|
+
},
|
|
397
|
+
"attribute": "qr-modal-title",
|
|
398
|
+
"reflect": false,
|
|
399
|
+
"defaultValue": "\"Quick Access\""
|
|
400
|
+
},
|
|
401
|
+
"qrModalDescription": {
|
|
402
|
+
"type": "string",
|
|
403
|
+
"mutable": false,
|
|
404
|
+
"complexType": {
|
|
405
|
+
"original": "string",
|
|
406
|
+
"resolved": "string",
|
|
407
|
+
"references": {}
|
|
408
|
+
},
|
|
409
|
+
"required": false,
|
|
410
|
+
"optional": true,
|
|
411
|
+
"docs": {
|
|
412
|
+
"tags": [],
|
|
413
|
+
"text": "_[Optional]_\nModifies the Modal description"
|
|
414
|
+
},
|
|
415
|
+
"attribute": "qr-modal-description",
|
|
416
|
+
"reflect": false,
|
|
417
|
+
"defaultValue": "\"Sign up or sign in by scanning the QR Code with the Gataca Wallet\""
|
|
418
|
+
},
|
|
419
|
+
"hideBrandTitle": {
|
|
420
|
+
"type": "boolean",
|
|
421
|
+
"mutable": false,
|
|
422
|
+
"complexType": {
|
|
423
|
+
"original": "boolean",
|
|
424
|
+
"resolved": "boolean",
|
|
425
|
+
"references": {}
|
|
426
|
+
},
|
|
427
|
+
"required": false,
|
|
428
|
+
"optional": true,
|
|
429
|
+
"docs": {
|
|
430
|
+
"tags": [],
|
|
431
|
+
"text": "_[Optional]_\nBoolean to show or not show the gataca brand title"
|
|
432
|
+
},
|
|
433
|
+
"attribute": "hide-brand-title",
|
|
434
|
+
"reflect": false,
|
|
435
|
+
"defaultValue": "false"
|
|
436
|
+
},
|
|
437
|
+
"dynamicLink": {
|
|
438
|
+
"type": "boolean",
|
|
439
|
+
"mutable": false,
|
|
440
|
+
"complexType": {
|
|
441
|
+
"original": "boolean",
|
|
442
|
+
"resolved": "boolean",
|
|
443
|
+
"references": {}
|
|
444
|
+
},
|
|
445
|
+
"required": false,
|
|
446
|
+
"optional": true,
|
|
447
|
+
"docs": {
|
|
448
|
+
"tags": [],
|
|
449
|
+
"text": "_[Optional]_\nDisplay a link containing a dynamic link to invoke the wallet if closed"
|
|
450
|
+
},
|
|
451
|
+
"attribute": "dynamic-link",
|
|
452
|
+
"reflect": false,
|
|
453
|
+
"defaultValue": "true"
|
|
454
|
+
}
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
static get states() {
|
|
458
|
+
return {
|
|
459
|
+
"sessionId": {},
|
|
460
|
+
"authenticationRequest": {},
|
|
461
|
+
"sessionData": {},
|
|
462
|
+
"result": {}
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
static get events() {
|
|
466
|
+
return [{
|
|
467
|
+
"method": "gatacaLoginCompleted",
|
|
468
|
+
"name": "gatacaLoginCompleted",
|
|
469
|
+
"bubbles": true,
|
|
470
|
+
"cancelable": true,
|
|
471
|
+
"composed": true,
|
|
472
|
+
"docs": {
|
|
473
|
+
"tags": [],
|
|
474
|
+
"text": "GatacaLoginCompleted event, triggered with session data upon login success"
|
|
475
|
+
},
|
|
476
|
+
"complexType": {
|
|
477
|
+
"original": "any",
|
|
478
|
+
"resolved": "any",
|
|
479
|
+
"references": {}
|
|
480
|
+
}
|
|
481
|
+
}, {
|
|
482
|
+
"method": "gatacaLoginFailed",
|
|
483
|
+
"name": "gatacaLoginFailed",
|
|
484
|
+
"bubbles": true,
|
|
485
|
+
"cancelable": true,
|
|
486
|
+
"composed": true,
|
|
487
|
+
"docs": {
|
|
488
|
+
"tags": [],
|
|
489
|
+
"text": "GatacaLoginFailed event, triggered with error upon login failure"
|
|
490
|
+
},
|
|
491
|
+
"complexType": {
|
|
492
|
+
"original": "any",
|
|
493
|
+
"resolved": "any",
|
|
494
|
+
"references": {}
|
|
495
|
+
}
|
|
496
|
+
}];
|
|
497
|
+
}
|
|
498
|
+
static get methods() {
|
|
499
|
+
return {
|
|
500
|
+
"display": {
|
|
501
|
+
"complexType": {
|
|
502
|
+
"signature": "() => Promise<void>",
|
|
503
|
+
"parameters": [],
|
|
504
|
+
"references": {
|
|
505
|
+
"Promise": {
|
|
506
|
+
"location": "global"
|
|
507
|
+
},
|
|
508
|
+
"MessageEvent": {
|
|
509
|
+
"location": "global"
|
|
510
|
+
},
|
|
511
|
+
"WSResponse": {
|
|
512
|
+
"location": "import",
|
|
513
|
+
"path": "../../utils/utils"
|
|
514
|
+
}
|
|
515
|
+
},
|
|
516
|
+
"return": "Promise<void>"
|
|
517
|
+
},
|
|
518
|
+
"docs": {
|
|
519
|
+
"text": "Force manually the display of a QR",
|
|
520
|
+
"tags": []
|
|
521
|
+
}
|
|
522
|
+
},
|
|
523
|
+
"stop": {
|
|
524
|
+
"complexType": {
|
|
525
|
+
"signature": "() => Promise<void>",
|
|
526
|
+
"parameters": [],
|
|
527
|
+
"references": {
|
|
528
|
+
"Promise": {
|
|
529
|
+
"location": "global"
|
|
530
|
+
}
|
|
531
|
+
},
|
|
532
|
+
"return": "Promise<void>"
|
|
533
|
+
},
|
|
534
|
+
"docs": {
|
|
535
|
+
"text": "Stop manually an ongoing session",
|
|
536
|
+
"tags": []
|
|
537
|
+
}
|
|
538
|
+
},
|
|
539
|
+
"getSessionData": {
|
|
540
|
+
"complexType": {
|
|
541
|
+
"signature": "() => Promise<any>",
|
|
542
|
+
"parameters": [],
|
|
543
|
+
"references": {
|
|
544
|
+
"Promise": {
|
|
545
|
+
"location": "global"
|
|
546
|
+
}
|
|
547
|
+
},
|
|
548
|
+
"return": "Promise<any>"
|
|
549
|
+
},
|
|
550
|
+
"docs": {
|
|
551
|
+
"text": "Retrieve manually the session data on a successful login",
|
|
552
|
+
"tags": []
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
};
|
|
556
|
+
}
|
|
557
|
+
static get listeners() {
|
|
558
|
+
return [{
|
|
559
|
+
"name": "sessionMsg",
|
|
560
|
+
"method": "sessionMsgReceived",
|
|
561
|
+
"target": undefined,
|
|
562
|
+
"capture": true,
|
|
563
|
+
"passive": false
|
|
564
|
+
}];
|
|
565
|
+
}
|
|
566
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/* http://meyerweb.com/eric/tools/css/reset/
|
|
2
|
+
v2.0 | 20110126
|
|
3
|
+
License: none (public domain)
|
|
4
|
+
*/
|
|
5
|
+
@import url("https://fonts.googleapis.com/css2?family=Work+Sans:wght@300;400&display=swap");
|
|
6
|
+
html, body, div, span, applet, object, iframe,
|
|
7
|
+
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
|
8
|
+
a, abbr, acronym, address, big, cite, code,
|
|
9
|
+
del, dfn, em, img, ins, kbd, q, s, samp,
|
|
10
|
+
small, strike, strong, sub, sup, tt, var,
|
|
11
|
+
b, u, i, center,
|
|
12
|
+
dl, dt, dd, ol, ul, li,
|
|
13
|
+
fieldset, form, label, legend,
|
|
14
|
+
table, caption, tbody, tfoot, thead, tr, th, td,
|
|
15
|
+
article, aside, canvas, details, embed,
|
|
16
|
+
figure, figcaption, footer, header, hgroup,
|
|
17
|
+
menu, nav, output, ruby, section, summary,
|
|
18
|
+
time, mark, audio, video {
|
|
19
|
+
margin: 0;
|
|
20
|
+
padding: 0;
|
|
21
|
+
border: 0;
|
|
22
|
+
font-size: 100%;
|
|
23
|
+
font: inherit;
|
|
24
|
+
vertical-align: baseline;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* HTML5 display-role reset for older browsers */
|
|
28
|
+
article, aside, details, figcaption, figure,
|
|
29
|
+
footer, header, hgroup, menu, nav, section {
|
|
30
|
+
display: block;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
body {
|
|
34
|
+
line-height: 1;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
ol, ul {
|
|
38
|
+
list-style: none;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
blockquote, q {
|
|
42
|
+
quotes: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
blockquote:before, blockquote:after,
|
|
46
|
+
q:before, q:after {
|
|
47
|
+
content: "";
|
|
48
|
+
content: none;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
table {
|
|
52
|
+
border-collapse: collapse;
|
|
53
|
+
border-spacing: 0;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/*
|
|
57
|
+
QR COMPONENT
|
|
58
|
+
*/
|
|
59
|
+
.img-fluid {
|
|
60
|
+
height: auto;
|
|
61
|
+
max-width: 50%;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
img {
|
|
65
|
+
margin-left: auto;
|
|
66
|
+
margin-right: auto;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.buttonContainer {
|
|
70
|
+
display: inline-block;
|
|
71
|
+
text-align: right;
|
|
72
|
+
padding: 10px;
|
|
73
|
+
position: relative;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.gatacaButtonWrapper {
|
|
77
|
+
margin: 8px;
|
|
78
|
+
}
|
|
79
|
+
.gatacaButtonWrapper .gatacaButton {
|
|
80
|
+
display: flex;
|
|
81
|
+
min-width: 100px;
|
|
82
|
+
padding: 8px 8px;
|
|
83
|
+
background-color: white;
|
|
84
|
+
font-size: 12px;
|
|
85
|
+
font-family: "Work Sans", sans-serif;
|
|
86
|
+
letter-spacing: 1px;
|
|
87
|
+
font-weight: 2;
|
|
88
|
+
justify-content: space-between;
|
|
89
|
+
align-items: center;
|
|
90
|
+
border-radius: 6px;
|
|
91
|
+
border: 1px solid rgba(24, 27, 94, 0.5);
|
|
92
|
+
color: rgba(24, 27, 94, 0.8);
|
|
93
|
+
box-shadow: 0px 1px 3px rgba(48, 48, 48, 0.15);
|
|
94
|
+
cursor: pointer;
|
|
95
|
+
}
|
|
96
|
+
.gatacaButtonWrapper .gatacaButton > span {
|
|
97
|
+
margin-right: 10px;
|
|
98
|
+
}
|
|
99
|
+
.gatacaButtonWrapper .gatacaButton:hover {
|
|
100
|
+
box-shadow: 0px 2px 8px rgba(48, 48, 48, 0.1);
|
|
101
|
+
}
|
|
102
|
+
.gatacaButtonWrapper .buttonText {
|
|
103
|
+
text-align: right;
|
|
104
|
+
font-size: 8px;
|
|
105
|
+
color: rgba(24, 27, 94, 0.5);
|
|
106
|
+
font-family: "Helvetica Neue", sans-serif;
|
|
107
|
+
letter-spacing: 1px;
|
|
108
|
+
padding-right: 8px;
|
|
109
|
+
font-weight: 1;
|
|
110
|
+
}
|
|
111
|
+
.gatacaButtonWrapper .buttonImg {
|
|
112
|
+
height: 25px;
|
|
113
|
+
width: 25px;
|
|
114
|
+
margin: 0;
|
|
115
|
+
margin-right: 20px;
|
|
116
|
+
}
|