this.me 2.8.72 → 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 +4 -9
- package/index.js +7 -1
- package/package.json +7 -5
- package/src/.me.cli.js +20 -0
- package/src/CLI/AddMe.js +35 -0
- package/src/CLI/ConfirmIdentity.js +26 -0
- package/src/CLI/me_MainChoices.js +28 -0
- package/src/me.js +13 -0
package/README.md
CHANGED
|
@@ -1,27 +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
3
|
# THIS.ME
|
|
8
4
|
|
|
9
5
|
-----------
|
|
10
6
|
|
|
11
7
|
### [Project Status : Experimental and Under Development, Subject to Major Changes]
|
|
12
|
-
|
|
13
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.
|
|
14
|
-
|
|
15
9
|
visit: https://neurons.me to learn more.
|
|
16
10
|
|
|
17
11
|
----------
|
|
18
12
|
|
|
19
13
|
# Introduction
|
|
20
|
-
|
|
21
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.
|
|
22
15
|
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
Hello, I am .lisa
|
|
17
|
+
? Who are you? (Use arrow keys)
|
|
18
|
+
❯ add.me
|
|
19
|
+
---
|
|
25
20
|
1. **Install `this.me`:**
|
|
26
21
|
Open your terminal and run the following command to install the `this.me` package:
|
|
27
22
|
|
package/index.js
CHANGED
|
@@ -9,5 +9,11 @@
|
|
|
9
9
|
* Command Definitions and Interactive Shell.*/
|
|
10
10
|
|
|
11
11
|
// index.js in the `this.me` package
|
|
12
|
-
|
|
12
|
+
import Me from './src/me.js';
|
|
13
|
+
let ia = new Me('.Lisa');
|
|
14
|
+
let me = ia.getMe();
|
|
13
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.
|
|
4
|
-
"description": "
|
|
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);
|
package/src/CLI/AddMe.js
ADDED
|
@@ -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
|
+
}
|