this.me 2.7.7 → 2.7.8

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 (64) hide show
  1. package/README.md +82 -58
  2. package/docs/Me.html +697 -0
  3. package/docs/README.md +91 -0
  4. package/docs/ThisMe.html +690 -0
  5. package/docs/cli_main.js.html +340 -0
  6. package/docs/fonts/OpenSans-Bold-webfont.eot +0 -0
  7. package/docs/fonts/OpenSans-Bold-webfont.svg +1830 -0
  8. package/docs/fonts/OpenSans-Bold-webfont.woff +0 -0
  9. package/docs/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  10. package/docs/fonts/OpenSans-BoldItalic-webfont.svg +1830 -0
  11. package/docs/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  12. package/docs/fonts/OpenSans-Italic-webfont.eot +0 -0
  13. package/docs/fonts/OpenSans-Italic-webfont.svg +1830 -0
  14. package/docs/fonts/OpenSans-Italic-webfont.woff +0 -0
  15. package/docs/fonts/OpenSans-Light-webfont.eot +0 -0
  16. package/docs/fonts/OpenSans-Light-webfont.svg +1831 -0
  17. package/docs/fonts/OpenSans-Light-webfont.woff +0 -0
  18. package/docs/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  19. package/docs/fonts/OpenSans-LightItalic-webfont.svg +1835 -0
  20. package/docs/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  21. package/docs/fonts/OpenSans-Regular-webfont.eot +0 -0
  22. package/docs/fonts/OpenSans-Regular-webfont.svg +1831 -0
  23. package/docs/fonts/OpenSans-Regular-webfont.woff +0 -0
  24. package/docs/global.html +454 -0
  25. package/docs/index.html +258 -0
  26. package/docs/me.js.html +211 -0
  27. package/docs/module-CLI.html +963 -0
  28. package/docs/neurons_logo.png +0 -0
  29. package/docs/scripts/app.min.js +1 -0
  30. package/docs/scripts/linenumber.js +26 -0
  31. package/docs/scripts/prettify/Apache-License-2.0.txt +202 -0
  32. package/docs/scripts/prettify/lang-css.js +2 -0
  33. package/docs/scripts/prettify/prettify.js +28 -0
  34. package/docs/scripts/search.js +39 -0
  35. package/docs/styles/app.min.css +1 -0
  36. package/docs/styles/iframe.css +13 -0
  37. package/docs/styles/jsdoc-default.css +358 -0
  38. package/docs/styles/prettify-jsdoc.css +111 -0
  39. package/docs/styles/prettify-tomorrow.css +132 -0
  40. package/docs/styles/reset.css +44 -0
  41. package/jsdoc.json +43 -0
  42. package/package.json +22 -29
  43. package/src/cli/main.js +176 -0
  44. package/src/env.js +8 -0
  45. package/{me.html → src/me.html} +1 -0
  46. package/src/me.js +47 -0
  47. package/src/os/unix/install_me.sh +5 -0
  48. package/src/this/video.js +0 -0
  49. package/Me.js +0 -71
  50. package/crypto/crypto-browser.js +0 -20
  51. package/crypto/crypto-node.js +0 -16
  52. package/crypto/hash/hashWorker.js +0 -11
  53. package/crypto/hash/hashing.js +0 -43
  54. package/demo.js +0 -12
  55. package/main.js +0 -77
  56. package/me2.js +0 -57
  57. package/src/errorHandler.js +0 -9
  58. package/test.js +0 -36
  59. package/testHashIt.js +0 -3
  60. package/webpack.config.js +0 -18
  61. /package/{this/dir.js → index.js} +0 -0
  62. /package/{this/file.js → src/this/dir.js} +0 -0
  63. /package/{this/url.js → src/this/file.js} +0 -0
  64. /package/{this/video.js → src/this/url.js} +0 -0
