@gataca/qr 2.0.0
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/LICENSE +21 -0
- package/dist/cjs/gat-icon-refresh-751505ff.js +14 -0
- package/dist/cjs/gataca-autoqr.cjs.entry.js +88 -0
- package/dist/cjs/gataca-qr.cjs.entry.js +175 -0
- package/dist/cjs/gataca-qrdisplay_2.cjs.entry.js +219 -0
- package/dist/cjs/gataca-ssibutton_2.cjs.entry.js +114 -0
- package/dist/cjs/gatacaqr.cjs.js +19 -0
- package/dist/cjs/index-0b7a1532.js +1410 -0
- package/dist/cjs/index.cjs.js +16 -0
- package/dist/cjs/loader.cjs.js +21 -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 +306 -0
- package/dist/collection/components/gataca-qr/gataca-qr.css +249 -0
- package/dist/collection/components/gataca-qr/gataca-qr.js +557 -0
- package/dist/collection/components/gataca-qrdisplay/gataca-qrdisplay.js +154 -0
- package/dist/collection/components/gataca-qrws/gataca-qrws.css +249 -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 +395 -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/components/gat-icon-refresh.js +29 -0
- package/dist/components/gataca-autoqr.d.ts +11 -0
- package/dist/components/gataca-autoqr.js +144 -0
- package/dist/components/gataca-qr.d.ts +11 -0
- package/dist/components/gataca-qr.js +6 -0
- package/dist/components/gataca-qr2.js +211 -0
- package/dist/components/gataca-qrdisplay.d.ts +11 -0
- package/dist/components/gataca-qrdisplay.js +6 -0
- package/dist/components/gataca-qrdisplay2.js +93 -0
- package/dist/components/gataca-qrws.d.ts +11 -0
- package/dist/components/gataca-qrws.js +6 -0
- package/dist/components/gataca-qrws2.js +212 -0
- package/dist/components/gataca-ssibutton.d.ts +11 -0
- package/dist/components/gataca-ssibutton.js +6 -0
- package/dist/components/gataca-ssibutton2.js +100 -0
- package/dist/components/gataca-ssibuttonws.d.ts +11 -0
- package/dist/components/gataca-ssibuttonws.js +6 -0
- package/dist/components/gataca-ssibuttonws2.js +102 -0
- package/dist/components/index.d.ts +27 -0
- package/dist/components/index.js +8 -0
- package/dist/esm/gat-icon-refresh-179ea123.js +9 -0
- package/dist/esm/gataca-autoqr.entry.js +84 -0
- package/dist/esm/gataca-qr.entry.js +171 -0
- package/dist/esm/gataca-qrdisplay_2.entry.js +214 -0
- package/dist/esm/gataca-ssibutton_2.entry.js +109 -0
- package/dist/esm/gatacaqr.js +17 -0
- package/dist/esm/index-19eef502.js +1384 -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/esm/qr-code-styling-0eeb38d5.js +26 -0
- package/dist/esm/utils-05ba6c9f.js +23 -0
- package/dist/gatacaqr/gatacaqr.esm.js +1 -0
- package/dist/gatacaqr/index.esm.js +1 -0
- package/dist/gatacaqr/p-0905677f.entry.js +1 -0
- package/dist/gatacaqr/p-0be4566d.js +1 -0
- package/dist/gatacaqr/p-1d35273f.entry.js +1 -0
- package/dist/gatacaqr/p-2f22c7fc.js +1 -0
- package/dist/gatacaqr/p-4139a068.entry.js +1 -0
- package/dist/gatacaqr/p-a6f85341.js +2 -0
- package/dist/gatacaqr/p-b8ba109f.js +1 -0
- package/dist/gatacaqr/p-f85d7e76.entry.js +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/components/gataca-autoqr/gataca-autoqr.d.ts +85 -0
- package/dist/types/components/gataca-qr/gataca-qr.d.ts +131 -0
- package/dist/types/components/gataca-qrdisplay/gataca-qrdisplay.d.ts +35 -0
- package/dist/types/components/gataca-qrws/gataca-qrws.d.ts +124 -0
- package/dist/types/components/gataca-ssibutton/gataca-ssibutton.d.ts +114 -0
- package/dist/types/components/gataca-ssibuttonws/gataca-ssibuttonws.d.ts +110 -0
- package/dist/types/components.d.ts +830 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/stencil-public-runtime.d.ts +1581 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/utils.d.ts +56 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +12 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +11 -0
- package/package.json +40 -0
- package/readme.md +67 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { EventEmitter } from "../../stencil-public-runtime";
|
|
2
|
+
import "../gataca-qrdisplay/gataca-qrdisplay";
|
|
3
|
+
import { RESULT_STATUS } from "../../utils/utils";
|
|
4
|
+
export declare class GatacaQR {
|
|
5
|
+
constructor();
|
|
6
|
+
disconnectedCallback(): void;
|
|
7
|
+
/**
|
|
8
|
+
* ***Mandatory***
|
|
9
|
+
* Check status function to query the current status of the session
|
|
10
|
+
* The function must query a client endpoint to check the status. That endpoint must return an error if the session has expired.
|
|
11
|
+
*/
|
|
12
|
+
checkStatus?: (id?: string) => Promise<{
|
|
13
|
+
result: RESULT_STATUS;
|
|
14
|
+
data?: any;
|
|
15
|
+
}>;
|
|
16
|
+
/**
|
|
17
|
+
* ***Mandatory***
|
|
18
|
+
* Create session function to generate a new Session
|
|
19
|
+
* Using V1, it can provide just a session Id
|
|
20
|
+
* Using V2, it must provide also the authentication request. The session Id is the id of the presentation definition
|
|
21
|
+
*/
|
|
22
|
+
createSession?: () => Promise<{
|
|
23
|
+
sessionId: string;
|
|
24
|
+
authenticationRequest?: string;
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* ***Mandatory***
|
|
28
|
+
* Callback fired upon session correctly verified
|
|
29
|
+
* If not set, session validation wouldn't trigger any action
|
|
30
|
+
* The session data and a possible token will be sent as parameters to the callback
|
|
31
|
+
*/
|
|
32
|
+
successCallback: (data?: any) => void;
|
|
33
|
+
/**
|
|
34
|
+
* ***Mandatory***
|
|
35
|
+
* Callback fired upon session expired or invalid
|
|
36
|
+
* If not set, session error would not be handled
|
|
37
|
+
* An error containing information will be passed as parameter
|
|
38
|
+
*/
|
|
39
|
+
errorCallback: (error?: Error) => void;
|
|
40
|
+
/**
|
|
41
|
+
* ***Mandatory***
|
|
42
|
+
* Decide if scanning the credential as a verifier to request credentials
|
|
43
|
+
* or as an issuer too issue credentials.
|
|
44
|
+
* Options: connect | certify
|
|
45
|
+
*/
|
|
46
|
+
qrRole: string;
|
|
47
|
+
/**
|
|
48
|
+
* ***Mandatory just for V1***
|
|
49
|
+
* Connect/Certify Server where the wallet will send the data
|
|
50
|
+
*/
|
|
51
|
+
callbackServer: string;
|
|
52
|
+
/**
|
|
53
|
+
* _[Optional]_
|
|
54
|
+
* Set to enable autoload when the QR is displayed. By default it is true
|
|
55
|
+
*/
|
|
56
|
+
autostart: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* _[Optional]_
|
|
59
|
+
* Set to refresh the session automatically upon expiration. By default it is false
|
|
60
|
+
*/
|
|
61
|
+
autorefresh: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* _[Optional]_
|
|
64
|
+
* Set to use v2 links. The create session must be providing both an authentication request and a session Id
|
|
65
|
+
*/
|
|
66
|
+
v2?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* _[Optional]_
|
|
69
|
+
* Modifies the qr headline title
|
|
70
|
+
*/
|
|
71
|
+
qrModalTitle?: string;
|
|
72
|
+
/**
|
|
73
|
+
* _[Optional]_
|
|
74
|
+
* Modifies the Modal description
|
|
75
|
+
*/
|
|
76
|
+
qrModalDescription?: string;
|
|
77
|
+
/**
|
|
78
|
+
* _[Optional]_
|
|
79
|
+
* Boolean to show or not show the gataca brand title
|
|
80
|
+
*/
|
|
81
|
+
hideBrandTitle?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* _[Optional]_
|
|
84
|
+
* Maximum time window to display the session
|
|
85
|
+
*/
|
|
86
|
+
sessionTimeout?: number;
|
|
87
|
+
/**
|
|
88
|
+
* _[Optional]_
|
|
89
|
+
* Frequency in seconds to check if the session has been validated
|
|
90
|
+
*/
|
|
91
|
+
pollingFrequency?: number;
|
|
92
|
+
/**
|
|
93
|
+
* _[Optional]_
|
|
94
|
+
* Display a link containing a dynamic link to invoke the wallet if closed
|
|
95
|
+
*/
|
|
96
|
+
dynamicLink?: boolean;
|
|
97
|
+
sessionId?: string;
|
|
98
|
+
authenticationRequest?: string;
|
|
99
|
+
sessionData: any;
|
|
100
|
+
result: RESULT_STATUS;
|
|
101
|
+
componentDidLoad(): Promise<void>;
|
|
102
|
+
/**
|
|
103
|
+
* GatacaLoginCompleted event, triggered with session data upon login success
|
|
104
|
+
*/
|
|
105
|
+
gatacaLoginCompleted: EventEmitter;
|
|
106
|
+
/**
|
|
107
|
+
* GatacaLoginFailed event, triggered with error upon login failure
|
|
108
|
+
*/
|
|
109
|
+
gatacaLoginFailed: EventEmitter;
|
|
110
|
+
/**
|
|
111
|
+
* Force manually the display of a QR
|
|
112
|
+
*/
|
|
113
|
+
display(): Promise<void>;
|
|
114
|
+
/**
|
|
115
|
+
* Stop manually an ongoing session
|
|
116
|
+
*/
|
|
117
|
+
stop(): Promise<void>;
|
|
118
|
+
clean(): void;
|
|
119
|
+
/**
|
|
120
|
+
* Retrieve manually the session data on a successful login
|
|
121
|
+
*/
|
|
122
|
+
getSessionData(): Promise<any>;
|
|
123
|
+
getSessionId(): Promise<string>;
|
|
124
|
+
getLink(): string;
|
|
125
|
+
poll(): Promise<unknown>;
|
|
126
|
+
renderQRSection(): any;
|
|
127
|
+
renderSuccess(): any;
|
|
128
|
+
renderRetryButton(errorMessage?: string): any;
|
|
129
|
+
renderQR(value: string, size: number, useLogo?: boolean): any;
|
|
130
|
+
render(): any;
|
|
131
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare class GatacaQRDisplay {
|
|
2
|
+
private qr;
|
|
3
|
+
componentDidLoad(): void;
|
|
4
|
+
/**
|
|
5
|
+
* _[Mandatory]_
|
|
6
|
+
* Sets the contents of the QR
|
|
7
|
+
*/
|
|
8
|
+
qrData: string;
|
|
9
|
+
/**
|
|
10
|
+
* _[Optional]_
|
|
11
|
+
* Size of the QR Displayed
|
|
12
|
+
*/
|
|
13
|
+
size?: number;
|
|
14
|
+
/**
|
|
15
|
+
* _[Optional]_
|
|
16
|
+
* Size 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
|
|
17
|
+
*/
|
|
18
|
+
logoSize?: number;
|
|
19
|
+
/**
|
|
20
|
+
* _[Optional]_
|
|
21
|
+
* Logo to display, just if the logo size is greater than 0. No logo is the GATACA logo.
|
|
22
|
+
*/
|
|
23
|
+
logoSrc?: string;
|
|
24
|
+
/**
|
|
25
|
+
* _[Optional]_
|
|
26
|
+
* QR Color.
|
|
27
|
+
*/
|
|
28
|
+
qrColor?: string;
|
|
29
|
+
/**
|
|
30
|
+
* _[Optional]_
|
|
31
|
+
* Round usage
|
|
32
|
+
*/
|
|
33
|
+
rounded?: boolean;
|
|
34
|
+
render(): any;
|
|
35
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { EventEmitter } from "../../stencil-public-runtime";
|
|
2
|
+
import "../gataca-qrdisplay/gataca-qrdisplay";
|
|
3
|
+
import { RESULT_STATUS, WSResponse } from "../../utils/utils";
|
|
4
|
+
export declare class GatacaQRWS {
|
|
5
|
+
constructor();
|
|
6
|
+
disconnectedCallback(): void;
|
|
7
|
+
/**
|
|
8
|
+
* ***Mandatory***
|
|
9
|
+
* Callback fired upon session correctly verified
|
|
10
|
+
* If not set, session validation wouldn't trigger any action
|
|
11
|
+
* The session data and a possible token will be sent as parameters to the callback
|
|
12
|
+
*/
|
|
13
|
+
successCallback: (data?: any) => void;
|
|
14
|
+
/**
|
|
15
|
+
* ***Mandatory***
|
|
16
|
+
* Callback fired upon session expired or invalid
|
|
17
|
+
* If not set, session error would not be handled
|
|
18
|
+
* An error containing information will be passed as parameter
|
|
19
|
+
*/
|
|
20
|
+
errorCallback: (error?: Error) => void;
|
|
21
|
+
/**
|
|
22
|
+
* ***Mandatory***
|
|
23
|
+
* Decide if scanning the credential as a verifier to request credentials
|
|
24
|
+
* or as an issuer too issue credentials.
|
|
25
|
+
* Options: connect | certify
|
|
26
|
+
*/
|
|
27
|
+
qrRole: string;
|
|
28
|
+
/**
|
|
29
|
+
* ***Mandatory just for V1***
|
|
30
|
+
* Connect/Certify Server where the wallet will send the data
|
|
31
|
+
*/
|
|
32
|
+
callbackServer: string;
|
|
33
|
+
/**
|
|
34
|
+
* ***Mandatory***
|
|
35
|
+
* WS Endpoint on your service to be invoked upon display
|
|
36
|
+
*/
|
|
37
|
+
socketEndpoint: string;
|
|
38
|
+
/**
|
|
39
|
+
* ***Mandatory***
|
|
40
|
+
* Maximum time window to display the session and keep the websocket connection. It's needed to ensure the socket is closed.
|
|
41
|
+
*/
|
|
42
|
+
sessionTimeout?: number;
|
|
43
|
+
/**
|
|
44
|
+
* [Optional]
|
|
45
|
+
* Function to send a message to the server upon socket creation
|
|
46
|
+
*/
|
|
47
|
+
wsOnOpen: (socket: WebSocket) => void;
|
|
48
|
+
/**
|
|
49
|
+
* **RECOMMENDED**
|
|
50
|
+
* Callback to invoke an a message has been received on the socket. It provides the socket itself and the message as parameters.
|
|
51
|
+
* If not used, the messages provided by the server on the Socket connection must conform to the WSReponse interface
|
|
52
|
+
* If used, an Event named **sessionMsg** must be triggered with a WSReponse as data
|
|
53
|
+
*/
|
|
54
|
+
wsOnMessage: (socket: WebSocket, msg: MessageEvent) => void;
|
|
55
|
+
/**
|
|
56
|
+
* _[Optional]_
|
|
57
|
+
* Set to enable autoload when the QR is displayed. By default it is true
|
|
58
|
+
*/
|
|
59
|
+
autostart: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* _[Optional]_
|
|
62
|
+
* Set to refresh the session automatically upon expiration. By default it is false
|
|
63
|
+
*/
|
|
64
|
+
autorefresh: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* **RECOMMENDED**
|
|
67
|
+
* Set to use v2 links. The create session must be providing both an authentication request and a session Id
|
|
68
|
+
*/
|
|
69
|
+
v2?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* _[Optional]_
|
|
72
|
+
* Modifies the qr headline title
|
|
73
|
+
*/
|
|
74
|
+
qrModalTitle?: string;
|
|
75
|
+
/**
|
|
76
|
+
* _[Optional]_
|
|
77
|
+
* Modifies the Modal description
|
|
78
|
+
*/
|
|
79
|
+
qrModalDescription?: string;
|
|
80
|
+
/**
|
|
81
|
+
* _[Optional]_
|
|
82
|
+
* Boolean to show or not show the gataca brand title
|
|
83
|
+
*/
|
|
84
|
+
hideBrandTitle?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* _[Optional]_
|
|
87
|
+
* Display a link containing a dynamic link to invoke the wallet if closed
|
|
88
|
+
*/
|
|
89
|
+
dynamicLink?: boolean;
|
|
90
|
+
sessionId?: string;
|
|
91
|
+
authenticationRequest?: string;
|
|
92
|
+
sessionData: any;
|
|
93
|
+
result: RESULT_STATUS;
|
|
94
|
+
componentDidLoad(): Promise<void>;
|
|
95
|
+
/**
|
|
96
|
+
* GatacaLoginCompleted event, triggered with session data upon login success
|
|
97
|
+
*/
|
|
98
|
+
gatacaLoginCompleted: EventEmitter;
|
|
99
|
+
/**
|
|
100
|
+
* GatacaLoginFailed event, triggered with error upon login failure
|
|
101
|
+
*/
|
|
102
|
+
gatacaLoginFailed: EventEmitter;
|
|
103
|
+
socket: WebSocket;
|
|
104
|
+
/**
|
|
105
|
+
* Force manually the display of a QR
|
|
106
|
+
*/
|
|
107
|
+
display(): Promise<void>;
|
|
108
|
+
sessionMsgReceived(event: CustomEvent<WSResponse>): void;
|
|
109
|
+
handleWSResponse(wsresp: WSResponse): void;
|
|
110
|
+
/**
|
|
111
|
+
* Stop manually an ongoing session
|
|
112
|
+
*/
|
|
113
|
+
stop(): Promise<void>;
|
|
114
|
+
/**
|
|
115
|
+
* Retrieve manually the session data on a successful login
|
|
116
|
+
*/
|
|
117
|
+
getSessionData(): Promise<any>;
|
|
118
|
+
getLink(): string;
|
|
119
|
+
renderQRSection(): any;
|
|
120
|
+
renderSuccess(): any;
|
|
121
|
+
renderRetryButton(errorMessage?: string): any;
|
|
122
|
+
renderQR(value: string, size: number, useLogo?: boolean): any;
|
|
123
|
+
render(): any;
|
|
124
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { EventEmitter } from "../../stencil-public-runtime";
|
|
2
|
+
import "../gataca-qrdisplay/gataca-qrdisplay";
|
|
3
|
+
import { RESULT_STATUS } from "../../utils/utils";
|
|
4
|
+
import { GatacaQR } from "../gataca-qr/gataca-qr";
|
|
5
|
+
export declare class GatacaSSIButton {
|
|
6
|
+
qr: GatacaQR;
|
|
7
|
+
constructor();
|
|
8
|
+
/**
|
|
9
|
+
* _[Optional]_
|
|
10
|
+
* In the case of being a button, modifies its text
|
|
11
|
+
*/
|
|
12
|
+
buttonText?: string;
|
|
13
|
+
/**
|
|
14
|
+
* ***Mandatory***
|
|
15
|
+
* Check status function to query the current status of the session
|
|
16
|
+
* The function must query a client endpoint to check the status. That endpoint must return an error if the session has expired.
|
|
17
|
+
*/
|
|
18
|
+
checkStatus?: (id?: string) => Promise<{
|
|
19
|
+
result: RESULT_STATUS;
|
|
20
|
+
data?: any;
|
|
21
|
+
}>;
|
|
22
|
+
/**
|
|
23
|
+
* ***Mandatory***
|
|
24
|
+
* Create session function to generate a new Session
|
|
25
|
+
* Using V1, it can provide just a session Id
|
|
26
|
+
* Using V2, it must provide also the authentication request. The session Id is the id of the presentation definition
|
|
27
|
+
*/
|
|
28
|
+
createSession?: () => Promise<{
|
|
29
|
+
sessionId: string;
|
|
30
|
+
authenticationRequest?: string;
|
|
31
|
+
}>;
|
|
32
|
+
/**
|
|
33
|
+
* ***Mandatory***
|
|
34
|
+
* Callback fired upon session correctly verified
|
|
35
|
+
* If not set, session validation wouldn't trigger any action
|
|
36
|
+
* The session data and a possible token will be sent as parameters to the callback
|
|
37
|
+
*/
|
|
38
|
+
successCallback: (data?: any) => void;
|
|
39
|
+
/**
|
|
40
|
+
* ***Mandatory***
|
|
41
|
+
* Callback fired upon session expired or invalid
|
|
42
|
+
* If not set, session error would not be handled
|
|
43
|
+
* An error containing information will be passed as parameter
|
|
44
|
+
*/
|
|
45
|
+
errorCallback: (error?: Error) => void;
|
|
46
|
+
/**
|
|
47
|
+
* ***Mandatory***
|
|
48
|
+
* Decide if scanning the credential as a verifier to request credentials
|
|
49
|
+
* or as an issuer too issue credentials.
|
|
50
|
+
* Options: connect | certify
|
|
51
|
+
*/
|
|
52
|
+
qrRole: string;
|
|
53
|
+
/**
|
|
54
|
+
* ***Mandatory just for V1***
|
|
55
|
+
* Connect/Certify Server where the wallet will send the data
|
|
56
|
+
*/
|
|
57
|
+
callbackServer: string;
|
|
58
|
+
/**
|
|
59
|
+
* _[Optional]_
|
|
60
|
+
* Maximum time window to display the session
|
|
61
|
+
*/
|
|
62
|
+
sessionTimeout?: number;
|
|
63
|
+
/**
|
|
64
|
+
* _[Optional]_
|
|
65
|
+
* Frequency in seconds to check if the session has been validated
|
|
66
|
+
*/
|
|
67
|
+
pollingFrequency?: number;
|
|
68
|
+
/**
|
|
69
|
+
* _[Optional]_
|
|
70
|
+
* Set to refresh the session automatically upon expiration. By default it is false
|
|
71
|
+
*/
|
|
72
|
+
autorefresh: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* _[Optional]_
|
|
75
|
+
* Set to use v2 links. The create session must be providing both an authentication request and a session Id
|
|
76
|
+
*/
|
|
77
|
+
v2?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* _[Optional]_
|
|
80
|
+
* Modifies the qr headline title
|
|
81
|
+
*/
|
|
82
|
+
qrModalTitle?: string;
|
|
83
|
+
/**
|
|
84
|
+
* _[Optional]_
|
|
85
|
+
* Modifies the Modal description
|
|
86
|
+
*/
|
|
87
|
+
qrModalDescription?: string;
|
|
88
|
+
/**
|
|
89
|
+
* _[Optional]_
|
|
90
|
+
* Boolean to show or not show the gataca brand title
|
|
91
|
+
*/
|
|
92
|
+
hideBrandTitle?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* _[Optional]_
|
|
95
|
+
* Display a link containing a dynamic link to invoke the wallet if closed
|
|
96
|
+
*/
|
|
97
|
+
dynamicLink?: boolean;
|
|
98
|
+
open: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* GatacaLoginCompleted event, triggered with session data upon login success
|
|
101
|
+
*/
|
|
102
|
+
gatacaLoginCompleted: EventEmitter;
|
|
103
|
+
/**
|
|
104
|
+
* GatacaLoginFailed event, triggered with error upon login failure
|
|
105
|
+
*/
|
|
106
|
+
gatacaLoginFailed: EventEmitter;
|
|
107
|
+
/**
|
|
108
|
+
* Retrieve manually the session data on a successful login
|
|
109
|
+
*/
|
|
110
|
+
getSessionData(): Promise<any>;
|
|
111
|
+
renderModal(): GatacaQR;
|
|
112
|
+
renderButton(): any;
|
|
113
|
+
render(): any;
|
|
114
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { EventEmitter } from "../../stencil-public-runtime";
|
|
2
|
+
import { GatacaQRWS } from "../gataca-qrws/gataca-qrws";
|
|
3
|
+
export declare class GatacaSSIButtonWS {
|
|
4
|
+
qr: GatacaQRWS;
|
|
5
|
+
constructor();
|
|
6
|
+
/**
|
|
7
|
+
* _[Optional]_
|
|
8
|
+
* In the case of being a button, modifies its text
|
|
9
|
+
*/
|
|
10
|
+
buttonText?: string;
|
|
11
|
+
/**
|
|
12
|
+
* ***Mandatory***
|
|
13
|
+
* Callback fired upon session correctly verified
|
|
14
|
+
* If not set, session validation wouldn't trigger any action
|
|
15
|
+
* The session data and a possible token will be sent as parameters to the callback
|
|
16
|
+
*/
|
|
17
|
+
successCallback: (data?: any) => void;
|
|
18
|
+
/**
|
|
19
|
+
* ***Mandatory***
|
|
20
|
+
* Callback fired upon session expired or invalid
|
|
21
|
+
* If not set, session error would not be handled
|
|
22
|
+
* An error containing information will be passed as parameter
|
|
23
|
+
*/
|
|
24
|
+
errorCallback: (error?: Error) => void;
|
|
25
|
+
/**
|
|
26
|
+
* ***Mandatory***
|
|
27
|
+
* Decide if scanning the credential as a verifier to request credentials
|
|
28
|
+
* or as an issuer too issue credentials.
|
|
29
|
+
* Options: connect | certify
|
|
30
|
+
*/
|
|
31
|
+
qrRole: string;
|
|
32
|
+
/**
|
|
33
|
+
* ***Mandatory just for V1***
|
|
34
|
+
* Connect/Certify Server where the wallet will send the data
|
|
35
|
+
*/
|
|
36
|
+
callbackServer: string;
|
|
37
|
+
/**
|
|
38
|
+
* ***Mandatory***
|
|
39
|
+
* WS Endpoint on your service to be invoked upon display
|
|
40
|
+
*/
|
|
41
|
+
socketEndpoint: string;
|
|
42
|
+
/**
|
|
43
|
+
* ***Mandatory***
|
|
44
|
+
* Maximum time window to display the session and keep the websocket connection. It's needed to ensure the socket is closed.
|
|
45
|
+
*/
|
|
46
|
+
sessionTimeout?: number;
|
|
47
|
+
/**
|
|
48
|
+
* [Optional]
|
|
49
|
+
* Function to send a message to the server upon socket creation
|
|
50
|
+
*/
|
|
51
|
+
wsOnOpen: (socket: WebSocket) => void;
|
|
52
|
+
/**
|
|
53
|
+
* **RECOMMENDED**
|
|
54
|
+
* Callback to invoke an a message has been received on the socket. It provides the socket itself and the message as parameters.
|
|
55
|
+
* If not used, the messages provided by the server on the Socket connection must conform to the WSReponse interface
|
|
56
|
+
* If used, an Event named **sessionMsg** must be triggered with a WSReponse as data
|
|
57
|
+
*/
|
|
58
|
+
wsOnMessage: (socket: WebSocket, msg: MessageEvent) => void;
|
|
59
|
+
/**
|
|
60
|
+
* _[Optional]_
|
|
61
|
+
* Set to enable autoload when the QR is displayed. By default it is true
|
|
62
|
+
*/
|
|
63
|
+
autostart: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* _[Optional]_
|
|
66
|
+
* Set to refresh the session automatically upon expiration. By default it is false
|
|
67
|
+
*/
|
|
68
|
+
autorefresh: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* **RECOMMENDED**
|
|
71
|
+
* Set to use v2 links. The create session must be providing both an authentication request and a session Id
|
|
72
|
+
*/
|
|
73
|
+
v2?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* _[Optional]_
|
|
76
|
+
* Modifies the qr headline title
|
|
77
|
+
*/
|
|
78
|
+
qrModalTitle?: string;
|
|
79
|
+
/**
|
|
80
|
+
* _[Optional]_
|
|
81
|
+
* Modifies the Modal description
|
|
82
|
+
*/
|
|
83
|
+
qrModalDescription?: string;
|
|
84
|
+
/**
|
|
85
|
+
* _[Optional]_
|
|
86
|
+
* Boolean to show or not show the gataca brand title
|
|
87
|
+
*/
|
|
88
|
+
hideBrandTitle?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* _[Optional]_
|
|
91
|
+
* Display a link containing a dynamic link to invoke the wallet if closed
|
|
92
|
+
*/
|
|
93
|
+
dynamicLink?: boolean;
|
|
94
|
+
open: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* GatacaLoginCompleted event, triggered with session data upon login success
|
|
97
|
+
*/
|
|
98
|
+
gatacaLoginCompleted: EventEmitter;
|
|
99
|
+
/**
|
|
100
|
+
* GatacaLoginFailed event, triggered with error upon login failure
|
|
101
|
+
*/
|
|
102
|
+
gatacaLoginFailed: EventEmitter;
|
|
103
|
+
/**
|
|
104
|
+
* Retrieve manually the session data on a successful login
|
|
105
|
+
*/
|
|
106
|
+
getSessionData(): Promise<any>;
|
|
107
|
+
renderModal(): GatacaQRWS;
|
|
108
|
+
renderButton(): any;
|
|
109
|
+
render(): any;
|
|
110
|
+
}
|