this.me 2.8.73 → 2.9.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/README.md CHANGED
@@ -1,35 +1,22 @@
1
-
2
-
3
1
  <img src="https://suign.github.io/assets/imgs/cleak_me-removebg.png" alt="DID Me Art" width="244">
4
-
5
2
  <img src="https://suign.github.io/assets/imgs/Cleaker-removebg-preview.png" alt="Cleak Me Please" width="244">
6
-
7
- # THIS.ME
8
-
9
- **This.Me** is a digital identity representation of **.Me** as it encapsulates **the essence of an entity**.
10
-
11
- Services become **user-centric,** based on cryptographic proofs rather than centralized authorities.
3
+ # THIS.ME
12
4
 
13
5
  -----------
14
6
 
15
7
  ### [Project Status : Experimental and Under Development, Subject to Major Changes]
16
-
17
8
  The module is in active development, and as such, it is subject to significant changes as we refine our approach and methodologies to best support our goals.
18
-
19
9
  visit: https://neurons.me to learn more.
20
10
 
21
11
  ----------
22
12
 
23
- # Getting Started
24
-
25
- **This.Me** is a class focused on **encapsulating user identity,** specifically crafted to facilitate the creation of instances ready for **hashing and cryptographic signature** generation. It opens the door to coding and decoding through **".me"** signatures, offering a modular framework that prioritizes privacy and integrity in application-wide identity management.
26
-
27
-
28
-
29
- **This.Me** is also part of the **all.this Data Structures** which means aligns well with the entire **neurons.me ecosystem.**
30
-
31
-
13
+ # Introduction
14
+ **This.Me** is a class focused on encapsulating user identity, specifically crafted to facilitate the creation of instances ready for hashing and cryptographic signature generation. It opens the door to coding and decoding through "me" signatures, offering a modular framework that prioritizes privacy and integrity in application-wide identity management.
32
15
 
16
+ Hello, I am .lisa
17
+ ? Who are you? (Use arrow keys)
18
+ ❯ add.me
19
+ ---
33
20
  1. **Install `this.me`:**
34
21
  Open your terminal and run the following command to install the `this.me` package:
35
22
 
@@ -44,60 +31,27 @@ visit: https://neurons.me to learn more.
44
31
  import Me from 'this.me';
45
32
  ```
46
33
 
34
+ 3. **Create an Instance of `Me`:**
35
+ Instantiate the `Me` class with the required user details.
47
36
 
37
+ ```js
38
+ const user = new Me('John', 'Doe', '1990-01-01', 'password123', '1234');
39
+ ```
48
40
 
49
- This quick start guide provides a straightforward path to incorporating `this.me` into your project, enabling you to manage user identities and prepare them for secure cryptographic processes efficiently.
50
-
51
- -----
52
-
53
- ## Conceptual Grounds.
54
-
55
- `.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.
56
-
57
- ### Local and Network Identity Management
58
-
59
- 1. #### Local Identity
60
-
61
- - When a `.me` object is created, it's initially configured with access to local host resources.
62
- - Users can manage their local profile, which includes their personal settings, preferences, and local data access permissions.
63
-
64
- 2. #### Network Identity
65
-
66
- - 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.
67
- - Once authenticated, the `.me` object's hash is recognized across the network, granting the user access to network resources according to their permissions.
68
-
69
- 3. #### Access Control
70
-
71
- - Both local and network resources use access control lists (ACLs) that are tied to the `.me` object's hash.
72
- - These ACLs determine what resources the `.me` object can access and the level of interaction permitted (read, write, execute).
73
-
74
- 4. #### Data Fetching
75
-
76
- - When fetching data, the system checks if the `.me` object is authenticated within the network.
77
- - If authenticated, the `.me` object can retrieve data from across the network based on the established ACLs.
78
- - If not authenticated, the `.me` object is limited to retrieving data from the local host.
79
-
80
- 5. #### CLI Functionality
81
-
82
- - The CLI tool facilitates the creation of `.me` objects, management of profiles, and authentication processes.
83
- - It could include commands to "login" to the network, "logout", or "sync" local profiles with network profiles.
84
-
85
- 6. #### Data Sharing and Security
86
-
87
- - Data sharing across the network should be secure, with encryption mechanisms in place to protect data in transit and at rest.
88
- - 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.
89
-
90
- ### Example CLI Commands
91
-
92
-
41
+ 4. **Validate and Use the Instance:**
42
+ Utilize the instance for user data validation and preparation for cryptographic actions.
93
43
 