@@ -0,0 +1,258 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ ...
6
+ <meta charset="utf-8">
7
+ <meta name="viewport" content="width=device-width, initial-scale=1">
8
+ <title>This.Me Home</title>
9
+
10
+ <script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js"></script>
11
+ <script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
12
+ <script src="./build/entry.js"></script>
13
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
14
+ <!--[if lt IE 9]>
15
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
16
+ <![endif]-->
17
+ <link href="https://fonts.googleapis.com/css?family=Roboto:100,400,700|Inconsolata,700" rel="stylesheet">
18
+ <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
19
+ <link type="text/css" rel="stylesheet" href="https://jmblog.github.io/color-themes-for-google-code-prettify/themes/tomorrow-night.min.css">
20
+ <link type="text/css" rel="stylesheet" href="styles/app.min.css">
21
+ <link type="text/css" rel="stylesheet" href="styles/iframe.css">
22
+ <link type="text/css" rel="stylesheet" href="style.css">
23
+ <script async defer src="https://buttons.github.io/buttons.js"></script>
24
+
25
+
26
+ </head>
27
+
28
+
29
+
30
+ <body class="layout small-header">
31
+ <div id="stickyNavbarOverlay"></div>
32
+
33
+
34
+ <div class="top-nav">
35
+ <div class="inner">
36
+ <a id="hamburger" role="button" class="navbar-burger" aria-label="menu" aria-expanded="false">
37
+ <span aria-hidden="true"></span>
38
+ <span aria-hidden="true"></span>
39
+ <span aria-hidden="true"></span>
40
+ </a>
41
+ <div class="logo">
42
+
43
+
44
+ <a href="index.html">
45
+ <h1 class="navbar-item">This.Me</h1>
46
+ </a>
47
+
48
+ </div>
49
+ <div class="menu">
50
+
51
+ <div class="navigation">
52
+ <a
53
+ href="index.html"
54
+ class="link"
55
+ >
56
+ Documentation
57
+ </a>
58
+
59
+
60
+
61
+ <a
62
+ class="link user-link "
63
+ href="https://suign.github.io/all.this/"
64
+ >
65
+ all.This @Packages
66
+ </a>
67
+
68
+ <a
69
+ class="link user-link "
70
+ href="https://github.com/suiGn/neurons.me"
71
+ >
72
+ Github
73
+ </a>
74
+
75
+ <a
76
+ class="link user-link "
77
+ href="https://neurons.me"
78
+ >
79
+ App
80
+ </a>
81
+
82
+
83
+
84
+ </div>
85
+ </div>
86
+ </div>
87
+ </div>
88
+ <div id="main">
89
+ <div
90
+ class="sidebar "
91
+ id="sidebarNav"
92
+ >
93
+
94
+ <div class="search-wrapper">
95
+ <input id="search" type="text" placeholder="Search docs..." class="input">
96
+ </div>
97
+
98
+ <nav>
99
+
100
+ <h2><a href="index.html">Documentation</a></h2><div class="category"><h3>Modules</h3><ul><li><a href="module-CLI.html">CLI</a></li></ul><h3>Classes</h3><ul><li><a href="Me.html">Me</a></li></ul></div>
101
+
102
+ </nav>
103
+ </div>
104
+ <div class="core" id="main-content-wrapper">
105
+ <div class="content">
106
+ <header class="page-title">
107
+ <p></p>
108
+ <h1>Home</h1>
109
+ </header>
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+ <h3> </h3>
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+
132
+
133
+ <section>
134
+ <article><img src="https://suign.github.io/neurons.me/neurons_logo.png" alt="SVG Image" width="123" height="123" style="width123px; height:123px;">
135
+ <h1>This.Me</h1>
136
+ <p><strong>This.Me</strong> is a digital identity representation of <strong>Me</strong> as it encapsulates the essence of an entity which is then passed for cryptographic guarantees.</p>
137
+ <p>Users no longer depend on centralized authorities for <strong>identity and data management</strong>. They hold the keys (literally) to their identity and data.</p>
138
+ <p>Services become more <strong>user-centric,</strong> providing services based on cryptographic proofs rather than centralized authorities.</p>
139
+ <p>Here, you don't just own your identity; you seal it with cryptographic brilliance, untouched and ungoverned by any other.</p>
140
+ <h2>Getting Started:</h2>
141
+ <pre class="prettyprint source lang-bash"><code>npm i -g this.me
142
+ </code></pre>
143
+ <h3>Require it:</h3>
144
+ <pre class="prettyprint source lang-js"><code>const me = require('this.me');
145
+ </code></pre>
146
+ <h3>Usage Example:</h3>
147
+ <p>Use it like this:</p>
148
+ <pre class="prettyprint source lang-js"><code>const ThisMe = require('this.me');
149
+ const user = new ThisMe('John', 'Doe', '1990-01-01', 'mypassword123', '1234');
150
+ const identityObject = user.getIdentityObject();
151
+ // identityObject can now be passed to Cleaker for hashing
152
+ </code></pre>
153
+ <h2>Understanding .ME</h2>
154
+ <h5>Structure of this.me Package:</h5>
155
+ <p><strong>User Data Model:</strong> Define a class or object structure to hold the user's data.
156
+ <strong>Data Validation:</strong> Functions to validate the input data.
157
+ <strong>Data Processing:</strong> Preparing data for hashing (by Cleaker).
158
+ <strong>Exporting Data:</strong> A method to export the processed data in a format that Cleaker can accept.</p>
159
+ <h1>Setting up your Context. 👋🏻👋🏼👋🏽👋🏾👋🏿</h1>
160
+ <p>Defining the <strong>environment</strong> and context in which your code runs, especially when you're interacting with intelligent agents or services like <strong>me.</strong></p>
161
+ <p>Having a clear declaration of the environment and the context can have a series of implications for security, interoperability, and clarity. The codebase is often vast, dynamic, and continually evolving. Given the dynamic nature of such environments, ensuring the integrity of the code and data becomes paramount. You wouldn't want an agent to execute or rely on code that has been tampered with or is different from the expected version. This is where hashing comes into play.</p>
162
+ <hr>
163
+ <p><code>.me</code> objects to serve as both a local identity on the user's host machine and as an identity within a larger network. When a <code>.me</code> object is authenticated on a network, it can access data not only on the local host but also from other nodes within that network. Conversely, if it's not authenticated or recognized by the network, it should only access local data. Here's how this could be structured:</p>
164
+ <h3>Local and Network Identity Management</h3>
165
+ <ol>
166
+ <li><strong>Local Identity</strong>:
167
+ <ul>
168
+ <li>When a <code>.me</code> object is created, it's initially configured with access to local host resources.</li>
169
+ <li>Users can manage their local profile, which includes their personal settings, preferences, and local data access permissions.</li>
170
+ </ul>
171
+ </li>
172
+ <li><strong>Network Identity</strong>:
173
+ <ul>
174
+ <li>To access resources on the network, a <code>.me</code> object must be authenticated against the network, possibly by a central authority or a decentralized consensus mechanism.</li>
175
+ <li>Once authenticated, the <code>.me</code> object's hash is recognized across the network, granting the user access to network resources according to their permissions.</li>
176
+ </ul>
177
+ </li>
178
+ <li><strong>Access Control</strong>:
179
+ <ul>
180
+ <li>Both local and network resources use access control lists (ACLs) that are tied to the <code>.me</code> object's hash.</li>
181
+ <li>These ACLs determine what resources the <code>.me</code> object can access and the level of interaction permitted (read, write, execute).</li>
182
+ </ul>
183
+ </li>
184
+ <li><strong>Data Fetching</strong>:
185
+ <ul>
186
+ <li>When fetching data, the system checks if the <code>.me</code> object is authenticated within the network.</li>
187
+ <li>If authenticated, the <code>.me</code> object can retrieve data from across the network based on the established ACLs.</li>
188
+ <li>If not authenticated, the <code>.me</code> object is limited to retrieving data from the local host.</li>
189
+ </ul>
190
+ </li>
191
+ <li><strong>CLI Functionality</strong>:
192
+ <ul>
193
+ <li>The CLI tool facilitates the creation of <code>.me</code> objects, management of profiles, and authentication processes.</li>
194
+ <li>It could include commands to &quot;login&quot; to the network, &quot;logout&quot;, or &quot;sync&quot; local profiles with network profiles.</li>
195
+ </ul>
196
+ </li>
197
+ <li><strong>Data Sharing and Security</strong>:
198
+ <ul>
199
+ <li>Data sharing across the network should be secure, with encryption mechanisms in place to protect data in transit and at rest.</li>
200
+ <li>The <code>.me</code> object's unique hash can be part of the encryption key, ensuring that only the intended <code>.me</code> object can decrypt and access the shared data.</li>
201
+ </ul>
202
+ </li>
203
+ </ol>
204
+ <h3>Example CLI Commands</h3>
205
+ <ul>
206
+ <li><code>me init</code>: Initializes a new <code>.me</code> object on the local host.</li>
207
+ <li><code>me login</code>: Authenticates the <code>.me</code> object against the network to access network resources.</li>
208
+ <li><code>me logout</code>: De-authenticates the <code>.me</code> object from the network, reverting to local-only access.</li>
209
+ <li><code>me sync</code>: Synchronizes local <code>.me</code> object data with the network profile.</li>
210
+ <li><code>me fetch</code>: Retrieves data from the local host or network based on authentication status.</li>
211
+ </ul>
212
+ <p>By implementing this dual identity system, you enable a seamless transition for users between operating solely on their local device and engaging with a broader network, all while maintaining strict control over their data access rights.</p></article>
213
+ </section>
214
+
215
+
216
+
217
+
218
+
219
+
220
+ </div>
221
+
222
+ <footer class="footer">
223
+ <div class="content has-text-centered">
224
+ <p>
225
+ <style>
226
+ .center-div {
227
+ display: flex;
228
+ justify-content: center;
229
+ align-items: center;
230
+ height: 89px;
231
+ }
232
+
233
+ img {
234
+ max-width: 100%;
235
+ max-height: 100%;
236
+ }
237
+ </style>
238
+ <div class="center-div">
239
+ <img src="https://suign.github.io/neurons.me/neurons_logo.png" alt="Witness our Seal.">
240
+ </div>
241
+ <a href="http://neurons.me" target="_blank">neurons.me</a>
242
+ </p>
243
+ </div>
244
+ </footer>
245
+
246
+ </div>
247
+ <div id="side-nav" class="side-nav">
248
+ </div>
249
+ </div>
250
+ <script src="scripts/app.min.js"></script>
251
+ <script>PR.prettyPrint();</script>
252
+ <script src="scripts/linenumber.js"> </script>
253
+
254
+ <script src="scripts/search.js"> </script>
255
+
256
+
257
+ </body>
258
+ </html>
@@ -0,0 +1,211 @@
1
+
2
+
3
+ <!DOCTYPE html>
4
+ <html lang="en">
5
+
6
+ <head>
7
+ ...
8
+ <meta charset="utf-8">
9
+ <meta name="viewport" content="width=device-width, initial-scale=1">
10
+ <title>This.Me me.js</title>
11
+
12
+ <script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js"></script>
13
+ <script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
14
+ <script src="./build/entry.js"></script>
15
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
16
+ <!--[if lt IE 9]>
17
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
18
+ <![endif]-->
19
+ <link href="https://fonts.googleapis.com/css?family=Roboto:100,400,700|Inconsolata,700" rel="stylesheet">
20
+ <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
21
+ <link type="text/css" rel="stylesheet" href="https://jmblog.github.io/color-themes-for-google-code-prettify/themes/tomorrow-night.min.css">
22
+ <link type="text/css" rel="stylesheet" href="styles/app.min.css">
23
+ <link type="text/css" rel="stylesheet" href="styles/iframe.css">
24
+ <link type="text/css" rel="stylesheet" href="style.css">
25
+ <script async defer src="https://buttons.github.io/buttons.js"></script>
26
+
27
+
28
+ </head>
29
+
30
+
31
+
32
+ <body class="layout small-header">
33
+ <div id="stickyNavbarOverlay"></div>
34
+
35
+
36
+ <div class="top-nav">
37
+ <div class="inner">
38
+ <a id="hamburger" role="button" class="navbar-burger" aria-label="menu" aria-expanded="false">
39
+ <span aria-hidden="true"></span>
40
+ <span aria-hidden="true"></span>
41
+ <span aria-hidden="true"></span>
42
+ </a>
43
+ <div class="logo">
44
+
45
+
46
+ <a href="index.html">
47
+ <h1 class="navbar-item">This.Me</h1>
48
+ </a>
49
+
50
+ </div>
51
+ <div class="menu">
52
+
53
+ <div class="navigation">
54
+ <a
55
+ href="index.html"
56
+ class="link"
57
+ >
58
+ Documentation
59
+ </a>
60
+
61
+
62
+
63
+ <a
64
+ class="link user-link "
65
+ href="https://suign.github.io/all.this/"
66
+ >
67
+ all.This @Packages
68
+ </a>
69
+
70
+ <a
71
+ class="link user-link "
72
+ href="https://github.com/suiGn/neurons.me"
73
+ >
74
+ Github
75
+ </a>
76
+
77
+ <a
78
+ class="link user-link "
79
+ href="https://neurons.me"
80
+ >
81
+ App
82
+ </a>
83
+
84
+
85
+
86
+ </div>
87
+ </div>
88
+ </div>
89
+ </div>
90
+ <div id="main">
91
+ <div
92
+ class="sidebar "
93
+ id="sidebarNav"
94
+ >
95
+
96
+ <div class="search-wrapper">
97
+ <input id="search" type="text" placeholder="Search docs..." class="input">
98
+ </div>
99
+
100
+ <nav>
101
+
102
+ <h2><a href="index.html">Documentation</a></h2><div class="category"><h3>Modules</h3><ul><li><a href="module-CLI.html">CLI</a></li></ul><h3>Classes</h3><ul><li><a href="Me.html">Me</a></li></ul></div>
103
+
104
+ </nav>
105
+ </div>
106
+ <div class="core" id="main-content-wrapper">
107
+ <div class="content">
108
+ <header class="page-title">
109
+ <p>Source</p>
110
+ <h1>me.js</h1>
111
+ </header>
112
+
113
+
114
+
115
+
116
+
117
+ <section>
118
+ <article>
119
+ <pre class="prettyprint source linenums"><code>/**
120
+ * Represents a user identity in the this.me system.
121
+ */
122
+ class Me {
123
+ /**
124
+ * Create a ThisMe instance.
125
+ * @param {string} name - The first name of the user.
126
+ * @param {string} lastname - The last name of the user.
127
+ * @param {string} birthday - The birthday of the user in YYYY-MM-DD format.
128
+ * @param {string} password - The password chosen by the user.
129
+ * @param {string} pin - The personal identification number chosen by the user.
130
+ */
131
+ constructor(name, lastname, birthday, password, pin) {
132
+ this.name = name;
133
+ this.lastname = lastname;
134
+ this.birthday = birthday;
135
+ this.password = password;
136
+ this.pin = pin;
137
+ }
138
+
139
+ /**
140
+ * Validates the user data. Throws an error if any field is empty.
141
+ * @throws Will throw an error if a required field is missing.
142
+ */
143
+ validateData() {
144
+ if (!this.name || !this.lastname || !this.birthday || !this.password || !this.pin) {
145
+ throw new Error("All fields must be filled");
146
+ }
147
+ // Further validation rules can be added here
148
+ }
149
+
150
+ /**
151
+ * Prepares and returns the identity object for hashing.
152
+ * @returns {Object} The identity object with user data.
153
+ */
154
+ getIdentityObject() {
155
+ this.validateData();
156
+ return {
157
+ name: this.name,
158
+ lastname: this.lastname,
159
+ birthday: this.birthday,
160
+ credentials: `${this.password}:${this.pin}` // Combining password and pin
161
+ };
162
+ }
163
+ }
164
+
165
+ export default Me;
166
+ </code></pre>
167
+ </article>
168
+ </section>
169
+
170
+
171
+
172
+
173
+ </div>
174
+
175
+ <footer class="footer">
176
+ <div class="content has-text-centered">
177
+ <p>
178
+ <style>
179
+ .center-div {
180
+ display: flex;
181
+ justify-content: center;
182
+ align-items: center;
183
+ height: 89px;
184
+ }
185
+
186
+ img {
187
+ max-width: 100%;
188
+ max-height: 100%;
189
+ }
190
+ </style>
191
+ <div class="center-div">
192
+ <img src="https://suign.github.io/neurons.me/neurons_logo.png" alt="Witness our Seal.">
193
+ </div>
194
+ <a href="http://neurons.me" target="_blank">neurons.me</a>
195
+ </p>
196
+ </div>
197
+ </footer>
198
+
199
+ </div>
200
+ <div id="side-nav" class="side-nav">
201
+ </div>
202
+ </div>
203
+ <script src="scripts/app.min.js"></script>
204
+ <script>PR.prettyPrint();</script>
205
+ <script src="scripts/linenumber.js"> </script>
206
+
207
+ <script src="scripts/search.js"> </script>
208
+
209
+
210
+ </body>
211
+ </html>