onairos 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.babelrc ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "presets": ["@babel/preset-env", "@babel/preset-react"]
3
+ }
4
+
package/.gitattributes ADDED
@@ -0,0 +1,2 @@
1
+ # Auto detect text files and perform LF normalization
2
+ * text=auto
Binary file
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _OnairosBlack = _interopRequireDefault(require("./OnairosBlack.png"));
9
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+ function Onairos(_ref) {
11
+ let {
12
+ sendData,
13
+ onairosID,
14
+ access_token
15
+ } = _ref;
16
+ const OnairosAnime = async () => {
17
+ try {
18
+ console.log("Clicked Onairos Connect");
19
+ await ConnectOnairos();
20
+ } catch (error) {
21
+ // Handle any errors here
22
+ console.error("Error connecting to Onairos", error);
23
+ }
24
+ };
25
+ const ConnectOnairos = async () => {
26
+ // Title here has to match a model in the Users : accountInfo.AccountInfo.models
27
+ // Prepare the data to be sent
28
+
29
+ const access_token = "access_token";
30
+ // Send the data to the content script
31
+ window.postMessage({
32
+ source: 'bookstore',
33
+ type: 'GET_API_URL'
34
+ }, '*');
35
+ window.postMessage({
36
+ source: 'webpage',
37
+ type: 'GET_API_URL',
38
+ webpage: 'proxy book store',
39
+ onairosID: onairosID,
40
+ access_token: access_token,
41
+ account: "ConnectedAccountRef.current",
42
+ //No Longer needed, REMOVE
43
+ requestData: sendData
44
+ });
45
+ // chrome.runtime.sendMessage({ source: 'bookstore', type: 'GET_API_URL'});
46
+ };
47
+
48
+ return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("button", {
49
+ className: "OnairosConnect flex flex-col items-center justify-center text-white font-bold py-2 px-4 rounded cursor-pointer",
50
+ onClick: OnairosAnime
51
+ }, /*#__PURE__*/_react.default.createElement("img", {
52
+ src: _OnairosBlack.default,
53
+ alt: "Onairos Logo",
54
+ className: "w-5 h-5 max-w-10 object-scale-down mb-2"
55
+ }), /*#__PURE__*/_react.default.createElement("span", null, "Connect to Onairos")));
56
+ }
57
+ var _default = exports.default = Onairos;
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "onairos",
3
+ "version": "0.0.0",
4
+ "dependencies": {
5
+ "@testing-library/jest-dom": "^5.17.0",
6
+ "@testing-library/react": "^13.4.0",
7
+ "@testing-library/user-event": "^13.5.0",
8
+ "react-scripts": "5.0.1",
9
+ "web-vitals": "^2.1.4"
10
+ },
11
+ "scripts": {
12
+ "start": "react-scripts start",
13
+ "build": "babel src --out-dir dist --copy-files",
14
+ "test": "react-scripts test",
15
+ "eject": "react-scripts eject"
16
+ },
17
+ "eslintConfig": {
18
+ "extends": [
19
+ "react-app",
20
+ "react-app/jest"
21
+ ]
22
+ },
23
+ "browserslist": {
24
+ "production": [
25
+ ">0.2%",
26
+ "not dead",
27
+ "not op_mini all"
28
+ ],
29
+ "development": [
30
+ "last 1 chrome version",
31
+ "last 1 firefox version",
32
+ "last 1 safari version"
33
+ ]
34
+ },
35
+ "devDependencies": {
36
+ "@babel/cli": "^7.23.0",
37
+ "@babel/core": "^7.23.2",
38
+ "@babel/preset-env": "^7.23.2",
39
+ "@babel/preset-react": "^7.22.15",
40
+ "tailwindcss": "^3.3.5"
41
+ },
42
+ "peerDependencies": {
43
+ "react": "^18.2.0",
44
+ "react-dom": "^18.2.0",
45
+ "tailwindcss": "^3.3.5"
46
+ },
47
+ "description": "The Onairos Library is a collection of functions that enable Applications to connect and communicate data with Onairos Identities via User Authorization. Integration for developers is designed to be seamless, simple and effective for all applications",
48
+ "main": "dist/onairos.js",
49
+ "repository": {
50
+ "type": "git",
51
+ "url": "git+https://github.com/zd819/OnairosNPM.git"
52
+ },
53
+ "keywords": [
54
+ "Onairos",
55
+ "Identity"
56
+ ],
57
+ "author": "Zion Darko",
58
+ "license": "UNLICENSED",
59
+ "bugs": {
60
+ "url": "https://github.com/zd819/OnairosNPM/issues"
61
+ },
62
+ "homepage": "https://github.com/zd819/OnairosNPM#readme"
63
+ }
Binary file
@@ -0,0 +1,45 @@
1
+ import React from 'react';
2
+ import onairosLogo from "./OnairosBlack.png";
3
+
4
+ function Onairos( {sendData, onairosID, access_token}) {
5
+ const OnairosAnime = async () => {
6
+ try {
7
+ console.log("Clicked Onairos Connect")
8
+ await ConnectOnairos();
9
+ } catch (error) {
10
+ // Handle any errors here
11
+ console.error("Error connecting to Onairos", error);
12
+ }
13
+ };
14
+
15
+ const ConnectOnairos = async () => {
16
+ // Title here has to match a model in the Users : accountInfo.AccountInfo.models
17
+ // Prepare the data to be sent
18
+ const access_token="access_token";
19
+ // Send the data to the content script
20
+ window.postMessage({ source: 'bookstore', type: 'GET_API_URL' }, '*');
21
+ window.postMessage({
22
+ source: 'webpage',
23
+ type: 'GET_API_URL',
24
+ webpage: 'proxy book store',
25
+ onairosID:onairosID,
26
+ access_token:access_token,
27
+ account:"ConnectedAccountRef.current", //No Longer needed, REMOVE
28
+ requestData: sendData,
29
+ });
30
+ };
31
+
32
+ return (
33
+ <div>
34
+ <button
35
+ className="OnairosConnect flex flex-col items-center justify-center text-white font-bold py-2 px-4 rounded cursor-pointer"
36
+ onClick={OnairosAnime}
37
+ >
38
+ <img src={onairosLogo} alt="Onairos Logo" className="w-5 h-5 max-w-10 object-scale-down mb-2" />
39
+ <span>Connect to Onairos</span>
40
+ </button>
41
+ </div>
42
+ );
43
+ }
44
+
45
+ export default Onairos;