this.me 2.8.0 β†’ 2.8.1

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.
Binary file
package/README.md CHANGED
@@ -1,30 +1,23 @@
1
- <img src="https://suign.github.io/neurons.me/neurons_logo.png" alt="SVG Image" width="123" height="123" style="width123px; height:123px;">
1
+ <img src="https://suign.github.io/this.me/neurons_logo.png" alt="SVG Image" width="123" height="123" style="width123px; height:123px;">
2
2
 
3
3
  # This.Me
4
4
 
5
-
6
5
  **This.Me** is a digital identity representation of **Me** as it encapsulates the essence of an entity which is then passed for cryptographic guarantees.
7
-
8
6
  Users no longer depend on centralized authorities for **identity and data management**. They hold the keys (literally) to their identity and data.
9
-
10
7
  Services become more **user-centric,** providing services based on cryptographic proofs rather than centralized authorities.
11
-
12
8
  Here, you don't just own your identity; you seal it with cryptographic brilliance, untouched and ungoverned by any other.
13
9
 
14
10
  ## Getting Started:
15
-
16
11
  ```bash
17
12
  npm i -g this.me
18
13
  ```
19
14
 
20
15
  ### Require it:
21
-
22
16
  ```js
23
17
  const me = require('this.me');
24
18
  ```
25
19
 
26
20
  ### Usage Example:
27
-
28
21
  Use it like this:
29
22
 
30
23
  ```js
@@ -44,19 +37,11 @@ const identityObject = user.getIdentityObject();
44
37
  **Exporting Data:** A method to export the processed data in a format that Cleaker can accept.
45
38
 
46
39
 
47
-
48
-
49
40
  # Setting up your Context. πŸ‘‹πŸ»πŸ‘‹πŸΌπŸ‘‹πŸ½πŸ‘‹πŸΎπŸ‘‹πŸΏ
50
41
  Defining the **environment** and context in which your code runs, especially when you're interacting with intelligent agents or services likeΒ **me.**
51
42
 
52
43
  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.
53
44
 
54
-
55
-
56
- -----
57
-
58
-
59
-
60
45
  `.me` objects to serve as both a local identity on the user's host machine and as an identity within a larger network. When a `.me` 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:
61
46
 
62
47
  ### Local and Network Identity Management
@@ -65,7 +50,7 @@ Having a clear declaration of the environment and the context can have a series
65
50
  - When a `.me` object is created, it's initially configured with access to local host resources.
66
51
  - Users can manage their local profile, which includes their personal settings, preferences, and local data access permissions.
67
52
  2. **Network Identity**:
68
- - To access resources on the network, a `.me` object must be authenticated against the network, possibly by a central authority or a decentralized consensus mechanism.
53
+ - To access resources on the network, a `.me` object must be authenticated against the network.
69
54
  - Once authenticated, the `.me` object's hash is recognized across the network, granting the user access to network resources according to their permissions.
70
55
  3. **Access Control**:
71
56
  - Both local and network resources use access control lists (ACLs) that are tied to the `.me` object's hash.
@@ -76,12 +61,12 @@ Having a clear declaration of the environment and the context can have a series
76
61
  - If not authenticated, the `.me` object is limited to retrieving data from the local host.
77
62
  5. **CLI Functionality**:
78
63
  - The CLI tool facilitates the creation of `.me` objects, management of profiles, and authentication processes.
79
- - It could include commands to "login" to the network, "logout", or "sync" local profiles with network profiles.
64
+ - It includes commands to "login" to the network, "logout", or "sync" local profiles with network profiles.
80
65
  6. **Data Sharing and Security**:
81
66
  - Data sharing across the network should be secure, with encryption mechanisms in place to protect data in transit and at rest.
82
67
  - The `.me` object's unique hash can be part of the encryption key, ensuring that only the intended `.me` object can decrypt and access the shared data.
83
68
 
84
- ### Example CLI Commands
69
+ ### CLI Commands
85
70
 
86
71
  - `me init`: Initializes a new `.me` object on the local host.
87
72
  - `me login`: Authenticates the `.me` object against the network to access network resources.
package/docs/Me.html CHANGED
@@ -62,7 +62,7 @@
62
62
  class="link user-link "
63
63
  href="https://suign.github.io/all.this/"
64
64
  >
65
- all.This @Packages
65
+ all.This @Packages
66
66
  </a>
67
67
 
68
68
  <a
@@ -151,7 +151,7 @@
151
151
 
152
152
 
153
153
  <div class="description">
154
- Create a ThisMe instance.
154
+ Create a me instance.
155
155
  </div>
156
156
 
157
157
 
package/docs/README.md CHANGED
@@ -1,30 +1,23 @@
1
- <img src="https://suign.github.io/neurons.me/neurons_logo.png" alt="SVG Image" width="123" height="123" style="width123px; height:123px;">
1
+ <img src="https://suign.github.io/this.me/neurons_logo.png" alt="SVG Image" width="123" height="123" style="width123px; height:123px;">
2
2
 
3
3
  # This.Me
4
4
 
5
-
6
5
  **This.Me** is a digital identity representation of **Me** as it encapsulates the essence of an entity which is then passed for cryptographic guarantees.
7
-
8
6
  Users no longer depend on centralized authorities for **identity and data management**. They hold the keys (literally) to their identity and data.
9
-
10
7
  Services become more **user-centric,** providing services based on cryptographic proofs rather than centralized authorities.
11
-
12
8
  Here, you don't just own your identity; you seal it with cryptographic brilliance, untouched and ungoverned by any other.
13
9
 
14
10
  ## Getting Started:
15
-
16
11
  ```bash
