mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-22 11:45:59 +01:00
command structure. debugging
This commit is contained in:
parent
4a0fa7945a
commit
bb54e2a381
15
.editorconfig
Normal file
15
.editorconfig
Normal file
@ -0,0 +1,15 @@
|
||||
# EditorConfig is awesome: http://EditorConfig.org
|
||||
|
||||
# top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
# Unix-style newlines with a newline ending every file
|
||||
[*]
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
|
||||
# Set default charset
|
||||
[*.{js,ts,scss,html}]
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 4
|
19
.vscode/launch.json
vendored
Normal file
19
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "Launch Program",
|
||||
"protocol": "inspector",
|
||||
"cwd": "${workspaceRoot}",
|
||||
"program": "${workspaceFolder}/node_modules/ts-node/dist/bin.js",
|
||||
"args": [
|
||||
"${workspaceFolder}/src/main.ts",
|
||||
"login",
|
||||
"kyle@sdfdf.com",
|
||||
"mypassword"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
15
src/commands/login.command.ts
Normal file
15
src/commands/login.command.ts
Normal file
@ -0,0 +1,15 @@
|
||||
import * as program from 'commander';
|
||||
|
||||
import { AuthResult } from 'jslib/models/domain/authResult';
|
||||
|
||||
import { AuthService } from 'jslib/abstractions/auth.service';
|
||||
|
||||
export class LoginCommand {
|
||||
constructor(private authService: AuthService) {
|
||||
|
||||
}
|
||||
|
||||
run(email: string, password: string, cmd: program.Command) {
|
||||
|
||||
}
|
||||
}
|
15
src/main.ts
15
src/main.ts
@ -1,17 +1,20 @@
|
||||
import * as program from 'commander';
|
||||
|
||||
import { AuthService } from 'jslib/services/auth.service';
|
||||
|
||||
import { LoginCommand } from './commands/login.command';
|
||||
|
||||
program
|
||||
.version('1.0.0', '-v, --version');
|
||||
|
||||
program
|
||||
.command('login <email> <password>')
|
||||
.description('Log into a Bitwarden user account.')
|
||||
.option('-t, --two_factor <code>', '2FA code.')
|
||||
.action((email, password, cmd) => {
|
||||
console.log('Logging in...');
|
||||
console.log(email);
|
||||
console.log(password);
|
||||
console.log(cmd.two_factor);
|
||||
.option('-m, --method <method>', '2FA method.')
|
||||
.option('-c, --code <code>', '2FA code.')
|
||||
.action((email: string, password: string, cmd: program.Command) => {
|
||||
const command = new LoginCommand(null);
|
||||
command.run(email, password, cmd);
|
||||
});
|
||||
|
||||
program
|
||||
|
24
tsconfig.json
Normal file
24
tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"noImplicitAny": true,
|
||||
"allowJs": true,
|
||||
"sourceMap": true,
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"jslib/*": [
|
||||
"jslib/src/*"
|
||||
]
|
||||
}
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"jslib/node_modules",
|
||||
"dist",
|
||||
"jslib/dist",
|
||||
"jslib/spec",
|
||||
"jslib/src/electron",
|
||||
"jslib/src/angular/components/modal.component.ts",
|
||||
"jslib/src/angular/dummy.module.ts",
|
||||
"build"
|
||||
]
|
||||
}
|
53
tslint.json
Normal file
53
tslint.json
Normal file
@ -0,0 +1,53 @@
|
||||
{
|
||||
"extends": "tslint:recommended",
|
||||
"rules": {
|
||||
"align": [ true, "statements", "members" ],
|
||||
"ban-types": {
|
||||
"options": [
|
||||
[ "Object", "Avoid using the `Object` type. Did you mean `object`?" ],
|
||||
[ "Boolean", "Avoid using the `Boolean` type. Did you mean `boolean`?" ],
|
||||
[ "Number", "Avoid using the `Number` type. Did you mean `number`?" ],
|
||||
[ "String", "Avoid using the `String` type. Did you mean `string`?" ],
|
||||
[ "Symbol", "Avoid using the `Symbol` type. Did you mean `symbol`?" ]
|
||||
]
|
||||
},
|
||||
"member-access": [ true, "no-public" ],
|
||||
"member-ordering": [
|
||||
true,
|
||||
{
|
||||
"order": [
|
||||
"public-static-field",
|
||||
"public-static-method",
|
||||
"protected-static-field",
|
||||
"protected-static-method",
|
||||
"private-static-field",
|
||||
"private-static-method",
|
||||
"public-instance-field",
|
||||
"protected-instance-field",
|
||||
"private-instance-field",
|
||||
"public-constructor",
|
||||
"protected-constructor",
|
||||
"private-constructor",
|
||||
"public-instance-method",
|
||||
"protected-instance-method",
|
||||
"private-instance-method"
|
||||
]
|
||||
}
|
||||
],
|
||||
"no-empty": [ true, "allow-empty-catch" ],
|
||||
"object-literal-sort-keys": false,
|
||||
"object-literal-shorthand": [ true, "never" ],
|
||||
"prefer-for-of": false,
|
||||
"quotemark": [ true, "single" ],
|
||||
"whitespace": [
|
||||
true,
|
||||
"check-branch",
|
||||
"check-decl",
|
||||
"check-module",
|
||||
"check-operator",
|
||||
"check-preblock",
|
||||
"check-separator",
|
||||
"check-type"
|
||||
]
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user