bitty-tui 0.0.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.
Files changed (36) hide show
  1. package/dist/app.d.ts +1 -0
  2. package/dist/app.js +10 -0
  3. package/dist/cli.d.ts +2 -0
  4. package/dist/cli.js +6 -0
  5. package/dist/clients/bw.d.ts +180 -0
  6. package/dist/clients/bw.js +621 -0
  7. package/dist/components/Button.d.ts +10 -0
  8. package/dist/components/Button.js +24 -0
  9. package/dist/components/ScrollView.d.ts +14 -0
  10. package/dist/components/ScrollView.js +35 -0
  11. package/dist/components/TextInput.d.ts +18 -0
  12. package/dist/components/TextInput.js +193 -0
  13. package/dist/dashboard/DashboardView.d.ts +5 -0
  14. package/dist/dashboard/DashboardView.js +132 -0
  15. package/dist/dashboard/components/CipherDetail.d.ts +8 -0
  16. package/dist/dashboard/components/CipherDetail.js +12 -0
  17. package/dist/dashboard/components/HelpBar.d.ts +3 -0
  18. package/dist/dashboard/components/HelpBar.js +5 -0
  19. package/dist/dashboard/components/MainInfoTab.d.ts +6 -0
  20. package/dist/dashboard/components/MainInfoTab.js +58 -0
  21. package/dist/dashboard/components/MoreInfoTab.d.ts +6 -0
  22. package/dist/dashboard/components/MoreInfoTab.js +18 -0
  23. package/dist/dashboard/components/VaultList.d.ts +7 -0
  24. package/dist/dashboard/components/VaultList.js +35 -0
  25. package/dist/hooks/bw.d.ts +16 -0
  26. package/dist/hooks/bw.js +106 -0
  27. package/dist/hooks/refresh-resize.d.ts +1 -0
  28. package/dist/hooks/refresh-resize.js +15 -0
  29. package/dist/hooks/status-message.d.ts +8 -0
  30. package/dist/hooks/status-message.js +30 -0
  31. package/dist/login/LoginView.d.ts +5 -0
  32. package/dist/login/LoginView.js +75 -0
  33. package/dist/theme/style.d.ts +3 -0
  34. package/dist/theme/style.js +3 -0
  35. package/package.json +36 -0
  36. package/readme.md +21 -0