17
12
  npm i -g this.me
18
13
  ```
19
14
 
20
15
  ### Require it:
21
-
22
16
  ```js
23
17
  const me = require('this.me');
24
18
  ```
25
19
 
26
20
  ### Usage Example:
27
-
28
21
  Use it like this:
29
22
 
30
23
  ```js
@@ -44,19 +37,11 @@ const identityObject = user.getIdentityObject();
44
37
  **Exporting Data:** A method to export the processed data in a format that Cleaker can accept.
45
38
 
46
39
 
47
-
48
-
49
40
  # Setting up your Context. πŸ‘‹πŸ»πŸ‘‹πŸΌπŸ‘‹πŸ½πŸ‘‹πŸΎπŸ‘‹πŸΏ
50
41
  Defining the **environment** and context in which your code runs, especially when you're interacting with intelligent agents or services likeΒ **me.**
51
42
 
52
43
  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.
53
44
 
54
-
55
-
56
- -----
57
-
58
-
59
-
60
45
  `.me` objects to serve as both a local identity on the user's host machine and as an identity within a larger network. When a `.me` 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:
61
46
 
62
47
  ### Local and Network Identity Management
@@ -65,7 +50,7 @@ Having a clear declaration of the environment and the context can have a series
65
50
  - When a `.me` object is created, it's initially configured with access to local host resources.
66
51
  - Users can manage their local profile, which includes their personal settings, preferences, and local data access permissions.
67
52
  2. **Network Identity**:
68
- - To access resources on the network, a `.me` object must be authenticated against the network, possibly by a central authority or a decentralized consensus mechanism.
53
+ - To access resources on the network, a `.me` object must be authenticated against the network.
69
54
  - Once authenticated, the `.me` object's hash is recognized across the network, granting the user access to network resources according to their permissions.
70
55
  3. **Access Control**:
71
56
  - Both local and network resources use access control lists (ACLs) that are tied to the `.me` object's hash.
@@ -76,12 +61,12 @@ Having a clear declaration of the environment and the context can have a series
76
61
  - If not authenticated, the `.me` object is limited to retrieving data from the local host.
77
62
  5. **CLI Functionality**:
78
63
  - The CLI tool facilitates the creation of `.me` objects, management of profiles, and authentication processes.
79
- - It could include commands to "login" to the network, "logout", or "sync" local profiles with network profiles.
64
+ - It includes commands to "login" to the network, "logout", or "sync" local profiles with network profiles.
80
65
  6. **Data Sharing and Security**:
81
66
  - Data sharing across the network should be secure, with encryption mechanisms in place to protect data in transit and at rest.
82
67
  - The `.me` object's unique hash can be part of the encryption key, ensuring that only the intended `.me` object can decrypt and access the shared data.
83
68
 
84
- ### Example CLI Commands
69
+ ### CLI Commands
85
70
 
86
71
  - `me init`: Initializes a new `.me` object on the local host.
87
72
  - `me login`: Authenticates the `.me` object against the network to access network resources.
@@ -64,7 +64,7 @@
64
64
  class="link user-link "
65
65
  href="https://suign.github.io/all.this/"
66
66
  >
67
- all.This @Packages
67
+ all.This @Packages
68
68
  </a>
69
69
 
70
70
  <a
@@ -117,12 +117,6 @@
117
117
  <section>
118
118
  <article>
119
119
  <pre class="prettyprint source linenums"><code>#!/usr/bin/env node
