@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,239 @@
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
+ * _[Optional]_
67
+ * If 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
68
+ */
69
+ v?: string;
70
+ /**
71
+ * _[Optional]_
72
+ * Modifies the qr headline title
73
+ */
74
+ qrModalTitle?: string;
75
+ /**
76
+ * _[Optional]_
77
+ * String to set Modal title color
78
+ */
79
+ modalTitleColor?: string;
80
+ /**
81
+ * _[Optional]_
82
+ * Modifies the Modal description
83
+ */
84
+ qrModalDescription?: string;
85
+ /**
86
+ * _[Optional]_
87
+ * Boolean to show or not show the modal title, brandTitle and description
88
+ */
89
+ hideModalTexts?: boolean;
90
+ /**
91
+ * _[Optional]_
92
+ * Boolean to show or not show the modal title, brandTitle and description
93
+ */
94
+ hideModalBoxShadow?: boolean;
95
+ /**
96
+ * _[Optional]_
97
+ * Boolean to show or not show the gataca brand title
98
+ */
99
+ hideBrandTitle?: boolean;
100
+ /**
101
+ * _[Optional]_
102
+ * 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
103
+ */
104
+ logoSize?: number;
105
+ /**
106
+ * _[Optional]_
107
+ * Logo to display, just if the logo size is greater than 0. No logo is the GATACA logo.
108
+ */
109
+ logoSrc?: string;
110
+ /**
111
+ * _[Optional]_
112
+ * Size of QR Displayed
113
+ */
114
+ qrSize?: number;
115
+ /**
116
+ * _[Optional]_
117
+ * Width of the modal
118
+ */
119
+ modalWidth?: number;
120
+ /**
121
+ * _[Optional]_
122
+ * Height of the modal
123
+ */
124
+ modalHeight?: number;
125
+ /**
126
+ * _[Optional]_
127
+ * String to show when qr code expired
128
+ */
129
+ qrCodeExpiredLabel?: string;
130
+ /**
131
+ * _[Optional]_
132
+ * String to show when credentials not validatedd
133
+ */
134
+ credentialsNotValidatedLabel?: string;
135
+ /**
136
+ * _[Optional]_
137
+ * String to show "click inside" label
138
+ */
139
+ clickInsideBoxLabel?: string;
140
+ /**
141
+ * _[Optional]_
142
+ * String to show "refresh QR" label
143
+ */
144
+ refreshQrLabel?: string;
145
+ /**
146
+ * _[Optional]_
147
+ * String to show "scan QR" label
148
+ */
149
+ scanQrLabel?: string;
150
+ /**
151
+ * _[Optional]_
152
+ * String to show "user not scan in time" error
153
+ */
154
+ userNotScanInTimeErrorLabel?: string;
155
+ /**
156
+ * _[Optional]_
157
+ * String to show "provided credentials not validates" error
158
+ */
159
+ credsNotValidatedErrorLabel?: string;
160
+ /**
161
+ * _[Optional]_
162
+ * String to show "failed login" error
163
+ */
164
+ failedLoginErrorLabel?: string;
165
+ /**
166
+ * _[Optional]_
167
+ * String to show "successful login" label
168
+ */
169
+ successLoginLabel?: string;
170
+ /**
171
+ * _[Optional]_
172
+ * String to show "by brand" label
173
+ */
174
+ byBrandLabel?: string;
175
+ /**
176
+ * _[Optional]_
177
+ * String to show "waiting start session" label
178
+ */
179
+ waitingStartSessionLabel?: string;
180
+ /**
181
+ * _[Optional]_
182
+ * String title to show when QR already read
183
+ */
184
+ readQrTitle?: string;
185
+ /**
186
+ * _[Optional]_
187
+ * String description to show when QR already read
188
+ */
189
+ readQrDescription?: string;
190
+ /**
191
+ * _[Optional]_
192
+ * Boolean to show or not show the QR Modal description
193
+ */
194
+ hideQrModalDescription?: boolean;
195
+ /**
196
+ * _[Optional]_
197
+ * Display a link containing a dynamic link to invoke the wallet if closed
198
+ */
199
+ dynamicLink?: boolean;
200
+ sessionId?: string;
201
+ authenticationRequest?: string;
202
+ sessionData: any;
203
+ result: RESULT_STATUS;
204
+ componentDidLoad(): Promise<void>;
205
+ /**
206
+ * GatacaLoginCompleted event, triggered with session data upon login success
207
+ */
208
+ gatacaLoginCompleted: EventEmitter;
209
+ /**
210
+ * GatacaLoginFailed event, triggered with error upon login failure
211
+ */
212
+ gatacaLoginFailed: EventEmitter;
213
+ socket: WebSocket;
214
+ /**
215
+ * Force manually the display of a QR
216
+ */
217
+ display(): Promise<void>;
218
+ sessionMsgReceived(event: CustomEvent<WSResponse>): void;
219
+ handleWSResponse(wsresp: WSResponse): void;
220
+ /**
221
+ * Stop manually an ongoing session
222
+ */
223
+ stop(): Promise<void>;
224
+ /**
225
+ * Retrieve manually the session data on a successful login
226
+ */
227
+ getSessionData(): Promise<any>;
228
+ getLink(): string;
229
+ renderQRSection(): any;
230
+ renderSuccess(): any;
231
+ renderRetryButton(errorMessage?: string): any;
232
+ renderReadQR(readQrMessages?: {
233
+ title: any;
234
+ description: any;
235
+ }): any;
236
+ renderQR(value: string, useLogo?: boolean): any;
237
+ renderRetryQR(value: string, useLogo?: boolean): any;
238
+ render(): any;
239
+ }
@@ -0,0 +1,218 @@
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
+ private qrElement;
8
+ constructor();
9
+ /**
10
+ * _[Optional]_
11
+ * In the case of being a button, modifies its text
12
+ */
13
+ buttonText?: string;
14
+ /**
15
+ * ***Mandatory***
16
+ * Check status function to query the current status of the session
17
+ * The function must query a client endpoint to check the status. That endpoint must return an error if the session has expired.
18
+ */
19
+ checkStatus?: (id?: string) => Promise<{
20
+ result: RESULT_STATUS;
21
+ data?: any;
22
+ }>;
23
+ /**
24
+ * ***Mandatory***
25
+ * Create session function to generate a new Session
26
+ * Using v="3", it can provide just a session Id
27
+ * Using another version, it must provide also the authentication request. The session Id is the id of the presentation definition
28
+ */
29
+ createSession?: () => Promise<{
30
+ sessionId: string;
31
+ authenticationRequest?: string;
32
+ }>;
33
+ /**
34
+ * ***Mandatory***
35
+ * Callback fired upon session correctly verified
36
+ * If not set, session validation wouldn't trigger any action
37
+ * The session data and a possible token will be sent as parameters to the callback
38
+ */
39
+ successCallback: (data?: any) => void;
40
+ /**
41
+ * ***Mandatory***
42
+ * Callback fired upon session expired or invalid
43
+ * If not set, session error would not be handled
44
+ * An error containing information will be passed as parameter
45
+ */
46
+ errorCallback: (error?: Error) => void;
47
+ /**
48
+ * _[Optional]_
49
+ * Function that runs every time the loading state changes while checking if the App is installed. Only on mobile with v3.
50
+ */
51
+ handleCheckAppLoading?: (isCheckingApp?: boolean) => void;
52
+ /**
53
+ * _[Optional]_
54
+ * Maximum time window to check if the App is installed
55
+ */
56
+ checkAppTimeout?: number;
57
+ /**
58
+ * ***Mandatory***
59
+ * Decide if scanning the credential as a verifier to request credentials
60
+ * or as an issuer too issue credentials.
61
+ * Options: connect | certify
62
+ */
63
+ qrRole: string;
64
+ /**
65
+ * ***Mandatory just for V1***
66
+ * Connect/Certify Server where the wallet will send the data
67
+ */
68
+ callbackServer: string;
69
+ /**
70
+ * _[Optional]_
71
+ * Maximum time window to display the session
72
+ */
73
+ sessionTimeout?: number;
74
+ /**
75
+ * _[Optional]_
76
+ * Frequency in seconds to check if the session has been validated
77
+ */
78
+ pollingFrequency?: number;
79
+ /**
80
+ * _[Optional]_
81
+ * Set to refresh the session automatically upon expiration. By default it is false
82
+ */
83
+ autorefresh: boolean;
84
+ /**
85
+ * _[Optional]_
86
+ * If 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
87
+ */
88
+ v?: string;
89
+ /**
90
+ * _[Optional]_
91
+ * Modifies the qr headline title
92
+ */
93
+ qrModalTitle?: string;
94
+ /**
95
+ * _[Optional]_
96
+ * String to set Modal title color
97
+ */
98
+ modalTitleColor?: string;
99
+ /**
100
+ * _[Optional]_
101
+ * Modifies the Modal description
102
+ */
103
+ qrModalDescription?: string;
104
+ /**
105
+ * _[Optional]_
106
+ * Boolean to show or not show the gataca brand title
107
+ */
108
+ hideBrandTitle?: boolean;
109
+ /**
110
+ * _[Optional]_
111
+ * Display a link containing a dynamic link to invoke the wallet if closed
112
+ */
113
+ dynamicLink?: boolean;
114
+ /**
115
+ * _[Optional]_
116
+ * 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
117
+ */
118
+ logoSize?: number;
119
+ /**
120
+ * _[Optional]_
121
+ * Logo to display, just if the logo size is greater than 0. No logo is the GATACA logo.
122
+ */
123
+ logoSrc?: string;
124
+ /**
125
+ * _[Optional]_
126
+ * String to show when qr code expired
127
+ */
128
+ qrCodeExpiredLabel?: string;
129
+ /**
130
+ * _[Optional]_
131
+ * String to show when credentials not validatedd
132
+ */
133
+ credentialsNotValidatedLabel?: string;
134
+ /**
135
+ * _[Optional]_
136
+ * String to show "click inside" label
137
+ */
138
+ clickInsideBoxLabel?: string;
139
+ /**
140
+ * _[Optional]_
141
+ * String to show "refresh QR" label
142
+ */
143
+ refreshQrLabel?: string;
144
+ /**
145
+ * _[Optional]_
146
+ * String to show "scan QR" label
147
+ */
148
+ scanQrLabel?: string;
149
+ /**
150
+ * _[Optional]_
151
+ * String to show "user not scan in time" error
152
+ */
153
+ userNotScanInTimeErrorLabel?: string;
154
+ /**
155
+ * _[Optional]_
156
+ * String to show "provided credentials not validates" error
157
+ */
158
+ credsNotValidatedErrorLabel?: string;
159
+ /**
160
+ * _[Optional]_
161
+ * String to show "failed login" error
162
+ */
163
+ failedLoginErrorLabel?: string;
164
+ /**
165
+ * _[Optional]_
166
+ * String to show "successful login" label
167
+ */
168
+ successLoginLabel?: string;
169
+ /**
170
+ * _[Optional]_
171
+ * String to show "by brand" label
172
+ */
173
+ byBrandLabel?: string;
174
+ /**
175
+ * _[Optional]_
176
+ * String to show "waiting start session" label
177
+ */
178
+ waitingStartSessionLabel?: string;
179
+ /**
180
+ * _[Optional]_
181
+ * Boolean to show or not show the QR Modal description
182
+ */
183
+ hideQrModalDescription?: boolean;
184
+ open: boolean;
185
+ sessionId?: string;
186
+ authenticationRequest?: string;
187
+ sessionData: any;
188
+ result: RESULT_STATUS;
189
+ /**
190
+ * GatacaLoginCompleted event, triggered with session data upon login success
191
+ */
192
+ gatacaLoginCompleted: EventEmitter;
193
+ /**
194
+ * GatacaLoginFailed event, triggered with error upon login failure
195
+ */
196
+ gatacaLoginFailed: EventEmitter;
197
+ /**
198
+ * Retrieve manually the session data on a successful login
199
+ */
200
+ getSessionData(): Promise<any>;
201
+ getSessionId(): Promise<string>;
202
+ /**
203
+ * Force manually the start polling
204
+ */
205
+ startMobilePolling(): Promise<void>;
206
+ /**
207
+ * Stop manually an ongoing session
208
+ */
209
+ stop(): Promise<void>;
210
+ clean(): void;
211
+ renderModal(): GatacaQR;
212
+ poll(): Promise<unknown>;
213
+ isAppInstalled(appScheme: any, callback: any): void;
214
+ renderDesktopButton(): any;
215
+ getAuthRequest(): Promise<string>;
216
+ renderMobileButton(isAndroid: boolean, isIos: boolean): any;
217
+ render(): any;
218
+ }
@@ -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
+ * If 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
72
+ */
73
+ v?: string;
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
+ }