onairos 0.1.112 → 0.1.113

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/RSA.js CHANGED
@@ -49,4 +49,5 @@ function bufferToBase64(buffer) {
49
49
  } catch (e) {
50
50
  console.error("Eror in buffertoBase64 : ", e);
51
51
  }
52
- }
52
+ }
53
+ //# sourceMappingURL=RSA.js.map
package/dist/getPin.js CHANGED
@@ -22,4 +22,5 @@ async function getPin(hashedOthentSub) {
22
22
  return data;
23
23
  }).catch(error => console.error(error));
24
24
  }
25
- ;
25
+ ;
26
+ //# sourceMappingURL=getPin.js.map
package/dist/onairos.js CHANGED
@@ -6,45 +6,40 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.Onairos = Onairos;
8
8
  var _react = _interopRequireDefault(require("react"));
9
- var _sha = _interopRequireDefault(require("crypto-js/sha256"));
10
9
  var _RSA = require("./RSA");
11
10
  var _getPin = _interopRequireDefault(require("./getPin"));
12
11
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
13
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
14
- /* global __webpack_public_path__ */
15
- __webpack_public_path__ = '/static/js/';
16
-
17
- // import {connect, decrypt} from '@othent/kms';
18
-
12
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } // import {connect, decrypt} from '@othent/kms';
13
+ // import sha256 from 'crypto-js/sha256';
19
14
  // import { Buffer } from 'buffer';
20
15
 
21
16
  // Dynamic import for crypto-js's sha256
22
- // const loadSha256 = async () =>{
23
- // try{
24
-
25
- // console.log("loadSha256 loading ")
26
- // const module = await import(/* webpackChunkName: "sha256" */ 'crypto-js/sha256');
27
- // console.log("loadSha256 loading successful")
28
-
29
- // return module;
30
- // } catch (e) {
31
- // console.error("Error loading Othent:", e, e.request, e.response);
32
- // throw e; // Rethrow the error to be caught by the caller
33
- // }
34
- // };
17
+ const loadSha256 = async () => {
18
+ try {
19
+ console.log("loadSha256 loading ");
20
+ const module = await Promise.resolve().then(() => _interopRequireWildcard(require( /* webpackChunkName: "sha256" */'crypto-js/sha256')));
21
+ console.log("loadSha256 loading successful");
22
+ return module;
23
+ } catch (e) {
24
+ console.error("Error loading Othent:", e, e.request, e.response);
25
+ throw e; // Rethrow the error to be caught by the caller
26
+ }
27
+ };
35
28
 
36
29
  // Dynamic import for @othent/kms
37
- const loadOthentKms = async () => {
30
+ // const loadOthentKms = async () =>{
31
+ async function loadOthentKms() {
38
32
  try {
39
33
  console.log("Othent dynamic loading ");
40
34
  const module = await Promise.resolve().then(() => _interopRequireWildcard(require( /* webpackChunkName: "othent-kms" */'@othent/kms')));
41
35
  console.log("Othent loading successful");
42
- return module;
36
+ return module.default;
43
37
  } catch (e) {
44
38
  console.error("Error loading Othent:", e, e.request, e.response);
45
39
  throw e; // Rethrow the error to be caught by the caller
46
40
  }
47
- };
41
+ }
42
+ ;
48
43
 
49
44
  // import Buffer
50
45
  function Onairos(_ref) {
@@ -104,10 +99,9 @@ function Onairos(_ref) {
104
99
  async function ConnectOnairos() {
105
100
  try {
106
101
  // console.log("Trying SHa")
107
- // const sha2562 = await loadSha256().then(()=>{
108
- // console.log("Othent LOADED In PROMISE")
109
-
110
- // });
102
+ const sha2562 = await loadSha256().then(() => {
103
+ console.log("Othent LOADED In PROMISE");
104
+ });
111
105
 
112
106
  // Get User Othent Secure Details
113
107
  const othentKms = await loadOthentKms();
@@ -117,8 +111,8 @@ function Onairos(_ref) {
117
111
  console.log("Othent LOADED MOVING ON");
118
112
  const userDetails = await connect();
119
113
  // console.log("userDetails : ", hashedOthentSub);
120
- // const sha256 = (await loadSha256()).default;
121
- const hashedOthentSub = (0, _sha.default)(userDetails.sub).toString();
114
+ const sha256 = (await loadSha256()).default;
115
+ const hashedOthentSub = sha256(userDetails.sub).toString();
122
116
  const encryptedPin = await (0, _getPin.default)(hashedOthentSub);
123
117
  function convertToBuffer(string) {
124
118
  try {
@@ -168,10 +162,7 @@ function Onairos(_ref) {
168
162
  ;
169
163
  return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("button", {
170
164
  className: "OnairosConnect w-20 h-20 flex flex-col items-center justify-center text-white font-bold py-2 px-4 rounded cursor-pointer",
171
- onClick: async () => {
172
- console.log('Button clicked');
173
- await OnairosAnime();
174
- }
165
+ onClick: OnairosAnime
175
166
  }, /*#__PURE__*/_react.default.createElement("img", {
176
167
  src: "https://onairos.sirv.com/Images/OnairosBlack.png",
177
168
  alt: "Onairos Logo",
@@ -183,4 +174,5 @@ function Onairos(_ref) {
183
174
 
184
175
  // // export default Onairos;
185
176
 
186
- // module.exports = Onairos;
177
+ // module.exports = Onairos;
178
+ //# sourceMappingURL=onairos.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "onairos",
3
- "version": "0.1.112",
3
+ "version": "0.1.113",
4
4
  "dependencies": {
5
5
  "@othent/kms": "^1.0.5",
6
6
  "@testing-library/jest-dom": "^5.17.0",
@@ -15,7 +15,8 @@
15
15
  "sideEffects": false,
16
16
  "scripts": {
17
17
  "start": "react-scripts start",
18
- "build": "webpack --mode production",
18
+ "build2": "webpack --mode production",
19
+ "build":"babel src --out-dir dist --source-maps --copy-files",
19
20
  "test": "react-scripts test",
20
21
  "eject": "react-scripts eject"
21
22
  },