120
- /**
121
- * @module CLI
122
- * @description Command Line Interface Functionalities for .me
123
- * Author: SuiGn
124
- */
125
-
126
120
  import os from 'os';
127
121
  import Me from '../me.js';
128
122
  import { Command } from 'commander';
@@ -130,11 +124,19 @@ const program = new Command();
130
124
  import inquirer from 'inquirer';
131
125
  import fs from 'fs';
132
126
  import path from 'path';
127
+ import printWelcome from './ascii_art/welcome.js';
133
128
  import crypto from 'crypto';
129
+ /**
130
+ * @module CLI
131
+ * @description
132
+ * .Me Command Line Interface Functionalities.
133
+ * The CLI application's code structure is categorized into two main parts:
134
+ * Command Definitions and Interactive Shell.*/
134
135
 
136
+ /***Command Definitions.*/
135
137
  program
136
138
  .command('user &lt;username> &lt;pin>')
137
- .description('Authenticate and start a session for a given user')
139
+ .description('Authenticate and start a .me session.')
138
140
  .action((username, pin) => {
139
141
  console.log(`Attempting to authenticate user: ${username}`);
140
142
  // Authentication logic here
@@ -143,28 +145,11 @@ program
143
145
  program
144
146
  .option('-o, --options', 'View options and commands');
145
147
 
146
- /**
147
- * Display a welcome message to the user.
148
- */
148
+ /***Welcome message.*/
149
149
  function welcomeToMe() {
150
- console.log(`
151
- ___________
152
- [------------]
153
- | .--------. |
154
- | |01010101| | __________
155
- | |11010101| | /__________\
156
- [--------| -------- |------| --*-- |-------]
157
- | [----_-.-----] |o ====== | |
158
- | ______|_|_______ |__________| |
159
- | / %%%%%%%%%%%% \ |
160
- | / %%%%%%%%%%%%%% \ |
161
- | ^^^^^^^^^^^^^^^^^^^^ |
162
- [---------------------------------.me-----------]
163
- -^^^^^^^^...
164
- Welcome to .me.
165
- `);
150
+ printWelcome();
166
151
  console.log(`Host_Session@ ${os.userInfo().username}`);
167
- console.log(`v.path@ ${os.homedir()}/this.me`);
152
+ console.log(`v.path@ ${os.homedir()}/.me`);
168
153
  }
169
154
 
170
155
  /**
@@ -201,10 +186,18 @@ async function getNewProfileDetails() {
201
186
  // Add validation as needed
202
187
  },
203
188
  {
204
- type: 'input',
205
- name: 'birthday',
206
- message: 'What is your birthday? (YYYY-MM-DD)',
207
- // Add validation as needed
189
+ type: 'input',
190
+ name: 'birthday',
191
+ message: 'What is your birthday? (YYYY-MM-DD)',
192
+ validate: function(value) {
193
+ const pass = value.match(
194
+ /^\d{4}-\d{2}-\d{2}$/
195
+ );
196
+ if (pass) {
197
+ return true;
198
+ }
199
+ return 'Please enter a valid date (YYYY-MM-DD)';
200
+ }
208
201
  },
209
202
  {
210
203
  type: 'password',
@@ -232,17 +225,17 @@ async function getNewProfileDetails() {
232
225
 
233
226
  /**
234
227
  * Writes the .me object to the filesystem.
235
- * @param {Me} meObject - The Me object to be saved.
228
+ * @param {Me} meProfile - The Me object to be saved.
236
229
  */
237
- function writeMeObjectToFile(meObject) {
238
- const meDirectory = path.join(os.homedir(), '.thisme');
230
+ function writeMeObjectToFile(meProfile) {
231
+ const meDirectory = path.join(os.homedir(), '.me');
239
232
  if (!fs.existsSync(meDirectory)) {
240
233
  fs.mkdirSync(meDirectory, { recursive: true });
241
234
  }
242
235
 
243
- const filePath = path.join(meDirectory, `${meObject.name}.me`);
236
+ const filePath = path.join(meDirectory, `${meProfile.name}.me`);
244
237
  // Consider encrypting the data here before writing to the filesystem
245
- fs.writeFileSync(filePath, JSON.stringify(meObject.getIdentityObject()));
238
+ fs.writeFileSync(filePath, JSON.stringify(meProfile.getIdentityObject()));
246
239
  console.log('Profile created successfully.');
247
240
  }
248
241
 
@@ -253,6 +246,47 @@ function displayOptionsAndCommands() {
253
246
  console.log(program.helpInformation());
254
247
  }
255
248
 
249
+ /**
250
+ * Lists all the .me profile file paths in the user's .me directory.
251
+ * @returns {string[]} An array of full file paths for each .me profile.
252
+ */
253
+ function listMeProfiles() {
254
+ const meDirectory = path.join(os.homedir(), '.me');
255
+ if (fs.existsSync(meDirectory)) {
256
+ const profileFiles = fs.readdirSync(meDirectory)
257
+ .filter(file => file.endsWith('.me'));
258
+ return profileFiles.map(file => path.join(meDirectory, file));
259
+ } else {
260
+ console.log('No profiles found.');
261
+ return [];
262
+ }
263
+ }
264
+
265
+ /**
266
+ * Prompts the user to select a .me profile or go back to the main menu.
267
+ * @returns {Promise&lt;string>} The file path of the selected profile or 'back' to go to the main menu.
268
+ */
269
+ async function selectProfile() {
270
+ const profiles = listMeProfiles();
271
+ if (profiles.length === 0) {
272
+ console.log('No profiles found.');
273
+ return 'back';
274
+ }
275
+
276
+ const choices = profiles.map(file => ({
277
+ name: path.basename(file, '.me'),
278
+ value: file
279
+ })).concat([{ name: 'Go Back to Main Menu', value: 'back' }]);
280
+
281
+ const answer = await inquirer.prompt([{
282
+ type: 'list',
283
+ name: 'selectedProfile',
284
+ message: 'Select a profile to view or go back:',
285
+ choices: choices
286
+ }]);
287
+ return answer.selectedProfile;
288
+ }
289
+
256
290
  /**
257
291
  * Main function to handle the CLI interactions.
258
292
  * Continuously prompts the user for actions until an exit command is given.
@@ -263,13 +297,19 @@ async function main() {
263
297
  while (!exit) {
264
298
  const choice = await getUserChoice();
265
299
  switch (choice) {
266
- case 'View Existing Profiles':
267
- console.log('Existing profiles will be displayed here.');
300
+ /**
301
+ * Handles the 'View Existing Profiles' choice.
302
+ * Lists and displays all existing .me profiles.
303
+ */
304
+ case 'View Existing Profiles':
305
+ const selectedProfile = await selectProfile();
306
+ if (selectedProfile === 'back') {
268
307
  break;
269
- case 'Create New Profile':
270
- const meObject = await getNewProfileDetails();
271
- writeMeObjectToFile(meObject);
272
- break;
308
+ }
309
+ // Read and display the selected profile details here
310
+ console.log(`Selected profile: ${selectedProfile}`);
311
+ // Add logic to handle the selected profile
312
+ break;
273
313
  case 'Exit':
274
314
  console.log('Exiting .me CLI.');
275
315
  exit = true;
@@ -293,6 +333,7 @@ process.on('uncaughtException', (err) => {
293
333
  });
294
334
 
295
335
 
336
+
296
337
  </code></pre>
297
338
  </article>
298
339
  </section>
package/docs/index.html CHANGED
@@ -62,7 +62,7 @@
62
62
  class="link user-link "
63
63
  href="https://suign.github.io/all.this/"
64
64
  >
65
- all.This @Packages
65
+ all.This @Packages
66
66
  </a>
67
67
 
68
68
  <a
@@ -131,12 +131,12 @@
131
131
 
132
132
 
133
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;">
134
+ <article><img src="https://suign.github.io/this.me/neurons_logo.png" alt="SVG Image" width="123" height="123" style="width123px; height:123px;">
135
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>
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.
137
+ Users no longer depend on centralized authorities for <strong>identity and data management</strong>. They hold the keys (literally) to their identity and data.
138
+ Services become more <strong>user-centric,</strong> providing services based on cryptographic proofs rather than centralized authorities.
139
+ Here, you don't just own your identity; you seal it with cryptographic brilliance, untouched and ungoverned by any other.</p>
140
140
  <h2>Getting Started:</h2>
141
141
  <pre class="prettyprint source lang-bash"><code>npm i -g this.me
142
142
  </code></pre>
@@ -159,7 +159,6 @@ const identityObject = user.getIdentityObject();
159
159
  <h1>Setting up your Context. πŸ‘‹πŸ»πŸ‘‹πŸΌπŸ‘‹πŸ½πŸ‘‹πŸΎπŸ‘‹πŸΏ</h1>
160
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
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
162
  <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
163
  <h3>Local and Network Identity Management</h3>
165
164
  <ol>
@@ -171,7 +170,7 @@ const identityObject = user.getIdentityObject();
171
170
  </li>
172
171
  <li><strong>Network Identity</strong>:
173
172
  <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>
173
+ <li>To access resources on the network, a <code>.me</code> object must be authenticated against the network.</li>
175
174
  <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
175
  </ul>
177
176
  </li>
@@ -191,7 +190,7 @@ const identityObject = user.getIdentityObject();
191
190
  <li><strong>CLI Functionality</strong>:
192
191
  <ul>
193
192
  <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>
193
+ <li>It includes commands to &quot;login&quot; to the network, &quot;logout&quot;, or &quot;sync&quot; local profiles with network profiles.</li>
195
194
  </ul>
196
195
  </li>
197
196
  <li><strong>Data Sharing and Security</strong>:
@@ -201,7 +200,7 @@ const identityObject = user.getIdentityObject();
201
200
  </ul>
202
201
  </li>
203
202
  </ol>
204
- <h3>Example CLI Commands</h3>
203
+ <h3>CLI Commands</h3>
205
204
  <ul>
206
205
  <li><code>me init</code>: Initializes a new <code>.me</code> object on the local host.</li>
207
206
  <li><code>me login</code>: Authenticates the <code>.me</code> object against the network to access network resources.</li>
package/docs/me.js.html CHANGED
@@ -64,7 +64,7 @@
64
64
  class="link user-link "
65
65
  href="https://suign.github.io/all.this/"
66
66
  >
67
- all.This @Packages
67
+ all.This @Packages
68
68
  </a>
69
69
 
70
70
  <a
@@ -121,7 +121,7 @@
121
121
  */
122
122
  class Me {
123
123
  /**
124
- * Create a ThisMe instance.
124
+ * Create a me instance.
125
125
  * @param {string} name - The first name of the user.
126
126
  * @param {string} lastname - The last name of the user.
127
127
  * @param {string} birthday - The birthday of the user in YYYY-MM-DD format.
@@ -62,7 +62,7 @@
62
62
  class="link user-link "
63
63
  href="https://suign.github.io/all.this/"
64
64
  >
65
- all.This @Packages
65
+ all.This @Packages
66
66
  </a>
67
67
 
68
68
  <a
@@ -122,8 +122,9 @@
122
122
  <div class="container-overview">
123
123
 
124
124
 
125
- <div class="description">Command Line Interface Functionalities for .me
126
- Author: SuiGn</div>
125
+ <div class="description">.Me Command Line Interface Functionalities.
126
+ The CLI application's code structure is categorized into two main parts:
127
+ Command Definitions and Interactive Shell.</div>
127
128
 
128
129
 
129
130
 
@@ -164,7 +165,7 @@ Author: SuiGn</div>
164
165
  <p class="tag-source">
165
166
  <a href="cli_main.js.html" class="button">View Source</a>
166
167
  <span>
167
- <a href="cli_main.js.html">cli/main.js</a>, <a href="cli_main.js.html#line2">line 2</a>
168
+ <a href="cli_main.js.html">cli/main.js</a>, <a href="cli_main.js.html#line11">line 11</a>
168
169
  </span>
169
170
  </p>
170
171
 
@@ -267,7 +268,7 @@ Author: SuiGn</div>
267
268
  <p class="tag-source">
268
269
  <a href="cli_main.js.html" class="button">View Source</a>
269
270
  <span>
270
- <a href="cli_main.js.html">cli/main.js</a>, <a href="cli_main.js.html#line134">line 134</a>
271
+ <a href="cli_main.js.html">cli/main.js</a>, <a href="cli_main.js.html#line127">line 127</a>
271
272
  </span>
272
273
  </p>
273
274
 
@@ -370,7 +371,7 @@ Author: SuiGn</div>
370
371
  <p class="tag-source">
371
372
  <a href="cli_main.js.html" class="button">View Source</a>
372
373
  <span>
373
- <a href="cli_main.js.html">cli/main.js</a>, <a href="cli_main.js.html#line71">line 71</a>
374
+ <a href="cli_main.js.html">cli/main.js</a>, <a href="cli_main.js.html#line56">line 56</a>
374
375
  </span>
375
376
  </p>
376
377
 
@@ -498,7 +499,7 @@ Author: SuiGn</div>
498
499
  <p class="tag-source">
499
500
  <a href="cli_main.js.html" class="button">View Source</a>
500
501
  <span>
501
- <a href="cli_main.js.html">cli/main.js</a>, <a href="cli_main.js.html#line56">line 56</a>
502
+ <a href="cli_main.js.html">cli/main.js</a>, <a href="cli_main.js.html#line41">line 41</a>
502
503
  </span>
503
504
  </p>
504
505
 
@@ -549,6 +550,132 @@ Author: SuiGn</div>
549
550
 
550
551
 
551
552
 
553
+ </div>
554
+
555
+ <div class="member">
556
+
557
+
558
+
559
+ <h4 class="name" id="~listMeProfiles">
560
+ <a class="href-link" href="#~listMeProfiles">#</a>
561
+
562
+
563
+ <span class='tag'>inner</span>
564
+
565
+
566
+ <span class="code-name">
567
+
568
+ listMeProfiles<span class="signature">()</span><span class="type-signature"> &rarr; {Array.&lt;string>}</span>
569
+
570
+ </span>
571
+ </h4>
572
+
573
+
574
+
575
+
576
+ <div class="description">
577
+ Lists all the .me profile file paths in the user's .me directory.
578
+ </div>
579
+
580
+
581
+
582
+
583
+
584
+
585
+
586
+
587
+
588
+
589
+
590
+
591
+
592
+
593
+ <dl class="details">
594
+
595
+
596
+
597
+
598
+
599
+
600
+
601
+
602
+
603
+
604
+
605
+
606
+
607
+
608
+
609
+
610
+
611
+
612
+
613
+
614
+
615
+
616
+
617
+
618
+
619
+
620
+
621
+
622
+
623
+
624
+
625
+ <p class="tag-source">
626
+ <a href="cli_main.js.html" class="button">View Source</a>
627
+ <span>
628
+ <a href="cli_main.js.html">cli/main.js</a>, <a href="cli_main.js.html#line135">line 135</a>
629
+ </span>
630
+ </p>
631
+
632
+ </dl>
633
+
634
+
635
+
636
+
637
+
638
+
639
+
640
+
641
+
642
+
643
+
644
+
645
+
646
+
647
+
648
+
649
+
650
+
651
+ <div class='columns method-parameter'>
652
+ <div class="column is-2"><label>Returns:</label></div>
653
+ <div class="column is-10">
654
+
655
+
656
+
657
+ <div class="columns">
658
+
659
+ <div class='param-desc column is-7'>An array of full file paths for each .me profile.</div>
660
+
661
+
662
+ <div class='column is-5 has-text-left'>
663
+ <label>Type: </label>
664
+
665
+ <code class="param-type">Array.&lt;string></code>
666
+
667
+
668
+ </div>
669
+
670
+ </div>
671
+
672
+
673
+ </div>
674
+ </div>
675
+
676
+
677
+
678
+
552
679
  </div>
553
680
 
554
681
  <div class="member">
@@ -627,7 +754,7 @@ Continuously prompts the user for actions until an exit command is given.
627
754
  <p class="tag-source">
628
755
  <a href="cli_main.js.html" class="button">View Source</a>
629
756
  <span>
630
- <a href="cli_main.js.html">cli/main.js</a>, <a href="cli_main.js.html#line142">line 142</a>
757
+ <a href="cli_main.js.html">cli/main.js</a>, <a href="cli_main.js.html#line176">line 176</a>
631
758
  </span>
632
759
  </p>
633
760
 
@@ -659,16 +786,18 @@ Continuously prompts the user for actions until an exit command is given.
659
786
 
660
787
 
661
788
 
662
- <h4 class="name" id="~welcomeToMe">
663
- <a class="href-link" href="#~welcomeToMe">#</a>
789
+ <h4 class="name" id="~selectProfile">
790
+ <a class="href-link" href="#~selectProfile">#</a>
664
791
 
665
792
 
793
+ <span class='tag'>async</span>
794
+
666
795
  <span class='tag'>inner</span>
667
796
 
668
797
 
669
798
  <span class="code-name">
670
799
 
671
- welcomeToMe<span class="signature">()</span><span class="type-signature"></span>
800
+ selectProfile<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;string>}</span>
672
801
 
673
802
  </span>
674
803
  </h4>
@@ -677,7 +806,7 @@ Continuously prompts the user for actions until an exit command is given.
677
806
 
678
807
 
679
808
  <div class="description">
680
- Display a welcome message to the user.
809
+ Prompts the user to select a .me profile or go back to the main menu.
681
810
  </div>
682
811
 
683
812
 
@@ -728,7 +857,7 @@ Continuously prompts the user for actions until an exit command is given.
728
857
  <p class="tag-source">
729
858
  <a href="cli_main.js.html" class="button">View Source</a>
730
859
  <span>
731
- <a href="cli_main.js.html">cli/main.js</a>, <a href="cli_main.js.html#line31">line 31</a>
860
+ <a href="cli_main.js.html">cli/main.js</a>, <a href="cli_main.js.html#line151">line 151</a>
732
861
  </span>
733
862
  </p>
734
863
 
@@ -751,6 +880,31 @@ Continuously prompts the user for actions until an exit command is given.
751
880
 
752
881
 
753
882
 
883
+ <div class='columns method-parameter'>
884
+ <div class="column is-2"><label>Returns:</label></div>
885
+ <div class="column is-10">
886
+
887
+
888
+
889
+ <div class="columns">
890
+
891
+ <div class='param-desc column is-7'>The file path of the selected profile or 'back' to go to the main menu.</div>
892
+
893
+
894
+ <div class='column is-5 has-text-left'>
895
+ <label>Type: </label>
896
+
897
+ <code class="param-type">Promise.&lt;string></code>
898
+
899
+
900
+ </div>
901
+
902
+ </div>
903
+
904
+
905
+ </div>
906
+ </div>
907
+
754
908
 
755
909
 
756
910
 
@@ -769,7 +923,7 @@ Continuously prompts the user for actions until an exit command is given.
769
923
 
770
924
  <span class="code-name">
771
925
 
772
- writeMeObjectToFile<span class="signature">(meObject)</span><span class="type-signature"></span>
926
+ writeMeObjectToFile<span class="signature">(meProfile)</span><span class="type-signature"></span>
773
927
 
774
928
  </span>
775
929
  </h4>
@@ -816,7 +970,7 @@ Continuously prompts the user for actions until an exit command is given.
816
970
 
817
971
  <tr class="deep-level-0">
818
972
 
819
- <td class="name"><code>meObject</code></td>
973
+ <td class="name"><code>meProfile</code></td>
820
974
 
821
975
 
822
976
  <td class="type">
@@ -880,7 +1034,7 @@ Continuously prompts the user for actions until an exit command is given.
880
1034
  <p class="tag-source">
881
1035
  <a href="cli_main.js.html" class="button">View Source</a>
882
1036
  <span>
883
- <a href="cli_main.js.html">cli/main.js</a>, <a href="cli_main.js.html#line119">line 119</a>
1037
+ <a href="cli_main.js.html">cli/main.js</a>, <a href="cli_main.js.html#line112">line 112</a>
884
1038
  </span>
885
1039
  </p>
886
1040
 
package/jsdoc.json CHANGED
@@ -12,32 +12,30 @@
12
12
  "monospaceLinks": false,
13
13
  "search": true,
14
14
  "default": {
15
- "staticFiles": {
16
- "include": [
17
- "./README.md"
18
- ]
19
- }
15
+ "staticFiles": {
16
+ "include": ["./README.md"]
17
+ }
20
18
  },
21
19
  "better-docs": {
22
- "name": "This.Me",
23
- "title": "This.Me",
24
- "css": "style.css",
25
- "trackingCode": "...",
26
- "hideGenerator": false,
27
- "navLinks": [
28
- {
29
- "label": "all.This @Packages ",
30
- "href": "https://suign.github.io/all.this/"
20
+ "name": "This.Me",
21
+ "title": "This.Me",
22
+ "css": "style.css",
23
+ "trackingCode": "...",
24
+ "hideGenerator": false,
25
+ "navLinks": [
26
+ {
27
+ "label": "all.This @Packages",
28
+ "href": "https://suign.github.io/all.this/"
29
+ },
30
+ {
31
+ "label": "Github",
32
+ "href": "https://github.com/suiGn/neurons.me"
31
33
  },
32
- {
33
- "label": "Github",
34
- "href": "https://github.com/suiGn/neurons.me"
35
- },
36
- {
37
- "label": "App",
38
- "href": "https://neurons.me"
39
- }
40
- ]
34
+ {
35
+ "label": "App",
36
+ "href": "https://neurons.me"
37
+ }
38
+ ]
41
39
  }
40
+ }
42
41
  }
43
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "this.me",
3
- "version": "2.8.0",
3
+ "version": "2.8.1",
4
4
  "description": "User-Centric OS.",
5
5
  "bin": {
6
6
  ".me": "./src/cli/main.js"
@@ -30,6 +30,7 @@
30
30
  "repoType": "NPM Package",
31
31
  "dependencies": {
32
32
  "commander": "^11.1.0",
33
- "inquirer": "^9.2.12"
33
+ "inquirer": "^9.2.12",
34
+ "taffydb": "^2.7.3"
34
35
  }
35
36
  }
@@ -0,0 +1,21 @@
1
+ // Contents of ./ascii_art/welcome
2
+ function printWelcome() {
3
+ console.log(`
4
+ ___________
5
+ [------------]
6
+ | .--------. |
7
+ | |01010101| | __________
8
+ | |11010101| | /__________ /
9
+ [--------| -------- |------| --*-- |-------]
10
+ | [----_-.-----] |o ====== | |
11
+ | ______|_|_______ |__________| |
12
+ | / %%%%%%%%%%%% |
13
+ | / %%%%%%%%%%%%%% |
14
+ | ^^^^^^^^^^^^^^^^^^^^ |
15
+ [---------------------------------.me-----------]
16
+ -^^^^^^^^...
17
+ Welcome to .me.
18
+ `);
19
+ }
20
+
21
+ export default printWelcome;
package/src/cli/main.js CHANGED
@@ -1,10 +1,4 @@
1
1
  #!/usr/bin/env node
2
- /**
3
- * @module CLI
4
- * @description Command Line Interface Functionalities for .me
5
- * Author: SuiGn
6
- */
7
-
8
2
  import os from 'os';
9
3
  import Me from '../me.js';
10
4
  import { Command } from 'commander';
@@ -12,11 +6,22 @@ const program = new Command();
12
6
  import inquirer from 'inquirer';
13
7
  import fs from 'fs';
14
8
  import path from 'path';
9
+ import printWelcome from './ascii_art/welcome.js';
15
10
  import crypto from 'crypto';
11
+ /**
12
+ * @module CLI
13
+ * @description
14
+ * .Me Command Line Interface Functionalities.
15
+ * The CLI application's code structure is categorized into two main parts:
16
+ * Command Definitions and Interactive Shell.*/
16
17
 
18
+ /***Command Definitions.*/
19
+ /**
20
+ * The 'program' variable is an instance of 'Command' from the commander package.
21
+ * It's utilized to define commands and options for the CLI application.*/
17
22
  program
18
23
  .command('user <username> <pin>')
19
- .description('Authenticate and start a session for a given user')
24
+ .description('Authenticate and start a .me session.')
20
25
  .action((username, pin) => {
21
26
  console.log(`Attempting to authenticate user: ${username}`);
22
27
  // Authentication logic here
@@ -25,28 +30,11 @@ program
25
30
  program
26
31
  .option('-o, --options', 'View options and commands');
27
32
 
28
- /**
29
- * Display a welcome message to the user.
30
- */
33
+ /***Welcome message.*/
31
34
  function welcomeToMe() {
32
- console.log(`
33
- ___________
34
- [------------]
35
- | .--------. |
36
- | |01010101| | __________
37
- | |11010101| | /__________\
38
- [--------| -------- |------| --*-- |-------]
39
- | [----_-.-----] |o ====== | |
40
- | ______|_|_______ |__________| |
41
- | / %%%%%%%%%%%% \ |
42
- | / %%%%%%%%%%%%%% \ |
43
- | ^^^^^^^^^^^^^^^^^^^^ |
44
- [---------------------------------.me-----------]
45
- -^^^^^^^^...
46
- Welcome to .me.
47
- `);
35
+ printWelcome();
48
36
  console.log(`Host_Session@ ${os.userInfo().username}`);
49
- console.log(`v.path@ ${os.homedir()}/this.me`);
37
+ console.log(`v.path@ ${os.homedir()}/.me`);
50
38
  }
51
39
 
52
40
  /**
@@ -83,10 +71,18 @@ async function getNewProfileDetails() {
83
71
  // Add validation as needed
84
72
  },
85
73
  {
86
- type: 'input',
87
- name: 'birthday',
88
- message: 'What is your birthday? (YYYY-MM-DD)',
89
- // Add validation as needed
74
+ type: 'input',
75
+ name: 'birthday',
76
+ message: 'What is your birthday? (YYYY-MM-DD)',
77
+ validate: function(value) {
78
+ const pass = value.match(
79
+ /^\d{4}-\d{2}-\d{2}$/
80
+ );
81
+ if (pass) {
82
+ return true;
83
+ }
84
+ return 'Please enter a valid date (YYYY-MM-DD)';
85
+ }
90
86
  },
91
87
  {
92
88
  type: 'password',
package/src/me.js CHANGED
@@ -3,7 +3,7 @@
3
3
  */
4
4
  class Me {
5
5
  /**
6
- * Create a ThisMe instance.
6
+ * Create a me instance.
7
7
  * @param {string} name - The first name of the user.
8
8
  * @param {string} lastname - The last name of the user.
9
9
  * @param {string} birthday - The birthday of the user in YYYY-MM-DD format.