94
- - `me init`: Initializes a new `.me` object on the local host.
95
- - `me login`: Authenticates the `.me` object against the network to access network resources.
96
- - `me logout`: De-authenticates the `.me` object from the network, reverting to local-only access.
97
- - `me sync`: Synchronizes local `.me` object data with the network profile.
98
- - `me fetch`: Retrieves data from the local host or network based on authentication status.
44
+ ```js
45
+ try {
46
+ const identity = user.getMe();
47
+ // Ready for hashing and cryptographic signatures
48
+ } catch (error) {
49
+ console.error(error.message);
50
+ // Error handling for missing fields
51
+ }
52
+ ```
99
53
 
100
- 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.
54
+ This quick start guide provides a straightforward path to incorporating `this.me` into your project, enabling you to manage user identities and prepare them for secure cryptographic processes efficiently.
101
55
 
102
56
  ----------
103
57
 
@@ -133,12 +87,6 @@ visit: [Neurons.me Glossary](https://suign.github.io/neurons.me/Glossary)
133
87
 
134
88
  [By neurons.me](https://neurons.me)
135
89
 
136
-
137
-
138
- ----
139
-
140
-
141
-
142
90
  <img src="https://suign.github.io/neurons.me/neurons_logo.png" alt="neurons.me logo" width="123" height="123" style="width123px; height:123px;">
143
91
 
144
92
 
package/index.js CHANGED
@@ -1,8 +1,4 @@
1
- /*
2
- this.me/index.js
3
- ⓝⓔⓤⓡⓞⓝⓢ.ⓜⓔ
4
- 🆂🆄🅸🅶🅽
5
- */
1
+ //index.js
6
2
  /**
7
3
  * @module This.Me
8
4
  * @description
@@ -13,9 +9,11 @@ this.me/index.js
13
9
  * Command Definitions and Interactive Shell.*/
14
10
 
15
11
  // index.js in the `this.me` package
16
- // index.js for this.me module
17
- import Me from './src/this.me.js';
18
- export default Me;
19
- console.log('this.me loaded');
20
-
12
+ import Me from './src/me.js';
13
+ let ia = new Me('.Lisa');
14
+ let me = ia.getMe();
21
15
 
16
+ console.log('.me:', me);
17
+ console.log('Hello, I am', me);
18
+ console.log('Who are you?', Me);
19
+ export default Me;
package/package.json CHANGED
@@ -1,18 +1,19 @@
1
1
  {
2
2
  "name": "this.me",
3
- "version": "2.8.73",
4
- "description": "User-Centric.",
3
+ "version": "2.9.0",
4
+ "description": "_me-Centric.",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "start": "node index.js",
8
8
  "test": "test"
9
9
  },
10
+ "bin": {
11
+ ".me": "src/.me.cli.js"
12
+ },
10
13
  "keywords": [
11
14
  "this.me",
12
15
  "user"
13
16
  ],
14
- "devDependencies": {
15
- },
16
17
  "repository": {
17
18
  "type": "git",
18
19
  "url": "git+https://github.com/suiGn/this.me.git"
@@ -25,6 +26,7 @@
25
26
  "repoType": "NPM Package",
26
27
  "category": "dataformatter",
27
28
  "dependencies": {
28
-
29
+ "chalk": "^5.3.0",
30
+ "inquirer": "^9.2.16"
29
31
  }
30
32
  }
package/src/.me.cli.js ADDED
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { program } from 'commander';
4
+ import { meMainChoices } from './CLI/me_MainChoices.js';
5
+ import AddMe from './CLI/AddMe.js'; // Corrected import statement
6
+ import ConfirmIdentity from './CLI/ConfirmIdentity.js'; // Corrected import statement
7
+ program
8
+ .description('.Me Command Line Interface')
9
+ .version('1.0.0')
10
+ .action(meMainChoices);
11
+
12
+ program.command('add-me')
13
+ .description('Add a new .me username')
14
+ .action(AddMe);
15
+
16
+ program.command('confirm-identity')
17
+ .description('Confirm your .me identity')
18
+ .action(ConfirmIdentity);
19
+
20
+ program.parse(process.argv);
@@ -0,0 +1,35 @@
1
+ //CLI/AddMe.js
2
+ import inquirer from 'inquirer';
3
+ import chalk from 'chalk';
4
+ import fs from 'fs';
5
+ import path from 'path';
6
+
7
+ const getConfigPath = () => path.join(process.env.HOME, '.me_config');
8
+
9
+ const saveNewUser = (username) => {
10
+ const configPath = getConfigPath();
11
+ let users = [];
12
+ if (fs.existsSync(configPath)) {
13
+ users = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
14
+ }
15
+ users.push(username);
16
+ fs.writeFileSync(configPath, JSON.stringify(users));
17
+ };
18
+
19
+ const AddMe = async () => {
20
+ const response = await inquirer.prompt([
21
+ {
22
+ type: 'input',
23
+ name: 'newMe',
24
+ message: 'Enter your new .me username:',
25
+ // Validate input: adjust as per your validation rules
26
+ validate: (input) => !!input.trim() || 'Username cannot be empty!',
27
+ },
28
+ ]);
29
+
30
+ const newMe = response.newMe.trim();
31
+ saveNewUser(newMe);
32
+ console.log(chalk.green(`New .me username added: ${newMe}`));
33
+ };
34
+
35
+ export default AddMe;
@@ -0,0 +1,26 @@
1
+ // Source: CLI/ConfirmIdentity.js
2
+ import inquirer from 'inquirer';
3
+ import chalk from 'chalk';
4
+
5
+ const getExistingUsers = () => {
6
+ // Simulate fetching existing users: adjust to your actual logic
7
+ return ['user1', 'user2']; // Example user names
8
+ };
9
+
10
+ const ConfirmIdentity = async () => {
11
+ const existingUsers = getExistingUsers();
12
+
13
+ const response = await inquirer.prompt([
14
+ {
15
+ type: 'list',
16
+ name: 'selectedUser',
17
+ message: 'Confirm your identity:',
18
+ choices: existingUsers,
19
+ },
20
+ ]);
21
+
22
+ const selectedUser = response.selectedUser;
23
+ console.log(chalk.green(`Identity confirmed: ${selectedUser}`));
24
+ };
25
+
26
+ export default ConfirmIdentity;
@@ -0,0 +1,28 @@
1
+ // CLI/me_MainMenu.js
2
+ import inquirer from 'inquirer';
3
+ import chalk from 'chalk';
4
+ import AddMe from './AddMe.js'; // Corrected import statement
5
+ import ConfirmIdentity from './ConfirmIdentity.js'; // Corrected import statement
6
+
7
+ export async function meMainChoices() {
8
+ const answers = await inquirer.prompt([
9
+ {
10
+ type: 'list',
11
+ name: 'action',
12
+ message: 'Choose an action:',
13
+ choices: ['Add new .me username', 'Confirm existing .me identity', new inquirer.Separator(), 'Exit'],
14
+ },
15
+ ]);
16
+
17
+ switch (answers.action) {
18
+ case 'Add new .me username':
19
+ AddMe();
20
+ break;
21
+ case 'Confirm existing .me identity':
22
+ ConfirmIdentity();
23
+ break;
24
+ case 'Exit':
25
+ console.log(chalk.green('Exiting .Me CLI.'));
26
+ process.exit();
27
+ }
28
+ }
package/src/me.js ADDED
@@ -0,0 +1,13 @@
1
+ // define .me class usrme
2
+
3
+ // Define the .me class
4
+ class Me {
5
+ constructor(usrme) {
6
+ this.usrme = usrme;
7
+ }
8
+ getMe() {
9
+ return this.usrme;
10
+ }
11
+ }
12
+
13
+ export default Me;
@@ -1,40 +0,0 @@
1
- Key Points of This.Me:
2
- Digital Identity Representation:
3
-
4
- This.Me encapsulates the essence of an entity, providing a robust framework for managing digital identities.
5
- It allows for cryptographic proof-based interactions, moving away from centralized authority reliance.
6
- User-Centric Services:
7
-
8
- The design focuses on user-centricity, where services rely on cryptographic proofs, enhancing security and user control.
9
- Project Status:
10
-
11
- Being experimental and under active development, it's highlighted that significant changes may occur, showing transparency in its developmental stage.
12
- Integration and Usage:
13
-
14
- The quick start guide simplifies the integration process, encouraging users to start utilizing This.Me in their projects for identity management and cryptographic operations.
15
- Local and Network Identity:
16
-
17
- The dual identity system (local and network) provides a versatile approach to data access and user interaction, distinguishing between authenticated network interactions and local-only data access.
18
- CLI Functionality:
19
-
20
- Proposed CLI commands (me init, me login, etc.) offer straightforward interfaces for users to manage their .me objects, enhancing usability.
21
- Modular Data Structures:
22
-
23
- Being part of all.this data structures, This.Me aligns with a suite of modules, each specializing in different data aspects, ensuring integration and interoperability within the neurons.me ecosystem.
24
- Security and Privacy:
25
-
26
- Emphasizes security through unique cryptographic identities for each module instance and adheres to privacy-centric policies, reassuring users of their data integrity and privacy.
27
- Enhancements and Considerations:
28
- Interactivity Between Instances:
29
- While each Me instance represents an identity, considering how these instances interact and relate within each sphere (personal, family, friends, etc.) can further enrich the model. For instance, defining interaction protocols or shared spaces where instances influence or contribute to each other's state or data.
30
-
31
- Data Inheritance and Sharing:
32
- Exploring how instances might inherit or share data within a sphere (like family traits or common friend group memories) could add depth to the identity representations.
33
-
34
- Network Dynamics:
35
- Delving deeper into the network identity aspect, considering how a Me instance evolves or influences the network when transitioning from a local to a networked context, could provide insights into collective behaviors or network effects.
36
-
37
- External Interactions:
38
- Reflecting on how Me instances interact with external entities or services (beyond the user's direct network) could expand on the role of digital identity in broader ecosystems.
39
-
40
- By fleshing out these aspects, This.Me can offer a comprehensive and nuanced framework for digital identity, providing users with a versatile and secure way to manage their presence and interactions across various contexts and networks.
@@ -1,9 +0,0 @@
1
- // nodejs/meFormatter.node.js
2
- class MeFormatterNode {
3
- format() {
4
- // Node.js-specific formatting
5
- }
6
- }
7
-
8
- export default MeFormatterNode;
9
-
@@ -1,15 +0,0 @@
1
- // createMeFormatter.js
2
- import MeFormatterNode from './nodejs/meFormatter.node.js';
3
- import MeFormatterBrowser from './browser/meFormatter.browser.js';
4
-
5
- function isNode() {
6
- return typeof window === 'undefined';
7
- }
8
-
9
- export async function createMeFormatter() {
10
- if (isNode()) {
11
- return { formatter: new MeFormatterNode(), error: null };
12
- } else {
13
- return { formatter: new MeFormatterBrowser(), error: null };
14
- }
15
- }
@@ -1,9 +0,0 @@
1
- // browser/meFormatter.browser.js
2
- class MeFormatterBrowser {
3
- format() {
4
- // Browser-specific formatting
5
- }
6
- }
7
-
8
- export default MeFormatterBrowser;
9
-
package/src/this.me.js DELETED
@@ -1,58 +0,0 @@
1
- /*
2
- this.me.js
3
- ⓝⓔⓤⓡⓞⓝⓢ.ⓜⓔ
4
- 🆂🆄🅸🅶🅽
5
- */
6
- import { createMeFormatter } from './createMeFormatter.js';
7
- /**
8
- * Represents a '.me' entity with personal information and methods to process and manage it.
9
- * name: 'Alice',
10
- * dob: '1990-01-01',
11
- * city: 'Wonderland',
12
- * gender: 'Female',
13
- * textInfo: 'Loves adventures'
14
- */
15
- class Me {
16
- /**
17
- * Creates an instance of the Me class representing user identity.
18
- * @param {Object} meInfo - User's personal information.
19
- * @param {string} meInfo.name - The user's name.
20
- * @param {string} meInfo.dob - The user's date of birth.
21
- * @param {string} meInfo.city - The city associated with the user.
22
- * @param {string} meInfo.gender - The user's gender.
23
- * @param {string} meInfo.bio - A short biography or description of the user.
24
- * @param {string} meInfo.password - A password for the user's identity (should be handled securely).
25
- * @param {string} meInfo.pin - A PIN for additional security or quick access.
26
- */
27
- constructor(meInfo = {}) {
28
- this.name = meInfo.name || 'Unknown';
29
- this.dob = meInfo.dob || 'Unknown';
30
- this.city = meInfo.city || 'Unknown';
31
- this.gender = meInfo.gender || 'Unknown';
32
- this.bio = meInfo.bio || 'No bio provided';
33
- this.password = meInfo.password || ''; // Consider encryption/hashing for security
34
- this.pin = meInfo.pin || ''; // Consider encryption/hashing for security
35
- }
36
-
37
- /**
38
- * Updates the user's information in the .Me instance.
39
- * @param {Object} updateInfo - The information to update.
40
- */
41
- updateInfo(updateInfo) {
42
- this.name = updateInfo.name || this.name;
43
- this.dob = updateInfo.dob || this.dob;
44
- this.city = updateInfo.city || this.city;
45
- this.gender = updateInfo.gender || this.gender;
46
- this.bio = updateInfo.bio || this.bio;
47
- // Password and PIN updates should be handled carefully, potentially with additional security checks
48
- if (updateInfo.password) {
49
- this.password = updateInfo.password; // Consider implementing a method to securely update the password
50
- }
51
- if (updateInfo.pin) {
52
- this.pin = updateInfo.pin; // Consider implementing a method to securely update the PIN
53
- }
54
- }
55
- }
56
-
57
-
58
- export default Me;
@@ -1,21 +0,0 @@
1
- // Path: Lisa/monadLisa/workspaces/packages/dataformatters/this.me/src/this.me.promises.js
2
- // this.me.promises.js
3
- export const logMeSuccess = (result) => {
4
- console.log('Operation successful:', result);
5
- };
6
-
7
- export const logMeError = (error) => {
8
- console.error('Operation failed:', error);
9
- };
10
-
11
- export const handleMePromise = (promise, successHandler, errorHandler) => {
12
- promise.then(successHandler).catch(errorHandler);
13
- };
14
-
15
- export const BeMe = (promise, successHandler, errorHandler) => {
16
- promise.then(successHandler).catch(errorHandler);
17
- };
18
-
19
-
20
- // You can add more handlers as needed.
21
-