@gataca/qr 2.0.2 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/cjs/gataca-autoqr_6.cjs.entry.js +638 -0
  2. package/dist/cjs/gatacaqr.cjs.js +19 -0
  3. package/dist/cjs/index-4be0cdca.js +1435 -0
  4. package/dist/cjs/index.cjs.js +16 -0
  5. package/dist/cjs/loader.cjs.js +21 -0
  6. package/dist/cjs/utils-383ee834.js +26 -0
  7. package/dist/collection/assets/icons/gat-icon-alert.svg +5 -0
  8. package/dist/collection/assets/icons/gat-icon-check.svg +5 -0
  9. package/dist/collection/assets/icons/gat-icon-refresh.svg +4 -0
  10. package/dist/collection/assets/images/logo_gataca.svg +26 -0
  11. package/dist/collection/collection-manifest.json +17 -0
  12. package/dist/collection/components/gataca-autoqr/gataca-autoqr.css +116 -0
  13. package/dist/collection/components/gataca-autoqr/gataca-autoqr.js +323 -0
  14. package/dist/collection/components/gataca-qr/gataca-qr.css +261 -0
  15. package/dist/collection/components/gataca-qr/gataca-qr.js +828 -0
  16. package/dist/collection/components/gataca-qrdisplay/gataca-qrdisplay.js +154 -0
  17. package/dist/collection/components/gataca-qrws/gataca-qrws.css +251 -0
  18. package/dist/collection/components/gataca-qrws/gataca-qrws.js +566 -0
  19. package/dist/collection/components/gataca-ssibutton/gataca-ssibutton.css +116 -0
  20. package/dist/collection/components/gataca-ssibutton/gataca-ssibutton.js +679 -0
  21. package/dist/collection/components/gataca-ssibuttonws/gataca-ssibuttonws.css +116 -0
  22. package/dist/collection/components/gataca-ssibuttonws/gataca-ssibuttonws.js +410 -0
  23. package/dist/collection/index.js +2 -0
  24. package/dist/collection/utils/index.js +1 -0
  25. package/dist/collection/utils/utils.js +21 -0
  26. package/dist/{gatacaqr/gat-icon-refresh-8d3dc25f.js → components/gat-icon-refresh.js} +23 -1
  27. package/dist/{gatacaqr/gataca-autoqr.entry.js → components/gataca-autoqr.js} +67 -7
  28. package/dist/components/gataca-qr.js +6 -0
  29. package/dist/components/gataca-qr2.js +227 -0
  30. package/dist/components/gataca-qrdisplay.js +6 -0
  31. package/dist/components/gataca-qrdisplay2.js +93 -0
  32. package/dist/components/gataca-qrws.js +6 -0
  33. package/dist/{gatacaqr/gataca-qrws.entry.js → components/gataca-qrws2.js} +50 -10
  34. package/dist/components/gataca-ssibutton.js +6 -0
  35. package/dist/{gatacaqr/gataca-ssibutton.entry.js → components/gataca-ssibutton2.js} +83 -9
  36. package/dist/components/gataca-ssibuttonws.js +6 -0
  37. package/dist/{gatacaqr/gataca-ssibuttonws.entry.js → components/gataca-ssibuttonws2.js} +53 -7
  38. package/dist/components/index.js +8 -0
  39. package/dist/esm/gataca-autoqr_6.entry.js +629 -0
  40. package/dist/esm/gatacaqr.js +17 -0
  41. package/dist/esm/index-80311733.js +1409 -0
  42. package/dist/esm/index.js +1 -0
  43. package/dist/esm/loader.js +17 -0
  44. package/dist/esm/polyfills/core-js.js +11 -0
  45. package/dist/esm/polyfills/css-shim.js +1 -0
  46. package/dist/esm/polyfills/dom.js +79 -0
  47. package/dist/esm/polyfills/es5-html-element.js +1 -0
  48. package/dist/esm/polyfills/index.js +34 -0
  49. package/dist/esm/polyfills/system.js +6 -0
  50. package/dist/gatacaqr/gatacaqr.esm.js +1 -129
  51. package/dist/gatacaqr/index.esm.js +1 -1
  52. package/dist/gatacaqr/p-a5648391.js +2 -0
  53. package/dist/gatacaqr/p-b37057bb.entry.js +1 -0
  54. package/dist/gatacaqr/p-b8ba109f.js +1 -0
  55. package/dist/index.cjs.js +1 -0
  56. package/dist/index.js +1 -0
  57. package/dist/types/components/gataca-qr/gataca-qr.d.ts +75 -0
  58. package/dist/types/components/gataca-ssibutton/gataca-ssibutton.d.ts +75 -0
  59. package/dist/types/components.d.ts +240 -0
  60. package/package.json +1 -1
  61. package/dist/gatacaqr/app-globals-0f993ce5.js +0 -3
  62. package/dist/gatacaqr/css-shim-8eec97b3.js +0 -4
  63. package/dist/gatacaqr/dom-1b0cf05d.js +0 -73
  64. package/dist/gatacaqr/gataca-qr.entry.js +0 -171
  65. package/dist/gatacaqr/gataca-qrdisplay-0320bb25.js +0 -97
  66. package/dist/gatacaqr/gataca-qrdisplay.entry.js +0 -2
  67. package/dist/gatacaqr/index-d0db23e4.js +0 -3262
  68. package/dist/gatacaqr/shadow-css-146f2f6f.js +0 -387
  69. /package/dist/{gatacaqr → esm}/utils-05ba6c9f.js +0 -0
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const utils = require('./utils-383ee834.js');
6
+
7
+
8
+
9
+ Object.defineProperty(exports, 'RESULT_STATUS', {
10
+ enumerable: true,
11
+ get: function () {
12
+ return utils.RESULT_STATUS;
13
+ }
14
+ });
15
+ exports.base64UrlEncode = utils.base64UrlEncode;
16
+ exports.checkMobile = utils.checkMobile;
@@ -0,0 +1,21 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-4be0cdca.js');
6
+
7
+ /*
8
+ Stencil Client Patch Esm v2.19.3 | MIT Licensed | https://stenciljs.com
9
+ */
10
+ const patchEsm = () => {
11
+ return index.promiseResolve();
12
+ };
13
+
14
+ const defineCustomElements = (win, options) => {
15
+ if (typeof window === 'undefined') return Promise.resolve();
16
+ return patchEsm().then(() => {
17
+ return index.bootstrapLazy([["gataca-autoqr_6.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]}],[1,"gataca-ssibutton",{"buttonText":[1,"button-text"],"checkStatus":[16],"createSession":[16],"successCallback":[16],"errorCallback":[16],"qrRole":[1,"qr-role"],"callbackServer":[1,"callback-server"],"sessionTimeout":[2,"session-timeout"],"pollingFrequency":[2,"polling-frequency"],"autorefresh":[4],"v2":[4,"v-2"],"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],"getSessionData":[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],"v2":[4,"v-2"],"qrModalTitle":[1,"qr-modal-title"],"qrModalDescription":[1,"qr-modal-description"],"hideBrandTitle":[4,"hide-brand-title"],"dynamicLink":[4,"dynamic-link"],"open":[32],"getSessionData":[64]}],[1,"gataca-qr",{"checkStatus":[16],"createSession":[16],"successCallback":[16],"errorCallback":[16],"qrRole":[1,"qr-role"],"callbackServer":[1,"callback-server"],"autostart":[4],"autorefresh":[4],"v2":[4,"v-2"],"qrModalTitle":[1,"qr-modal-title"],"modalTitleColor":[1,"modal-title-color"],"qrModalDescription":[1,"qr-modal-description"],"hideBrandTitle":[4,"hide-brand-title"],"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"],"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]}],[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],"v2":[4,"v-2"],"qrModalTitle":[1,"qr-modal-title"],"qrModalDescription":[1,"qr-modal-description"],"hideBrandTitle":[4,"hide-brand-title"],"dynamicLink":[4,"dynamic-link"],"sessionId":[32],"authenticationRequest":[32],"sessionData":[32],"result":[32],"display":[64],"stop":[64],"getSessionData":[64]},[[2,"sessionMsg","sessionMsgReceived"]]],[0,"gataca-qrdisplay",{"qrData":[1,"qr-data"],"size":[2],"logoSize":[2,"logo-size"],"logoSrc":[1,"logo-src"],"qrColor":[1,"qr-color"],"rounded":[4]}]]]], options);
18
+ });
19
+ };
20
+
21
+ exports.defineCustomElements = defineCustomElements;
@@ -0,0 +1,26 @@
1
+ 'use strict';
2
+
3
+ function checkMobile() {
4
+ var check = false;
5
+ (function (a) {
6
+ if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) ||
7
+ /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4)))
8
+ check = true;
9
+ })(navigator.userAgent || navigator.vendor);
10
+ return check;
11
+ }
12
+ function base64UrlEncode(str) {
13
+ let b64 = btoa(str);
14
+ return b64.replace(/\+/g, "-").replace(/\//g, "_").replace(/\=+$/, "");
15
+ }
16
+ exports.RESULT_STATUS = void 0;
17
+ (function (RESULT_STATUS) {
18
+ RESULT_STATUS[RESULT_STATUS["NOT_STARTED"] = -1] = "NOT_STARTED";
19
+ RESULT_STATUS[RESULT_STATUS["ONGOING"] = 0] = "ONGOING";
20
+ RESULT_STATUS[RESULT_STATUS["SUCCESS"] = 1] = "SUCCESS";
21
+ RESULT_STATUS[RESULT_STATUS["FAILED"] = 2] = "FAILED";
22
+ RESULT_STATUS[RESULT_STATUS["EXPIRED"] = 3] = "EXPIRED";
23
+ })(exports.RESULT_STATUS || (exports.RESULT_STATUS = {}));
24
+
25
+ exports.base64UrlEncode = base64UrlEncode;
26
+ exports.checkMobile = checkMobile;
@@ -0,0 +1,5 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M10.2908 3.8602L1.82075 18.0002C1.64612 18.3026 1.55372 18.6455 1.55274 18.9947C1.55176 19.3439 1.64224 19.6873 1.81518 19.9907C1.98812 20.2941 2.23748 20.547 2.53846 20.7241C2.83944 20.9012 3.18155 20.9964 3.53075 21.0002H20.4708C20.82 20.9964 21.1621 20.9012 21.463 20.7241C21.764 20.547 22.0134 20.2941 22.1863 19.9907C22.3593 19.6873 22.4497 19.3439 22.4488 18.9947C22.4478 18.6455 22.3554 18.3026 22.1808 18.0002L13.7108 3.8602C13.5325 3.56631 13.2815 3.32332 12.9819 3.15469C12.6824 2.98605 12.3445 2.89746 12.0008 2.89746C11.657 2.89746 11.3191 2.98605 11.0196 3.15469C10.72 3.32332 10.469 3.56631 10.2908 3.8602V3.8602Z" stroke="#CD2B31" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
3
+ <path d="M12 9V13" stroke="#CD2B31" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
4
+ <path d="M12 17H12.01" stroke="#CD2B31" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5
+ </svg>
@@ -0,0 +1,5 @@
1
+
2
+ <svg width="52" height="53" viewBox="0 0 52 53" fill="none" xmlns="http://www.w3.org/2000/svg">
3
+ <circle cx="26" cy="26.6719" r="26" fill="#3D9A50"/>
4
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M38.52 17.7495C39.5805 18.8099 39.5805 20.5293 38.52 21.5898L23.5846 36.5251C22.5242 37.5856 20.8048 37.5856 19.7443 36.5251L12.9555 29.7363C11.895 28.6759 11.895 26.9565 12.9555 25.896C14.016 24.8355 15.7354 24.8355 16.7958 25.896L21.6645 30.7647L34.6797 17.7495C35.7402 16.689 37.4595 16.689 38.52 17.7495Z" fill="white"/>
5
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M23 4V10H17" stroke="#8B8B8B" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
3
+ <path d="M20.4899 15C19.8399 16.8399 18.6094 18.4187 16.984 19.4985C15.3586 20.5783 13.4263 21.1006 11.4783 20.9866C9.53026 20.8726 7.67203 20.1286 6.18363 18.8667C4.69524 17.6047 3.6573 15.8932 3.22625 13.9901C2.79519 12.0869 2.99436 10.0952 3.79374 8.31508C4.59313 6.53496 5.94942 5.06288 7.65823 4.12065C9.36705 3.17843 11.3358 2.81711 13.2678 3.09116C15.1999 3.3652 16.9905 4.25975 18.3699 5.64001L22.9999 10" stroke="#8B8B8B" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
4
+ </svg>
@@ -0,0 +1,26 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 26.5.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 635.3 597.47" style="enable-background:new 0 0 635.3 597.47;" xml:space="preserve">
5
+ <style type="text/css">
6
+ .st0{fill:#4745B7;}
7
+ </style>
8
+ <g>
9
+ <path class="st0" d="M605.79,323.41c-27.97-41.97-73.44-71.28-125.99-77.49c9.15-21.33,14.23-44.83,14.23-69.51
10
+ c0-10.17-0.87-20.14-2.53-29.85C477.33,63.35,404.89,0,317.64,0c-97.42,0-176.38,78.97-176.38,176.39
11
+ c0,24.69,5.08,48.19,14.24,69.52C67.93,256.24,0,330.71,0,421.07c0,40.39,13.59,77.61,36.43,107.35
12
+ c32.25,41.98,82.94,69.05,139.96,69.06c52.96,0,100.47-23.34,132.8-60.3c2.95-3.37,5.78-6.86,8.47-10.45
13
+ c5.91,7.88,12.48,15.23,19.6,22.02c5.6,5.34,11.54,10.34,17.81,14.91c10.12,7.38,21.05,13.71,32.63,18.84
14
+ c21.78,9.63,45.88,14.99,71.22,14.99c2.51,0,5-0.07,7.48-0.17c93.95-3.92,168.9-81.31,168.9-176.22
15
+ C635.3,384.95,624.43,351.37,605.79,323.41z M225.74,123.33c29.31-50.76,94.21-68.16,144.97-38.85
16
+ c43.58,25.16,62.56,76.57,48.51,122.73c-2.31,7.61-5.52,15.07-9.67,22.25c-9.27,16.06-22.11,28.78-36.94,37.74
17
+ c-1.22,0.74-2.46,1.46-3.71,2.15c-11.94,6.57-25.04,10.77-38.53,12.41c-21.84,2.66-44.68-1.42-65.25-13.14
18
+ c-0.47-0.27-0.93-0.54-1.4-0.81C213.64,238.27,196.6,173.81,225.74,123.33z M552.49,471.15c-12.23,22.81-31.47,39.26-53.55,48.23
19
+ c-30.17,12.26-64.41,9.23-92.62-7.04l-15.21-8.78l-47.17-27.22l-60.22-34.76l-2.87-1.66l-82.32-47.51l-57.12,47.93l104.95,60.58
20
+ c-33.24,29.15-82.62,35.42-123.04,12.09c-13.42-7.75-24.5-17.98-33.01-29.79c-23.68-32.85-27.39-77.85-5.83-115.2
21
+ c29.2-50.58,93.74-68.03,144.42-39.16c0.47,0.27,0.93,0.54,1.4,0.81c1.23,0.7,2.47,1.39,3.72,2.07l21.81,12.59l35.8,20.67
22
+ l59.82,34.53l3.16,1.83l93.79,54.13l57.04-47.86l0.05-0.09l-115.86-66.87c4.5-3.88,9.29-7.35,14.31-10.38
23
+ c1.23-0.74,2.46-1.46,3.72-2.15c31.56-17.37,71.18-18.24,104.61,1.21c16.89,9.82,30.09,23.73,39.06,39.78
24
+ C568.45,399.76,570.12,438.26,552.49,471.15z"/>
25
+ </g>
26
+ </svg>
@@ -0,0 +1,17 @@
1
+ {
2
+ "entries": [
3
+ "./components/gataca-qrdisplay/gataca-qrdisplay.js",
4
+ "./components/gataca-qr/gataca-qr.js",
5
+ "./components/gataca-qrws/gataca-qrws.js",
6
+ "./components/gataca-ssibutton/gataca-ssibutton.js",
7
+ "./components/gataca-ssibuttonws/gataca-ssibuttonws.js",
8
+ "./components/gataca-autoqr/gataca-autoqr.js"
9
+ ],
10
+ "compiler": {
11
+ "name": "@stencil/core",
12
+ "version": "2.19.3",
13
+ "typescriptVersion": "4.7.4"
14
+ },
15
+ "collections": [],
16
+ "bundles": []
17
+ }
@@ -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
+ }
@@ -0,0 +1,323 @@
1
+ import { h, } from "@stencil/core";
2
+ const DEFAULT_REPOSITORY = "https://studio.gataca.io/api/v1/qrconfigs";
3
+ const fixFunctions = (data) => {
4
+ var _a, _b, _c, _d, _e, _f;
5
+ data.errorCallback = deserializeFunction((_a = data.errorCallback) === null || _a === void 0 ? void 0 : _a.toString());
6
+ data.successCallback = deserializeFunction((_b = data.successCallback) === null || _b === void 0 ? void 0 : _b.toString());
7
+ data.wsOnMessage = deserializeFunction((_c = data.wsOnMessage) === null || _c === void 0 ? void 0 : _c.toString());
8
+ data.wsOnOpen = deserializeFunction((_d = data.wsOnOpen) === null || _d === void 0 ? void 0 : _d.toString());
9
+ data.checkStatus = deserializeFunction((_e = data.checkStatus) === null || _e === void 0 ? void 0 : _e.toString());
10
+ data.createSession = deserializeFunction((_f = data.createSession) === null || _f === void 0 ? void 0 : _f.toString());
11
+ return data;
12
+ };
13
+ const deserializeFunction = (data) => {
14
+ if (data) {
15
+ return new Function("return " + data)();
16
+ }
17
+ return undefined;
18
+ };
19
+ export class GatacaAutoQR {
20
+ constructor() {
21
+ this.configId = undefined;
22
+ this.configRepository = DEFAULT_REPOSITORY;
23
+ this.successCallback = undefined;
24
+ this.errorCallback = undefined;
25
+ this.checkStatus = undefined;
26
+ this.createSession = undefined;
27
+ this.wsOnOpen = undefined;
28
+ this.wsOnMessage = undefined;
29
+ this.config = undefined;
30
+ this.loading = undefined;
31
+ this.loading = true;
32
+ fetch(this.configRepository + "/" + this.configId, {
33
+ method: "GET",
34
+ headers: {
35
+ "Content-Type": "application/json",
36
+ },
37
+ })
38
+ .then((response) => {
39
+ response
40
+ .json()
41
+ .then((data) => {
42
+ data = fixFunctions(data);
43
+ this.config = data;
44
+ this.loading = false;
45
+ })
46
+ .catch((err) => {
47
+ console.log("Cannot retrieve selected config", err);
48
+ this.loading = false;
49
+ });
50
+ })
51
+ .catch((err) => {
52
+ console.log("Cannot retrieve selected config", err);
53
+ this.loading = false;
54
+ });
55
+ }
56
+ /**
57
+ * Retrieve manually the session data on a successful login
58
+ */
59
+ async getSessionData() {
60
+ return this.qr.getSessionData();
61
+ }
62
+ selectQR() {
63
+ if (this.config.useButton) {
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, v2: this.config.v2, qrModalTitle: this.config.qrModalTitle, qrModalDescription: this.config.qrModalDescription, hideBrandTitle: this.config.hideBrandTitle, dynamicLink: this.config.dynamicLink }));
66
+ }
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, v2: this.config.v2, qrModalTitle: this.config.qrModalTitle, qrModalDescription: this.config.qrModalDescription, hideBrandTitle: this.config.hideBrandTitle, dynamicLink: this.config.dynamicLink }));
69
+ }
70
+ }
71
+ else {
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, v2: this.config.v2, qrModalTitle: this.config.qrModalTitle, qrModalDescription: this.config.qrModalDescription, hideBrandTitle: this.config.hideBrandTitle, dynamicLink: this.config.dynamicLink }));
74
+ }
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, v2: this.config.v2, qrModalTitle: this.config.qrModalTitle, qrModalDescription: this.config.qrModalDescription, hideBrandTitle: this.config.hideBrandTitle, dynamicLink: this.config.dynamicLink }));
77
+ }
78
+ }
79
+ }
80
+ render() {
81
+ if (this.loading) {
82
+ //TODO: Improve loading message
83
+ return h("div", null, "Loading...");
84
+ }
85
+ if (this.config) {
86
+ this.selectQR();
87
+ return this.qr;
88
+ }
89
+ //TODO: Improve error message
90
+ return h("div", null, "Error loading your config...");
91
+ }
92
+ static get is() { return "gataca-autoqr"; }
93
+ static get encapsulation() { return "shadow"; }
94
+ static get originalStyleUrls() {
95
+ return {
96
+ "$": ["gataca-autoqr.scss"]
97
+ };
98
+ }
99
+ static get styleUrls() {
100
+ return {
101
+ "$": ["gataca-autoqr.css"]
102
+ };
103
+ }
104
+ static get properties() {
105
+ return {
106
+ "configId": {
107
+ "type": "string",
108
+ "mutable": false,
109
+ "complexType": {
110
+ "original": "string",
111
+ "resolved": "string",
112
+ "references": {}
113
+ },
114
+ "required": false,
115
+ "optional": false,
116
+ "docs": {
117
+ "tags": [],
118
+ "text": "***Mandatory***\nID of the QR configuration to display"
119
+ },
120
+ "attribute": "config-id",
121
+ "reflect": false
122
+ },
123
+ "configRepository": {
124
+ "type": "string",
125
+ "mutable": false,
126
+ "complexType": {
127
+ "original": "string",
128
+ "resolved": "string",
129
+ "references": {}
130
+ },
131
+ "required": false,
132
+ "optional": false,
133
+ "docs": {
134
+ "tags": [],
135
+ "text": "___Optional___\nConfigURL Repository to download the config from"
136
+ },
137
+ "attribute": "config-repository",
138
+ "reflect": false,
139
+ "defaultValue": "DEFAULT_REPOSITORY"
140
+ },
141
+ "successCallback": {
142
+ "type": "unknown",
143
+ "mutable": false,
144
+ "complexType": {
145
+ "original": "(data?: any) => void",
146
+ "resolved": "(data?: any) => void",
147
+ "references": {}
148
+ },
149
+ "required": false,
150
+ "optional": false,
151
+ "docs": {
152
+ "tags": [],
153
+ "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"
154
+ },
155
+ "defaultValue": "undefined"
156
+ },
157
+ "errorCallback": {
158
+ "type": "unknown",
159
+ "mutable": false,
160
+ "complexType": {
161
+ "original": "(error?: Error) => void",
162
+ "resolved": "(error?: Error) => void",
163
+ "references": {
164
+ "Error": {
165
+ "location": "global"
166
+ }
167
+ }
168
+ },
169
+ "required": false,
170
+ "optional": false,
171
+ "docs": {
172
+ "tags": [],
173
+ "text": "___Just for polling flavour___\n***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"
174
+ },
175
+ "defaultValue": "undefined"
176
+ },
177
+ "checkStatus": {
178
+ "type": "unknown",
179
+ "mutable": false,
180
+ "complexType": {
181
+ "original": "(\n id?: string\n ) => Promise<{ result: RESULT_STATUS; data?: any }>",
182
+ "resolved": "(id?: string) => Promise<{ result: RESULT_STATUS; data?: any; }>",
183
+ "references": {
184
+ "Promise": {
185
+ "location": "global"
186
+ },
187
+ "RESULT_STATUS": {
188
+ "location": "import",
189
+ "path": "../../utils"
190
+ }
191
+ }
192
+ },
193
+ "required": false,
194
+ "optional": true,
195
+ "docs": {
196
+ "tags": [],
197
+ "text": "___Just for polling flavour___\n***Mandatory***\nCheck status function to query the current status of the session\nThe function must query a client endpoint to check the status. That endpoint must return an error if the session has expired."
198
+ },
199
+ "defaultValue": "undefined"
200
+ },
201
+ "createSession": {
202
+ "type": "unknown",
203
+ "mutable": false,
204
+ "complexType": {
205
+ "original": "() => Promise<{\n sessionId: string;\n authenticationRequest?: string;\n }>",
206
+ "resolved": "() => Promise<{ sessionId: string; authenticationRequest?: string; }>",
207
+ "references": {
208
+ "Promise": {
209
+ "location": "global"
210
+ }
211
+ }
212
+ },
213
+ "required": false,
214
+ "optional": true,
215
+ "docs": {
216
+ "tags": [],
217
+ "text": "***Mandatory***\nCreate session function to generate a new Session\nUsing V1, it can provide just a session Id\nUsing V2, it must provide also the authentication request. The session Id is the id of the presentation definition"
218
+ },
219
+ "defaultValue": "undefined"
220
+ },
221
+ "wsOnOpen": {
222
+ "type": "unknown",
223
+ "mutable": false,
224
+ "complexType": {
225
+ "original": "(socket: WebSocket) => void",
226
+ "resolved": "(socket: WebSocket) => void",
227
+ "references": {
228
+ "WebSocket": {
229
+ "location": "global"
230
+ }
231
+ }
232
+ },
233
+ "required": false,
234
+ "optional": false,
235
+ "docs": {
236
+ "tags": [],
237
+ "text": "___Just for WS flavour___\n[Optional]\nFunction to send a message to the server upon socket creation"
238
+ }
239
+ },
240
+ "wsOnMessage": {
241
+ "type": "unknown",
242
+ "mutable": false,
243
+ "complexType": {
244
+ "original": "(socket: WebSocket, msg: MessageEvent) => void",
245
+ "resolved": "(socket: WebSocket, msg: MessageEvent<any>) => void",
246
+ "references": {
247
+ "WebSocket": {
248
+ "location": "global"
249
+ },
250
+ "MessageEvent": {
251
+ "location": "global"
252
+ }
253
+ }
254
+ },
255
+ "required": false,
256
+ "optional": false,
257
+ "docs": {
258
+ "tags": [],
259
+ "text": "___Just for WS flavour___\n**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"
260
+ }
261
+ }
262
+ };
263
+ }
264
+ static get states() {
265
+ return {
266
+ "config": {},
267
+ "loading": {}
268
+ };
269
+ }
270
+ static get events() {
271
+ return [{
272
+ "method": "gatacaLoginCompleted",
273
+ "name": "gatacaLoginCompleted",
274
+ "bubbles": true,
275
+ "cancelable": true,
276
+ "composed": true,
277
+ "docs": {
278
+ "tags": [],
279
+ "text": "GatacaLoginCompleted event, triggered with session data upon login success"
280
+ },
281
+ "complexType": {
282
+ "original": "any",
283
+ "resolved": "any",
284
+ "references": {}
285
+ }
286
+ }, {
287
+ "method": "gatacaLoginFailed",
288
+ "name": "gatacaLoginFailed",
289
+ "bubbles": true,
290
+ "cancelable": true,
291
+ "composed": true,
292
+ "docs": {
293
+ "tags": [],
294
+ "text": "GatacaLoginFailed event, triggered with error upon login failure"
295
+ },
296
+ "complexType": {
297
+ "original": "any",
298
+ "resolved": "any",
299
+ "references": {}
300
+ }
301
+ }];
302
+ }
303
+ static get methods() {
304
+ return {
305
+ "getSessionData": {
306
+ "complexType": {
307
+ "signature": "() => Promise<any>",
308
+ "parameters": [],
309
+ "references": {
310
+ "Promise": {
311
+ "location": "global"
312
+ }
313
+ },
314
+ "return": "Promise<any>"
315
+ },
316
+ "docs": {
317
+ "text": "Retrieve manually the session data on a successful login",
318
+ "tags": []
319
+ }
320
+ }
321
+ };
322
+ }
323
+ }