package/dist/app.d.ts ADDED
@@ -0,0 +1 @@
1
+ export default function App(): import("react/jsx-runtime").JSX.Element;
package/dist/app.js ADDED
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { LoginView } from "./login/LoginView.js";
4
+ import { DashboardView } from "./dashboard/DashboardView.js";
5
+ import { useRefreshResize } from "./hooks/refresh-resize.js";
6
+ export default function App() {
7
+ const [view, setView] = useState("login");
8
+ const r = useRefreshResize();
9
+ return (_jsxs(_Fragment, { children: [view === "login" ? (_jsx(LoginView, { onLogin: () => setView("dashboard") })) : (_jsx(DashboardView, { onLogout: () => setView("login") })), r] }));
10
+ }
package/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/cli.js ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { render } from "ink";
4
+ import App from "./app.js";
5
+ import { StatusMessageProvider } from "./hooks/status-message.js";
6
+ render(_jsx(StatusMessageProvider, { children: _jsx(App, {}) }));
@@ -0,0 +1,180 @@
1
+ export declare enum CipherType {
2
+ Login = 1,
3
+ SecureNote = 2,
4
+ Card = 3,
5
+ Identity = 4,
6
+ SSHKey = 5
7
+ }
8
+ export declare enum KeyType {
9
+ AES_256 = "0",
10
+ AES_128_MAC = "1",
11
+ AES_256_MAC = "2",
12
+ RSA_SHA256 = "3",
13
+ RSA_SHA1 = "4",
14
+ RSA_SHA256_MAC = "5",
15
+ RSA_SHA1_MAC = "6"
16
+ }
17
+ export interface Cipher {
18
+ id: string;
19
+ type: CipherType;
20
+ key?: string | null;
21
+ folderId?: string | null;
22
+ organizationId: string | null;
23
+ collectionIds?: string[] | null;
24
+ deletedDate: string | null;
25
+ name: string;
26
+ notes: string;
27
+ favorite: boolean;
28
+ login?: {
29
+ response?: null;
30
+ uri?: string;
31
+ uris?: {
32
+ uri: string;
33
+ uriChecksum?: string | null;
34
+ }[];
35
+ username?: string;
36
+ password?: string;
37
+ };
38
+ identity?: {
39
+ address1: string | null;
40
+ address2: string | null;
41
+ address3: string | null;
42
+ city: string | null;
43
+ company: string | null;
44
+ country: string | null;
45
+ email: string | null;
46
+ firstName: string | null;
47
+ lastName: string | null;
48
+ licenseNumber: string | null;
49
+ middleName: string | null;
50
+ passportNumber: string | null;
51
+ phone: string | null;
52
+ postalCode: string | null;
53
+ ssn: string | null;
54
+ state: string | null;
55
+ title: string | null;
56
+ username: string | null;
57
+ };
58
+ sshKey?: {
59
+ keyFingerprint?: string | null;
60
+ privateKey?: string | null;
61
+ publicKey?: string | null;
62
+ };
63
+ fields?: {
64
+ name: string;
65
+ value: string;
66
+ type: number;
67
+ }[];
68
+ }
69
+ export type CipherDto = Omit<Cipher, "id" | "data">;
70
+ export interface SyncResponse {
71
+ ciphers: Cipher[];
72
+ profile?: {
73
+ organizations?: {
74
+ id: string;
75
+ name: string;
76
+ key: string;
77
+ }[];
78
+ };
79
+ }
80
+ export interface Key {
81
+ type?: KeyType | null;
82
+ iv?: Uint8Array | null;
83
+ key: Uint8Array;
84
+ mac: Uint8Array;
85
+ }
86
+ export interface ClientConfig {
87
+ baseUrl?: string;
88
+ apiUrl?: string;
89
+ identityUrl?: string;
90
+ }
91
+ export interface BwKeys {
92
+ masterKey?: Uint8Array;
93
+ masterPasswordHash?: string;
94
+ encryptionKey?: Key;
95
+ userKey?: Key;
96
+ privateKey?: Key;
97
+ }
98
+ export declare class Client {
99
+ apiUrl: string;
100
+ identityUrl: string;
101
+ keys: BwKeys;
102
+ orgKeys: Record<string, Key>;
103
+ token: string | null;
104
+ refreshToken: string | null;
105
+ tokenExpiration: number | null;
106
+ decryptedSyncCache: SyncResponse | null;
107
+ syncCache: SyncResponse | null;
108
+ constructor(uri?: ClientConfig);
109
+ private patchObject;
110
+ setUrls(uri: ClientConfig): void;
111
+ login(email: string, password: string): Promise<void>;
112
+ checkToken(): Promise<void>;
113
+ syncRefresh(): Promise<SyncResponse | null>;
114
+ getDecryptionKey(cipher: Partial<Cipher>): Key | undefined;
115
+ getDecryptedSync({ forceRefresh }?: {
116
+ forceRefresh?: boolean | undefined;
117
+ }): Promise<SyncResponse>;
118
+ getSecretByName(name: string, { decrypted }?: {
119
+ decrypted?: boolean | undefined;
120
+ }): Promise<(Cipher | undefined)[]>;
121
+ getSecretById(id: string, { decrypted }?: {
122
+ decrypted?: boolean | undefined;
123
+ }): Promise<Cipher | undefined>;
124
+ createSecret(obj: CipherDto): Promise<any>;
125
+ objectDiff(obj1: any, obj2: any): any;
126
+ updateSecret(id: string, patch: Partial<CipherDto>): Promise<any>;
127
+ encrypt(value: string | null, key?: any): string;
128
+ decrypt(value: string | null | undefined, key?: any): string | null | undefined;
129
+ encryptCipher(obj: Partial<CipherDto>, key?: any): {
130
+ key?: string | null | undefined;
131
+ type?: CipherType | undefined;
132
+ folderId?: string | null | undefined;
133
+ organizationId?: string | null | undefined;
134
+ collectionIds?: string[] | null | undefined;
135
+ deletedDate?: string | null | undefined;
136
+ name?: string | undefined;
137
+ notes?: string | undefined;
138
+ favorite?: boolean | undefined;
139
+ login?: {
140
+ response?: null;
141
+ uri?: string;
142
+ uris?: {
143
+ uri: string;
144
+ uriChecksum?: string | null;
145
+ }[];
146
+ username?: string;
147
+ password?: string;
148
+ } | undefined;
149
+ identity?: {
150
+ address1: string | null;
151
+ address2: string | null;
152
+ address3: string | null;
153
+ city: string | null;
154
+ company: string | null;
155
+ country: string | null;
156
+ email: string | null;
157
+ firstName: string | null;
158
+ lastName: string | null;
159
+ licenseNumber: string | null;
160
+ middleName: string | null;
161
+ passportNumber: string | null;
162
+ phone: string | null;
163
+ postalCode: string | null;
164
+ ssn: string | null;
165
+ state: string | null;
166
+ title: string | null;
167
+ username: string | null;
168
+ } | undefined;
169
+ sshKey?: {
170
+ keyFingerprint?: string | null;
171
+ privateKey?: string | null;
172
+ publicKey?: string | null;
173
+ } | undefined;
174
+ fields?: {
175
+ name: string;
176
+ value: string;
177
+ type: number;
178
+ }[] | undefined;
179
+ };
180
+ }