@gataca/qr 2.0.14 → 3.0.6
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 +5 -5
- package/dist/cjs/gataca-qr_2.cjs.entry.js +6 -19
- package/dist/cjs/gataca-qrws.cjs.entry.js +6 -18
- package/dist/cjs/gataca-ssibutton_2.cjs.entry.js +197 -13
- package/dist/cjs/gatacaqr.cjs.js +3 -7
- package/dist/cjs/{index-f214ab7a.js → index-93d47a75.js} +2 -111
- package/dist/cjs/loader.cjs.js +3 -4
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/gataca-autoqr/gataca-autoqr.js +5 -5
- package/dist/collection/components/gataca-qr/gataca-qr.js +13 -26
- package/dist/collection/components/gataca-qrws/gataca-qrws.js +12 -24
- package/dist/collection/components/gataca-ssibutton/gataca-ssibutton.js +259 -19
- package/dist/collection/components/gataca-ssibuttonws/gataca-ssibuttonws.js +9 -9
- package/dist/components/gataca-autoqr.js +4 -4
- package/dist/components/gataca-qr2.js +6 -19
- package/dist/components/gataca-qrws2.js +6 -18
- package/dist/components/gataca-ssibutton2.js +203 -12
- package/dist/components/gataca-ssibuttonws2.js +3 -3
- package/dist/components/index.d.ts +0 -9
- package/dist/components/index.js +1 -1
- package/dist/esm/gataca-autoqr.entry.js +5 -5
- package/dist/esm/gataca-qr_2.entry.js +6 -19
- package/dist/esm/gataca-qrws.entry.js +6 -18
- package/dist/esm/gataca-ssibutton_2.entry.js +197 -13
- package/dist/esm/gatacaqr.js +3 -4
- package/dist/esm/{index-570c9813.js → index-2be54f32.js} +3 -111
- package/dist/esm/loader.js +3 -4
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/gatacaqr/gatacaqr.esm.js +1 -1
- package/dist/gatacaqr/p-0381ab9a.entry.js +1 -0
- package/dist/gatacaqr/p-0be4566d.js +1 -1
- package/dist/gatacaqr/p-16298cb4.entry.js +1 -0
- package/dist/gatacaqr/p-5ae5f952.js +2 -0
- package/dist/gatacaqr/p-761647d3.entry.js +1 -0
- package/dist/gatacaqr/p-9e9af27e.entry.js +1 -0
- package/dist/types/components/gataca-autoqr/gataca-autoqr.d.ts +2 -2
- package/dist/types/components/gataca-qr/components/qr/QR.d.ts +1 -1
- package/dist/types/components/gataca-qr/components/readQR/ReadQR.d.ts +1 -1
- package/dist/types/components/gataca-qr/components/retryButton/RetryButton.d.ts +1 -1
- package/dist/types/components/gataca-qr/components/success/Success.d.ts +1 -1
- package/dist/types/components/gataca-qr/gataca-qr.d.ts +4 -4
- package/dist/types/components/gataca-qrws/components/qr/QR.d.ts +1 -1
- package/dist/types/components/gataca-qrws/components/readQR/ReadQR.d.ts +1 -1
- package/dist/types/components/gataca-qrws/components/retryButton/RetryButton.d.ts +1 -1
- package/dist/types/components/gataca-qrws/components/success/Success.d.ts +1 -1
- package/dist/types/components/gataca-qrws/gataca-qrws.d.ts +3 -3
- package/dist/types/components/gataca-ssibutton/gataca-ssibutton.d.ts +29 -5
- package/dist/types/components/gataca-ssibuttonws/gataca-ssibuttonws.d.ts +2 -2
- package/dist/types/components.d.ts +38 -22
- package/dist/types/stencil-public-runtime.d.ts +3 -59
- package/dist/types/utils/utils.d.ts +9 -9
- package/loader/index.d.ts +0 -9
- package/package.json +2 -2
- package/readme.md +2 -0
- package/dist/gatacaqr/p-3d1a6526.entry.js +0 -1
- package/dist/gatacaqr/p-64740141.entry.js +0 -1
- package/dist/gatacaqr/p-bd6bd52f.entry.js +0 -1
- package/dist/gatacaqr/p-ec0f00a6.js +0 -2
- package/dist/gatacaqr/p-f9931de0.entry.js +0 -1
|
@@ -63,18 +63,6 @@ const isComplexType = (o) => {
|
|
|
63
63
|
o = typeof o;
|
|
64
64
|
return o === 'object' || o === 'function';
|
|
65
65
|
};
|
|
66
|
-
/**
|
|
67
|
-
* Helper method for querying a `meta` tag that contains a nonce value
|
|
68
|
-
* out of a DOM's head.
|
|
69
|
-
*
|
|
70
|
-
* @param doc The DOM containing the `head` to query against
|
|
71
|
-
* @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
|
|
72
|
-
* exists or the tag has no content.
|
|
73
|
-
*/
|
|
74
|
-
function queryNonceMetaTagContent(doc) {
|
|
75
|
-
var _a, _b, _c;
|
|
76
|
-
return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;
|
|
77
|
-
}
|
|
78
66
|
/**
|
|
79
67
|
* Production h() function based on Preact by
|
|
80
68
|
* Jason Miller (@developit)
|
|
@@ -83,6 +71,7 @@ function queryNonceMetaTagContent(doc) {
|
|
|
83
71
|
*
|
|
84
72
|
* Modified for Stencil's compiler and vdom
|
|
85
73
|
*/
|
|
74
|
+
// const stack: any[] = [];
|
|
86
75
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
|
|
87
76
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
|
|
88
77
|
const h = (nodeName, vnodeData, ...children) => {
|
|
@@ -137,14 +126,6 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
137
126
|
}
|
|
138
127
|
return vnode;
|
|
139
128
|
};
|
|
140
|
-
/**
|
|
141
|
-
* A utility function for creating a virtual DOM node from a tag and some
|
|
142
|
-
* possible text content.
|
|
143
|
-
*
|
|
144
|
-
* @param tag the tag for this element
|
|
145
|
-
* @param text possible text content for the node
|
|
146
|
-
* @returns a newly-minted virtual DOM node
|
|
147
|
-
*/
|
|
148
129
|
const newVNode = (tag, text) => {
|
|
149
130
|
const vnode = {
|
|
150
131
|
$flags$: 0,
|
|
@@ -159,31 +140,11 @@ const newVNode = (tag, text) => {
|
|
|
159
140
|
return vnode;
|
|
160
141
|
};
|
|
161
142
|
const Host = {};
|
|
162
|
-
/**
|
|
163
|
-
* Check whether a given node is a Host node or not
|
|
164
|
-
*
|
|
165
|
-
* @param node the virtual DOM node to check
|
|
166
|
-
* @returns whether it's a Host node or not
|
|
167
|
-
*/
|
|
168
143
|
const isHost = (node) => node && node.$tag$ === Host;
|
|
169
|
-
/**
|
|
170
|
-
* Implementation of {@link d.FunctionalUtilities} for Stencil's VDom.
|
|
171
|
-
*
|
|
172
|
-
* Note that these functions convert from {@link d.VNode} to
|
|
173
|
-
* {@link d.ChildNode} to give functional component developers a friendly
|
|
174
|
-
* interface.
|
|
175
|
-
*/
|
|
176
144
|
const vdomFnUtils = {
|
|
177
145
|
forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
|
|
178
146
|
map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate),
|
|
179
147
|
};
|
|
180
|
-
/**
|
|
181
|
-
* Convert a {@link d.VNode} to a {@link d.ChildNode} in order to present a
|
|
182
|
-
* friendlier public interface (hence, 'convertToPublic').
|
|
183
|
-
*
|
|
184
|
-
* @param node the virtual DOM node to convert
|
|
185
|
-
* @returns a converted child node
|
|
186
|
-
*/
|
|
187
148
|
const convertToPublic = (node) => ({
|
|
188
149
|
vattrs: node.$attrs$,
|
|
189
150
|
vchildren: node.$children$,
|
|
@@ -192,15 +153,6 @@ const convertToPublic = (node) => ({
|
|
|
192
153
|
vtag: node.$tag$,
|
|
193
154
|
vtext: node.$text$,
|
|
194
155
|
});
|
|
195
|
-
/**
|
|
196
|
-
* Convert a {@link d.ChildNode} back to an equivalent {@link d.VNode} in
|
|
197
|
-
* order to use the resulting object in the virtual DOM. The initial object was
|
|
198
|
-
* likely created as part of presenting a public API, so converting it back
|
|
199
|
-
* involved making it 'private' again (hence, `convertToPrivate`).
|
|
200
|
-
*
|
|
201
|
-
* @param node the child node to convert
|
|
202
|
-
* @returns a converted virtual DOM node
|
|
203
|
-
*/
|
|
204
156
|
const convertToPrivate = (node) => {
|
|
205
157
|
if (typeof node.vtag === 'function') {
|
|
206
158
|
const vnodeData = Object.assign({}, node.vattrs);
|
|
@@ -310,7 +262,6 @@ const registerStyle = (scopeId, cssText, allowCS) => {
|
|
|
310
262
|
styles.set(scopeId, style);
|
|
311
263
|
};
|
|
312
264
|
const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
313
|
-
var _a;
|
|
314
265
|
let scopeId = getScopeId(cmpMeta);
|
|
315
266
|
const style = styles.get(scopeId);
|
|
316
267
|
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
@@ -330,11 +281,6 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
|
330
281
|
styleElm = doc.createElement('style');
|
|
331
282
|
styleElm.innerHTML = style;
|
|
332
283
|
}
|
|
333
|
-
// Apply CSP nonce to the style tag if it exists
|
|
334
|
-
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
335
|
-
if (nonce != null) {
|
|
336
|
-
styleElm.setAttribute('nonce', nonce);
|
|
337
|
-
}
|
|
338
284
|
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
339
285
|
}
|
|
340
286
|
if (appliedStyles) {
|
|
@@ -564,21 +510,6 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
564
510
|
}
|
|
565
511
|
return elm;
|
|
566
512
|
};
|
|
567
|
-
/**
|
|
568
|
-
* Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
|
|
569
|
-
* add them to the DOM in the appropriate place.
|
|
570
|
-
*
|
|
571
|
-
* @param parentElm the DOM node which should be used as a parent for the new
|
|
572
|
-
* DOM nodes
|
|
573
|
-
* @param before a child of the `parentElm` which the new children should be
|
|
574
|
-
* inserted before (optional)
|
|
575
|
-
* @param parentVNode the parent virtual DOM node
|
|
576
|
-
* @param vnodes the new child virtual DOM nodes to produce DOM nodes for
|
|
577
|
-
* @param startIdx the index in the child virtual DOM nodes at which to start
|
|
578
|
-
* creating DOM nodes (inclusive)
|
|
579
|
-
* @param endIdx the index in the child virtual DOM nodes at which to stop
|
|
580
|
-
* creating DOM nodes (inclusive)
|
|
581
|
-
*/
|
|
582
513
|
const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
583
514
|
let containerElm = (parentElm);
|
|
584
515
|
let childNode;
|
|
@@ -595,19 +526,6 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
|
|
|
595
526
|
}
|
|
596
527
|
}
|
|
597
528
|
};
|
|
598
|
-
/**
|
|
599
|
-
* Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
|
|
600
|
-
* This can be used to, for instance, clean up after a list of children which
|
|
601
|
-
* should no longer be shown.
|
|
602
|
-
*
|
|
603
|
-
* This function also handles some of Stencil's slot relocation logic.
|
|
604
|
-
*
|
|
605
|
-
* @param vnodes a list of virtual DOM nodes to remove
|
|
606
|
-
* @param startIdx the index at which to start removing nodes (inclusive)
|
|
607
|
-
* @param endIdx the index at which to stop removing nodes (inclusive)
|
|
608
|
-
* @param vnode a VNode
|
|
609
|
-
* @param elm an element
|
|
610
|
-
*/
|
|
611
529
|
const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
612
530
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
613
531
|
if ((vnode = vnodes[startIdx])) {
|
|
@@ -800,8 +718,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
800
718
|
*
|
|
801
719
|
* So, in other words, if `key` attrs are not set on VNodes which may be
|
|
802
720
|
* changing order within a `children` array or something along those lines then
|
|
803
|
-
* we could obtain a false
|
|
804
|
-
* (i.e. we'd say two VNodes aren't equal when in fact they should be).
|
|
721
|
+
* we could obtain a false positive and then have to do needless re-rendering.
|
|
805
722
|
*
|
|
806
723
|
* @param leftVNode the first VNode to check
|
|
807
724
|
* @param rightVNode the second VNode to check
|
|
@@ -868,18 +785,6 @@ const callNodeRefs = (vNode) => {
|
|
|
868
785
|
vNode.$children$ && vNode.$children$.map(callNodeRefs);
|
|
869
786
|
}
|
|
870
787
|
};
|
|
871
|
-
/**
|
|
872
|
-
* The main entry point for Stencil's virtual DOM-based rendering engine
|
|
873
|
-
*
|
|
874
|
-
* Given a {@link d.HostRef} container and some virtual DOM nodes, this
|
|
875
|
-
* function will handle creating a virtual DOM tree with a single root, patching
|
|
876
|
-
* the current virtual DOM tree onto an old one (if any), dealing with slot
|
|
877
|
-
* relocation, and reflecting attributes.
|
|
878
|
-
*
|
|
879
|
-
* @param hostRef data needed to root and render the virtual DOM tree, such as
|
|
880
|
-
* the DOM node into which it should be rendered.
|
|
881
|
-
* @param renderFnResults the virtual DOM nodes to be rendered
|
|
882
|
-
*/
|
|
883
788
|
const renderVdom = (hostRef, renderFnResults) => {
|
|
884
789
|
const hostElm = hostRef.$hostElement$;
|
|
885
790
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
@@ -1327,7 +1232,6 @@ const disconnectedCallback = (elm) => {
|
|
|
1327
1232
|
}
|
|
1328
1233
|
};
|
|
1329
1234
|
const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1330
|
-
var _a;
|
|
1331
1235
|
const endBootstrap = createTime();
|
|
1332
1236
|
const cmpTags = [];
|
|
1333
1237
|
const exclude = options.exclude || [];
|
|
@@ -1404,11 +1308,6 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1404
1308
|
{
|
|
1405
1309
|
visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
|
|
1406
1310
|
visibilityStyle.setAttribute('data-styles', '');
|
|
1407
|
-
// Apply CSP nonce to the style tag if it exists
|
|
1408
|
-
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
1409
|
-
if (nonce != null) {
|
|
1410
|
-
visibilityStyle.setAttribute('nonce', nonce);
|
|
1411
|
-
}
|
|
1412
1311
|
head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
|
1413
1312
|
}
|
|
1414
1313
|
// Process deferred connectedCallbacks now all components have been registered
|
|
@@ -1453,13 +1352,6 @@ const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
1453
1352
|
};
|
|
1454
1353
|
// prettier-ignore
|
|
1455
1354
|
const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
|
|
1456
|
-
/**
|
|
1457
|
-
* Assigns the given value to the nonce property on the runtime platform object.
|
|
1458
|
-
* During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
|
|
1459
|
-
* @param nonce The value to be assigned to the platform nonce property.
|
|
1460
|
-
* @returns void
|
|
1461
|
-
*/
|
|
1462
|
-
const setNonce = (nonce) => (plt.$nonce$ = nonce);
|
|
1463
1355
|
const hostRefs = /*@__PURE__*/ new WeakMap();
|
|
1464
1356
|
const getHostRef = (ref) => hostRefs.get(ref);
|
|
1465
1357
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
|
@@ -1575,4 +1467,3 @@ exports.createEvent = createEvent;
|
|
|
1575
1467
|
exports.h = h;
|
|
1576
1468
|
exports.promiseResolve = promiseResolve;
|
|
1577
1469
|
exports.registerInstance = registerInstance;
|
|
1578
|
-
exports.setNonce = setNonce;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-93d47a75.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
|
-
Stencil Client Patch Esm v2.
|
|
8
|
+
Stencil Client Patch Esm v2.19.3 | MIT Licensed | https://stenciljs.com
|
|
9
9
|
*/
|
|
10
10
|
const patchEsm = () => {
|
|
11
11
|
return index.promiseResolve();
|
|
@@ -14,9 +14,8 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["gataca-qr_2.cjs",[[1,"gataca-qr",{"checkStatus":[16],"createSession":[16],"successCallback":[16],"errorCallback":[16],"qrRole":[1,"qr-role"],"callbackServer":[1,"callback-server"],"autostart":[4],"autorefresh":[4],"
|
|
17
|
+
return index.bootstrapLazy([["gataca-qr_2.cjs",[[1,"gataca-qr",{"checkStatus":[16],"createSession":[16],"successCallback":[16],"errorCallback":[16],"qrRole":[1,"qr-role"],"callbackServer":[1,"callback-server"],"autostart":[4],"autorefresh":[4],"v":[1],"qrModalTitle":[1,"qr-modal-title"],"modalTitleColor":[1,"modal-title-color"],"qrModalDescription":[1,"qr-modal-description"],"hideModalTexts":[4,"hide-modal-texts"],"hideModalBoxShadow":[4,"hide-modal-box-shadow"],"hideBrandTitle":[4,"hide-brand-title"],"logoSize":[2,"logo-size"],"logoSrc":[1,"logo-src"],"qrSize":[2,"qr-size"],"modalWidth":[2,"modal-width"],"modalHeight":[2,"modal-height"],"qrCodeExpiredLabel":[1,"qr-code-expired-label"],"credentialsNotValidatedLabel":[1,"credentials-not-validated-label"],"clickInsideBoxLabel":[1,"click-inside-box-label"],"refreshQrLabel":[1,"refresh-qr-label"],"scanQrLabel":[1,"scan-qr-label"],"userNotScanInTimeErrorLabel":[1,"user-not-scan-in-time-error-label"],"credsNotValidatedErrorLabel":[1,"creds-not-validated-error-label"],"failedLoginErrorLabel":[1,"failed-login-error-label"],"successLoginLabel":[1,"success-login-label"],"byBrandLabel":[1,"by-brand-label"],"waitingStartSessionLabel":[1,"waiting-start-session-label"],"readQrTitle":[1,"read-qr-title"],"readQrDescription":[1,"read-qr-description"],"hideQrModalDescription":[4,"hide-qr-modal-description"],"sessionTimeout":[2,"session-timeout"],"pollingFrequency":[2,"polling-frequency"],"dynamicLink":[4,"dynamic-link"],"sessionId":[32],"authenticationRequest":[32],"sessionData":[32],"result":[32],"display":[64],"stop":[64],"getSessionData":[64]}],[0,"gataca-qrdisplay",{"qrData":[1,"qr-data"],"size":[2],"logoSize":[2,"logo-size"],"logoSrc":[1,"logo-src"],"qrColor":[1,"qr-color"],"rounded":[4]}]]],["gataca-qrws.cjs",[[1,"gataca-qrws",{"successCallback":[16],"errorCallback":[16],"qrRole":[1,"qr-role"],"callbackServer":[1,"callback-server"],"socketEndpoint":[1,"socket-endpoint"],"sessionTimeout":[2,"session-timeout"],"wsOnOpen":[16],"wsOnMessage":[16],"autostart":[4],"autorefresh":[4],"v":[1],"qrModalTitle":[1,"qr-modal-title"],"modalTitleColor":[1,"modal-title-color"],"qrModalDescription":[1,"qr-modal-description"],"hideModalTexts":[4,"hide-modal-texts"],"hideModalBoxShadow":[4,"hide-modal-box-shadow"],"hideBrandTitle":[4,"hide-brand-title"],"logoSize":[2,"logo-size"],"logoSrc":[1,"logo-src"],"qrSize":[2,"qr-size"],"modalWidth":[2,"modal-width"],"modalHeight":[2,"modal-height"],"qrCodeExpiredLabel":[1,"qr-code-expired-label"],"credentialsNotValidatedLabel":[1,"credentials-not-validated-label"],"clickInsideBoxLabel":[1,"click-inside-box-label"],"refreshQrLabel":[1,"refresh-qr-label"],"scanQrLabel":[1,"scan-qr-label"],"userNotScanInTimeErrorLabel":[1,"user-not-scan-in-time-error-label"],"credsNotValidatedErrorLabel":[1,"creds-not-validated-error-label"],"failedLoginErrorLabel":[1,"failed-login-error-label"],"successLoginLabel":[1,"success-login-label"],"byBrandLabel":[1,"by-brand-label"],"waitingStartSessionLabel":[1,"waiting-start-session-label"],"readQrTitle":[1,"read-qr-title"],"readQrDescription":[1,"read-qr-description"],"hideQrModalDescription":[4,"hide-qr-modal-description"],"dynamicLink":[4,"dynamic-link"],"sessionId":[32],"authenticationRequest":[32],"sessionData":[32],"result":[32],"display":[64],"stop":[64],"getSessionData":[64]},[[2,"sessionMsg","sessionMsgReceived"]]]]],["gataca-ssibutton_2.cjs",[[1,"gataca-ssibutton",{"buttonText":[1,"button-text"],"checkStatus":[16],"createSession":[16],"successCallback":[16],"errorCallback":[16],"handleCheckAppLoading":[16],"qrRole":[1,"qr-role"],"callbackServer":[1,"callback-server"],"sessionTimeout":[2,"session-timeout"],"pollingFrequency":[2,"polling-frequency"],"autorefresh":[4],"v":[1],"qrModalTitle":[1,"qr-modal-title"],"modalTitleColor":[1,"modal-title-color"],"qrModalDescription":[1,"qr-modal-description"],"hideBrandTitle":[4,"hide-brand-title"],"dynamicLink":[4,"dynamic-link"],"logoSize":[2,"logo-size"],"logoSrc":[1,"logo-src"],"qrCodeExpiredLabel":[1,"qr-code-expired-label"],"credentialsNotValidatedLabel":[1,"credentials-not-validated-label"],"clickInsideBoxLabel":[1,"click-inside-box-label"],"refreshQrLabel":[1,"refresh-qr-label"],"scanQrLabel":[1,"scan-qr-label"],"userNotScanInTimeErrorLabel":[1,"user-not-scan-in-time-error-label"],"credsNotValidatedErrorLabel":[1,"creds-not-validated-error-label"],"failedLoginErrorLabel":[1,"failed-login-error-label"],"successLoginLabel":[1,"success-login-label"],"byBrandLabel":[1,"by-brand-label"],"waitingStartSessionLabel":[1,"waiting-start-session-label"],"hideQrModalDescription":[4,"hide-qr-modal-description"],"open":[32],"sessionId":[32],"authenticationRequest":[32],"sessionData":[32],"result":[32],"getSessionData":[64],"startMobilePolling":[64],"stop":[64]}],[1,"gataca-ssibuttonws",{"buttonText":[1,"button-text"],"successCallback":[16],"errorCallback":[16],"qrRole":[1,"qr-role"],"callbackServer":[1,"callback-server"],"socketEndpoint":[1,"socket-endpoint"],"sessionTimeout":[2,"session-timeout"],"wsOnOpen":[16],"wsOnMessage":[16],"autostart":[4],"autorefresh":[4],"v":[1],"qrModalTitle":[1,"qr-modal-title"],"qrModalDescription":[1,"qr-modal-description"],"hideBrandTitle":[4,"hide-brand-title"],"dynamicLink":[4,"dynamic-link"],"open":[32],"getSessionData":[64]}]]],["gataca-autoqr.cjs",[[1,"gataca-autoqr",{"configId":[1,"config-id"],"configRepository":[1,"config-repository"],"successCallback":[16],"errorCallback":[16],"checkStatus":[16],"createSession":[16],"wsOnOpen":[16],"wsOnMessage":[16],"config":[32],"loading":[32],"getSessionData":[64]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
exports.setNonce = index.setNonce;
|
|
22
21
|
exports.defineCustomElements = defineCustomElements;
|
|
@@ -62,18 +62,18 @@ export class GatacaAutoQR {
|
|
|
62
62
|
selectQR() {
|
|
63
63
|
if (this.config.useButton) {
|
|
64
64
|
if (this.config.useWs) {
|
|
65
|
-
this.qr = (h("gataca-ssibuttonws", { buttonText: this.config.buttonText, wsOnMessage: this.wsOnMessage || this.config.wsOnMessage, wsOnOpen: this.wsOnOpen || this.config.wsOnOpen, successCallback: this.successCallback || this.config.successCallback, errorCallback: this.errorCallback || this.config.errorCallback, qrRole: this.config.qrRole, callbackServer: this.config.callbackServer, sessionTimeout: this.config.sessionTimeout, socketEndpoint: this.config.socketEndpoint, autostart: true, autorefresh: this.config.autorefresh,
|
|
65
|
+
this.qr = (h("gataca-ssibuttonws", { buttonText: this.config.buttonText, wsOnMessage: this.wsOnMessage || this.config.wsOnMessage, wsOnOpen: this.wsOnOpen || this.config.wsOnOpen, successCallback: this.successCallback || this.config.successCallback, errorCallback: this.errorCallback || this.config.errorCallback, qrRole: this.config.qrRole, callbackServer: this.config.callbackServer, sessionTimeout: this.config.sessionTimeout, socketEndpoint: this.config.socketEndpoint, autostart: true, autorefresh: this.config.autorefresh, v: this.config.v, qrModalTitle: this.config.qrModalTitle, qrModalDescription: this.config.qrModalDescription, hideBrandTitle: this.config.hideBrandTitle, dynamicLink: this.config.dynamicLink }));
|
|
66
66
|
}
|
|
67
67
|
else {
|
|
68
|
-
this.qr = (h("gataca-ssibutton", { buttonText: this.config.buttonText, checkStatus: this.checkStatus || this.config.checkStatus, createSession: this.createSession || this.config.createSession, successCallback: this.successCallback || this.config.successCallback, errorCallback: this.errorCallback || this.config.errorCallback, qrRole: this.config.qrRole, callbackServer: this.config.callbackServer, sessionTimeout: this.config.sessionTimeout, pollingFrequency: this.config.pollingFrequency, autorefresh: this.config.autorefresh,
|
|
68
|
+
this.qr = (h("gataca-ssibutton", { buttonText: this.config.buttonText, checkStatus: this.checkStatus || this.config.checkStatus, createSession: this.createSession || this.config.createSession, successCallback: this.successCallback || this.config.successCallback, errorCallback: this.errorCallback || this.config.errorCallback, qrRole: this.config.qrRole, callbackServer: this.config.callbackServer, sessionTimeout: this.config.sessionTimeout, pollingFrequency: this.config.pollingFrequency, autorefresh: this.config.autorefresh, v: this.config.v, qrModalTitle: this.config.qrModalTitle, qrModalDescription: this.config.qrModalDescription, hideBrandTitle: this.config.hideBrandTitle, dynamicLink: this.config.dynamicLink }));
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
else {
|
|
72
72
|
if (this.config.useWs) {
|
|
73
|
-
this.qr = (h("gataca-qrws", { wsOnMessage: this.wsOnMessage || this.config.wsOnMessage, wsOnOpen: this.wsOnOpen || this.config.wsOnOpen, successCallback: this.successCallback || this.config.successCallback, errorCallback: this.errorCallback || this.config.errorCallback, qrRole: this.config.qrRole, callbackServer: this.config.callbackServer, sessionTimeout: this.config.sessionTimeout, socketEndpoint: this.config.socketEndpoint, autostart: this.config.autostart, autorefresh: this.config.autorefresh,
|
|
73
|
+
this.qr = (h("gataca-qrws", { wsOnMessage: this.wsOnMessage || this.config.wsOnMessage, wsOnOpen: this.wsOnOpen || this.config.wsOnOpen, successCallback: this.successCallback || this.config.successCallback, errorCallback: this.errorCallback || this.config.errorCallback, qrRole: this.config.qrRole, callbackServer: this.config.callbackServer, sessionTimeout: this.config.sessionTimeout, socketEndpoint: this.config.socketEndpoint, autostart: this.config.autostart, autorefresh: this.config.autorefresh, v: this.config.v, qrModalTitle: this.config.qrModalTitle, qrModalDescription: this.config.qrModalDescription, hideBrandTitle: this.config.hideBrandTitle, dynamicLink: this.config.dynamicLink }));
|
|
74
74
|
}
|
|
75
75
|
else {
|
|
76
|
-
this.qr = (h("gataca-qr", { checkStatus: this.checkStatus || this.config.checkStatus, createSession: this.createSession || this.config.createSession, successCallback: this.successCallback || this.config.successCallback, errorCallback: this.errorCallback || this.config.errorCallback, qrRole: this.config.qrRole, callbackServer: this.config.callbackServer, sessionTimeout: this.config.sessionTimeout, pollingFrequency: this.config.pollingFrequency, autostart: this.config.autostart, autorefresh: this.config.autorefresh,
|
|
76
|
+
this.qr = (h("gataca-qr", { checkStatus: this.checkStatus || this.config.checkStatus, createSession: this.createSession || this.config.createSession, successCallback: this.successCallback || this.config.successCallback, errorCallback: this.errorCallback || this.config.errorCallback, qrRole: this.config.qrRole, callbackServer: this.config.callbackServer, sessionTimeout: this.config.sessionTimeout, pollingFrequency: this.config.pollingFrequency, autostart: this.config.autostart, autorefresh: this.config.autorefresh, v: this.config.v, qrModalTitle: this.config.qrModalTitle, qrModalDescription: this.config.qrModalDescription, hideBrandTitle: this.config.hideBrandTitle, dynamicLink: this.config.dynamicLink }));
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
}
|
|
@@ -214,7 +214,7 @@ export class GatacaAutoQR {
|
|
|
214
214
|
"optional": true,
|
|
215
215
|
"docs": {
|
|
216
216
|
"tags": [],
|
|
217
|
-
"text": "***Mandatory***\nCreate session function to generate a new Session\nUsing
|
|
217
|
+
"text": "***Mandatory***\nCreate session function to generate a new Session\nUsing v=\"3\", it can provide just a session Id\nUsing another version, it must provide also the authentication request. The session Id is the id of the presentation definition"
|
|
218
218
|
},
|
|
219
219
|
"defaultValue": "undefined"
|
|
220
220
|
},
|
|
@@ -6,17 +6,12 @@ import { Success } from "./components/success/Success";
|
|
|
6
6
|
import { RetryButton } from "./components/retryButton/RetryButton";
|
|
7
7
|
import { ReadQR } from "./components/readQR/ReadQR";
|
|
8
8
|
import { QR } from "./components/qr/QR";
|
|
9
|
-
const DEEP_LINK_PREFIX = "https://gataca.
|
|
9
|
+
const DEEP_LINK_PREFIX = "https://api.gataca.io/qr/redirect.html";
|
|
10
10
|
//Default values
|
|
11
11
|
const DEFAULT_SESSION_TIMEOUT = 300; //5mins as in connect
|
|
12
12
|
const DEFAULT_POLLING_FREQ = 3;
|
|
13
|
-
const QR_ROLE_CONNECT = "connect";
|
|
14
|
-
const FUNCTION_ROLES = {
|
|
15
|
-
connect: "scan",
|
|
16
|
-
certify: "credential",
|
|
17
|
-
};
|
|
18
13
|
export class GatacaQR {
|
|
19
|
-
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.
|
|
14
|
+
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.v = "3"; this.qrModalTitle = "Quick Access"; this.modalTitleColor = "#4745B7"; this.qrModalDescription = "Sign up or sign in by scanning the QR Code with the Gataca Wallet"; this.hideModalTexts = false; this.hideModalBoxShadow = false; this.hideBrandTitle = false; this.logoSize = 0; this.logoSrc = logoGataca; this.qrSize = 300; this.modalWidth = 300; this.modalHeight = undefined; 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.readQrTitle = "Processing..."; this.readQrDescription = "Please wait a moment"; 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; }
|
|
20
15
|
disconnectedCallback() {
|
|
21
16
|
this.stop();
|
|
22
17
|
}
|
|
@@ -90,19 +85,11 @@ export class GatacaQR {
|
|
|
90
85
|
return this.sessionId;
|
|
91
86
|
}
|
|
92
87
|
getLink() {
|
|
93
|
-
if (this.
|
|
88
|
+
if (this.v === "2") {
|
|
94
89
|
return this.authenticationRequest;
|
|
95
90
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
link +=
|
|
99
|
-
this.qrRole === QR_ROLE_CONNECT
|
|
100
|
-
? "session=" + this.sessionId
|
|
101
|
-
: "process=" + this.sessionId;
|
|
102
|
-
link +=
|
|
103
|
-
"&callback=" + base64UrlEncode(encodeURIComponent(this.callbackServer));
|
|
104
|
-
link = encodeURIComponent(link);
|
|
105
|
-
return this.dynamicLink ? DEEP_LINK_PREFIX + link : link;
|
|
91
|
+
const authRequestEncoded = "?dl=" + base64UrlEncode(this.authenticationRequest);
|
|
92
|
+
return DEEP_LINK_PREFIX + authRequestEncoded;
|
|
106
93
|
}
|
|
107
94
|
async poll() {
|
|
108
95
|
let endTime = new Date().getTime() +
|
|
@@ -245,7 +232,7 @@ export class GatacaQR {
|
|
|
245
232
|
"optional": true,
|
|
246
233
|
"docs": {
|
|
247
234
|
"tags": [],
|
|
248
|
-
"text": "***Mandatory***\nCreate session function to generate a new Session\nUsing
|
|
235
|
+
"text": "***Mandatory***\nCreate session function to generate a new Session\nUsing v=\"3\", it can provide just a session Id\nUsing another version, it must provide also the authentication request. The session Id is the id of the presentation definition"
|
|
249
236
|
},
|
|
250
237
|
"defaultValue": "undefined"
|
|
251
238
|
},
|
|
@@ -355,23 +342,23 @@ export class GatacaQR {
|
|
|
355
342
|
"reflect": false,
|
|
356
343
|
"defaultValue": "false"
|
|
357
344
|
},
|
|
358
|
-
"
|
|
359
|
-
"type": "
|
|
345
|
+
"v": {
|
|
346
|
+
"type": "string",
|
|
360
347
|
"mutable": false,
|
|
361
348
|
"complexType": {
|
|
362
|
-
"original": "
|
|
363
|
-
"resolved": "
|
|
349
|
+
"original": "string",
|
|
350
|
+
"resolved": "string",
|
|
364
351
|
"references": {}
|
|
365
352
|
},
|
|
366
353
|
"required": false,
|
|
367
354
|
"optional": true,
|
|
368
355
|
"docs": {
|
|
369
356
|
"tags": [],
|
|
370
|
-
"text": "_[Optional]_\
|
|
357
|
+
"text": "_[Optional]_\nIf 3, handle deeplink redirects and deprecates (remove) v1 functionality. If not, the create session must be providing both an authentication request and a session Id"
|
|
371
358
|
},
|
|
372
|
-
"attribute": "v
|
|
359
|
+
"attribute": "v",
|
|
373
360
|
"reflect": false,
|
|
374
|
-
"defaultValue": "
|
|
361
|
+
"defaultValue": "\"3\""
|
|
375
362
|
},
|
|
376
363
|
"qrModalTitle": {
|
|
377
364
|
"type": "string",
|
|
@@ -6,15 +6,11 @@ import { Success } from "./components/success/Success";
|
|
|
6
6
|
import { RetryButton } from "./components/retryButton/RetryButton";
|
|
7
7
|
import { QR } from "./components/qr/QR";
|
|
8
8
|
import { ReadQR } from "./components/readQR/ReadQR";
|
|
9
|
-
const DEEP_LINK_PREFIX = "https://gataca.
|
|
9
|
+
const DEEP_LINK_PREFIX = "https://api.gataca.io/qr/redirect.html";
|
|
10
10
|
const DEFAULT_SESSION_TIMEOUT = 300;
|
|
11
11
|
const QR_ROLE_CONNECT = "connect";
|
|
12
|
-
const FUNCTION_ROLES = {
|
|
13
|
-
connect: "scan",
|
|
14
|
-
certify: "credential",
|
|
15
|
-
};
|
|
16
12
|
export class GatacaQRWS {
|
|
17
|
-
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.
|
|
13
|
+
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.v = "3"; this.qrModalTitle = "Quick Access"; this.modalTitleColor = "#4745B7"; this.qrModalDescription = "Sign up or sign in by scanning the QR Code with the Gataca Wallet"; this.hideModalTexts = false; this.hideModalBoxShadow = false; this.hideBrandTitle = false; this.logoSize = 0; this.logoSrc = logoGataca; this.qrSize = 300; this.modalWidth = 300; this.modalHeight = undefined; 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.readQrTitle = "Processing..."; this.readQrDescription = "Please wait a moment"; this.hideQrModalDescription = false; this.dynamicLink = true; this.sessionId = undefined; this.authenticationRequest = undefined; this.sessionData = undefined; this.result = RESULT_STATUS.NOT_STARTED; }
|
|
18
14
|
disconnectedCallback() {
|
|
19
15
|
this.stop();
|
|
20
16
|
}
|
|
@@ -126,19 +122,11 @@ export class GatacaQRWS {
|
|
|
126
122
|
: Promise.reject(new Error("No successful login"));
|
|
127
123
|
}
|
|
128
124
|
getLink() {
|
|
129
|
-
if (this.
|
|
125
|
+
if (this.v === "2" && this.qrRole == QR_ROLE_CONNECT) {
|
|
130
126
|
return this.authenticationRequest;
|
|
131
127
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
link +=
|
|
135
|
-
this.qrRole === QR_ROLE_CONNECT
|
|
136
|
-
? "session=" + this.sessionId
|
|
137
|
-
: "process=" + this.sessionId;
|
|
138
|
-
link +=
|
|
139
|
-
"&callback=" + base64UrlEncode(encodeURIComponent(this.callbackServer));
|
|
140
|
-
link = encodeURIComponent(link);
|
|
141
|
-
return this.dynamicLink ? DEEP_LINK_PREFIX + link : link;
|
|
128
|
+
const authRequestEncoded = "?dl=" + base64UrlEncode(this.authenticationRequest);
|
|
129
|
+
return DEEP_LINK_PREFIX + authRequestEncoded;
|
|
142
130
|
}
|
|
143
131
|
renderQRSection() {
|
|
144
132
|
switch (this.result) {
|
|
@@ -387,23 +375,23 @@ export class GatacaQRWS {
|
|
|
387
375
|
"reflect": false,
|
|
388
376
|
"defaultValue": "false"
|
|
389
377
|
},
|
|
390
|
-
"
|
|
391
|
-
"type": "
|
|
378
|
+
"v": {
|
|
379
|
+
"type": "string",
|
|
392
380
|
"mutable": false,
|
|
393
381
|
"complexType": {
|
|
394
|
-
"original": "
|
|
395
|
-
"resolved": "
|
|
382
|
+
"original": "string",
|
|
383
|
+
"resolved": "string",
|
|
396
384
|
"references": {}
|
|
397
385
|
},
|
|
398
386
|
"required": false,
|
|
399
387
|
"optional": true,
|
|
400
388
|
"docs": {
|
|
401
389
|
"tags": [],
|
|
402
|
-
"text": "
|
|
390
|
+
"text": "_[Optional]_\nIf 3, handle deeplink redirects and deprecates (remove) v1 functionality. If not, the create session must be providing both an authentication request and a session Id"
|
|
403
391
|
},
|
|
404
|
-
"attribute": "v
|
|
392
|
+
"attribute": "v",
|
|
405
393
|
"reflect": false,
|
|
406
|
-
"defaultValue": "
|
|
394
|
+
"defaultValue": "\"3\""
|
|
407
395
|
},
|
|
408
396
|
"qrModalTitle": {
|
|
409
397
|
"type": "string",
|