keyra-cli 0.1.0 → 0.1.2
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/cli/dist/index.js +1147 -0
- package/cli/package-lock.json +7 -3
- package/cli/package.json +8 -4
- package/package.json +1 -1
- package/cli/src/commands/guard.ts +0 -89
- package/cli/src/commands/init.ts +0 -172
- package/cli/src/commands/list.ts +0 -60
- package/cli/src/commands/login.ts +0 -116
- package/cli/src/commands/logout.ts +0 -10
- package/cli/src/commands/pull.ts +0 -94
- package/cli/src/commands/push.ts +0 -118
- package/cli/src/commands/scan.ts +0 -145
- package/cli/src/commands/share.ts +0 -84
- package/cli/src/commands/status.ts +0 -91
- package/cli/src/commands/validate.ts +0 -101
- package/cli/src/index.ts +0 -38
- package/cli/src/lib/api.ts +0 -136
- package/cli/src/lib/config.ts +0 -94
- package/cli/src/lib/encryption.ts +0 -45
- package/cli/src/lib/env-file.ts +0 -67
- package/cli/src/lib/ui.ts +0 -87
- package/cli/src/types.ts +0 -56
- package/cli/tsconfig.json +0 -14
package/cli/src/lib/api.ts
DELETED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import { loadConfig } from './config.js';
|
|
2
|
-
import type { Project, VaultEntry, EncryptedEntry, ShareData } from '../types.js';
|
|
3
|
-
|
|
4
|
-
function getBaseUrl(): string {
|
|
5
|
-
const config = loadConfig();
|
|
6
|
-
return config.apiUrl || 'http://localhost:3000';
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
function getHeaders(): Record<string, string> {
|
|
10
|
-
const config = loadConfig();
|
|
11
|
-
const headers: Record<string, string> = {
|
|
12
|
-
'Content-Type': 'application/json',
|
|
13
|
-
};
|
|
14
|
-
if (config.accessToken) {
|
|
15
|
-
headers['Authorization'] = `Bearer ${config.accessToken}`;
|
|
16
|
-
}
|
|
17
|
-
return headers;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
async function handleResponse(res: Response): Promise<any> {
|
|
21
|
-
if (res.status === 401) {
|
|
22
|
-
throw new Error('Session expired. Run `keyra login` to re-authenticate.');
|
|
23
|
-
}
|
|
24
|
-
if (res.status === 403) {
|
|
25
|
-
const data = await res.json().catch(() => ({}));
|
|
26
|
-
const msg: string = data.error || '';
|
|
27
|
-
if (msg.toLowerCase().includes('project')) {
|
|
28
|
-
throw new Error(
|
|
29
|
-
'Project limit reached for your plan.\n Upgrade at keyra.dev/dashboard/settings for more projects.'
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
if (msg.toLowerCase().includes('variable') || msg.toLowerCase().includes('vars')) {
|
|
33
|
-
throw new Error(
|
|
34
|
-
'Variable limit reached for this project.\n Upgrade at keyra.dev/dashboard/settings for more variables.'
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
if (msg.toLowerCase().includes('sharing') || msg.toLowerCase().includes('share')) {
|
|
38
|
-
throw new Error(
|
|
39
|
-
'Sharing requires a Pro plan.\n Upgrade at keyra.dev/dashboard/settings to enable sharing.'
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
if (data.upgrade) {
|
|
43
|
-
throw new Error(
|
|
44
|
-
`${msg || 'Plan limit reached.'}\n Upgrade at keyra.dev/dashboard/settings`
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
throw new Error(msg || 'Access denied.');
|
|
48
|
-
}
|
|
49
|
-
if (!res.ok) {
|
|
50
|
-
const data = await res.json().catch(() => ({}));
|
|
51
|
-
throw new Error(data.error || `Request failed with status ${res.status}`);
|
|
52
|
-
}
|
|
53
|
-
return res.json();
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export async function apiGet(path: string): Promise<any> {
|
|
57
|
-
const res = await fetch(`${getBaseUrl()}${path}`, {
|
|
58
|
-
method: 'GET',
|
|
59
|
-
headers: getHeaders(),
|
|
60
|
-
}).catch(() => {
|
|
61
|
-
throw new Error("Can't reach server. Check your connection.");
|
|
62
|
-
});
|
|
63
|
-
return handleResponse(res);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export async function apiPost(path: string, body: any): Promise<any> {
|
|
67
|
-
const res = await fetch(`${getBaseUrl()}${path}`, {
|
|
68
|
-
method: 'POST',
|
|
69
|
-
headers: getHeaders(),
|
|
70
|
-
body: JSON.stringify(body),
|
|
71
|
-
}).catch(() => {
|
|
72
|
-
throw new Error("Can't reach server. Check your connection.");
|
|
73
|
-
});
|
|
74
|
-
return handleResponse(res);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export async function apiPatch(path: string, body: any): Promise<any> {
|
|
78
|
-
const res = await fetch(`${getBaseUrl()}${path}`, {
|
|
79
|
-
method: 'PATCH',
|
|
80
|
-
headers: getHeaders(),
|
|
81
|
-
body: JSON.stringify(body),
|
|
82
|
-
}).catch(() => {
|
|
83
|
-
throw new Error("Can't reach server. Check your connection.");
|
|
84
|
-
});
|
|
85
|
-
return handleResponse(res);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export async function apiDelete(path: string): Promise<any> {
|
|
89
|
-
const res = await fetch(`${getBaseUrl()}${path}`, {
|
|
90
|
-
method: 'DELETE',
|
|
91
|
-
headers: getHeaders(),
|
|
92
|
-
}).catch(() => {
|
|
93
|
-
throw new Error("Can't reach server. Check your connection.");
|
|
94
|
-
});
|
|
95
|
-
return handleResponse(res);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// Specific endpoints
|
|
99
|
-
|
|
100
|
-
export async function createDeviceCode(): Promise<{ deviceCode: string }> {
|
|
101
|
-
return apiPost('/api/cli/auth', {});
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export async function pollAuth(
|
|
105
|
-
deviceCode: string
|
|
106
|
-
): Promise<{ status: string; accessToken?: string }> {
|
|
107
|
-
return apiGet(`/api/cli/auth?code=${deviceCode}`);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export async function getProjects(): Promise<Project[]> {
|
|
111
|
-
return apiGet('/api/projects');
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
export async function createProject(
|
|
115
|
-
name: string,
|
|
116
|
-
description?: string
|
|
117
|
-
): Promise<Project> {
|
|
118
|
-
return apiPost('/api/projects', { name, description });
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export async function getVaultEntries(projectId: string): Promise<VaultEntry[]> {
|
|
122
|
-
return apiGet(`/api/vault?project_id=${projectId}`);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export async function upsertVaultEntries(
|
|
126
|
-
projectId: string,
|
|
127
|
-
entries: EncryptedEntry[]
|
|
128
|
-
): Promise<void> {
|
|
129
|
-
await apiPost('/api/vault/sync', { projectId, entries });
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export async function createShareLink(
|
|
133
|
-
data: ShareData
|
|
134
|
-
): Promise<{ url: string; token: string }> {
|
|
135
|
-
return apiPost('/api/share', data);
|
|
136
|
-
}
|
package/cli/src/lib/config.ts
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import os from 'os';
|
|
4
|
-
import type { Config, ProjectConfig } from '../types.js';
|
|
5
|
-
|
|
6
|
-
const CONFIG_DIR = path.join(os.homedir(), '.keyra');
|
|
7
|
-
const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
|
|
8
|
-
const PROJECT_CONFIG_FILE = '.keyra.json';
|
|
9
|
-
|
|
10
|
-
function ensureConfigDir(): void {
|
|
11
|
-
if (!fs.existsSync(CONFIG_DIR)) {
|
|
12
|
-
fs.mkdirSync(CONFIG_DIR, { recursive: true });
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export function loadConfig(): Partial<Config> {
|
|
17
|
-
ensureConfigDir();
|
|
18
|
-
if (!fs.existsSync(CONFIG_FILE)) return {};
|
|
19
|
-
try {
|
|
20
|
-
return JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf-8'));
|
|
21
|
-
} catch {
|
|
22
|
-
return {};
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export function saveConfig(partial: Partial<Config>): void {
|
|
27
|
-
ensureConfigDir();
|
|
28
|
-
const existing = loadConfig();
|
|
29
|
-
const merged = { ...existing, ...partial };
|
|
30
|
-
fs.writeFileSync(CONFIG_FILE, JSON.stringify(merged, null, 2));
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export function clearConfig(): void {
|
|
34
|
-
ensureConfigDir();
|
|
35
|
-
if (fs.existsSync(CONFIG_FILE)) {
|
|
36
|
-
fs.unlinkSync(CONFIG_FILE);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export function isLoggedIn(): boolean {
|
|
41
|
-
const config = loadConfig();
|
|
42
|
-
return !!(config.accessToken && config.passphrase);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export function requireAuth(): Config {
|
|
46
|
-
const config = loadConfig();
|
|
47
|
-
if (!config.accessToken || !config.passphrase) {
|
|
48
|
-
throw new Error('Not logged in. Run `keyra login` first.');
|
|
49
|
-
}
|
|
50
|
-
return {
|
|
51
|
-
apiUrl: config.apiUrl || 'http://localhost:3000',
|
|
52
|
-
accessToken: config.accessToken,
|
|
53
|
-
passphrase: config.passphrase,
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export function loadProjectConfig(): ProjectConfig | null {
|
|
58
|
-
const filePath = path.join(process.cwd(), PROJECT_CONFIG_FILE);
|
|
59
|
-
if (!fs.existsSync(filePath)) return null;
|
|
60
|
-
try {
|
|
61
|
-
return JSON.parse(fs.readFileSync(filePath, 'utf-8'));
|
|
62
|
-
} catch {
|
|
63
|
-
return null;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export function saveProjectConfig(data: ProjectConfig): void {
|
|
68
|
-
const filePath = path.join(process.cwd(), PROJECT_CONFIG_FILE);
|
|
69
|
-
fs.writeFileSync(filePath, JSON.stringify(data, null, 2));
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export function hasProjectConfig(): boolean {
|
|
73
|
-
return fs.existsSync(path.join(process.cwd(), PROJECT_CONFIG_FILE));
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export function requireProjectConfig(): ProjectConfig {
|
|
77
|
-
const config = loadProjectConfig();
|
|
78
|
-
if (!config) {
|
|
79
|
-
throw new Error('Not in a Keyra project. Run `keyra init` first.');
|
|
80
|
-
}
|
|
81
|
-
return config;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export function addToGitignore(entry: string): void {
|
|
85
|
-
const gitignorePath = path.join(process.cwd(), '.gitignore');
|
|
86
|
-
if (fs.existsSync(gitignorePath)) {
|
|
87
|
-
const content = fs.readFileSync(gitignorePath, 'utf-8');
|
|
88
|
-
if (!content.includes(entry)) {
|
|
89
|
-
fs.appendFileSync(gitignorePath, `\n${entry}\n`);
|
|
90
|
-
}
|
|
91
|
-
} else {
|
|
92
|
-
fs.writeFileSync(gitignorePath, `${entry}\n`);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import crypto from 'crypto';
|
|
2
|
-
|
|
3
|
-
export function encrypt(
|
|
4
|
-
text: string,
|
|
5
|
-
passphrase: string
|
|
6
|
-
): { encrypted: string; iv: string; salt: string; authTag: string } {
|
|
7
|
-
const salt = crypto.randomBytes(16);
|
|
8
|
-
const key = crypto.pbkdf2Sync(passphrase, salt, 100000, 32, 'sha256');
|
|
9
|
-
const iv = crypto.randomBytes(12);
|
|
10
|
-
const cipher = crypto.createCipheriv('aes-256-gcm', key, iv);
|
|
11
|
-
let encrypted = cipher.update(text, 'utf8', 'hex');
|
|
12
|
-
encrypted += cipher.final('hex');
|
|
13
|
-
const authTag = cipher.getAuthTag().toString('hex');
|
|
14
|
-
return {
|
|
15
|
-
encrypted,
|
|
16
|
-
iv: iv.toString('hex'),
|
|
17
|
-
salt: salt.toString('hex'),
|
|
18
|
-
authTag,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function decrypt(
|
|
23
|
-
encrypted: string,
|
|
24
|
-
iv: string,
|
|
25
|
-
salt: string,
|
|
26
|
-
authTag: string,
|
|
27
|
-
passphrase: string
|
|
28
|
-
): string {
|
|
29
|
-
const key = crypto.pbkdf2Sync(
|
|
30
|
-
passphrase,
|
|
31
|
-
Buffer.from(salt, 'hex'),
|
|
32
|
-
100000,
|
|
33
|
-
32,
|
|
34
|
-
'sha256'
|
|
35
|
-
);
|
|
36
|
-
const decipher = crypto.createDecipheriv(
|
|
37
|
-
'aes-256-gcm',
|
|
38
|
-
key,
|
|
39
|
-
Buffer.from(iv, 'hex')
|
|
40
|
-
);
|
|
41
|
-
decipher.setAuthTag(Buffer.from(authTag, 'hex'));
|
|
42
|
-
let decrypted = decipher.update(encrypted, 'hex', 'utf8');
|
|
43
|
-
decrypted += decipher.final('utf8');
|
|
44
|
-
return decrypted;
|
|
45
|
-
}
|
package/cli/src/lib/env-file.ts
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
|
|
4
|
-
export function parseEnvFile(content: string): Record<string, string> {
|
|
5
|
-
const vars: Record<string, string> = {};
|
|
6
|
-
const lines = content.split('\n');
|
|
7
|
-
|
|
8
|
-
for (const line of lines) {
|
|
9
|
-
const trimmed = line.trim();
|
|
10
|
-
// Skip empty lines and comments
|
|
11
|
-
if (!trimmed || trimmed.startsWith('#')) continue;
|
|
12
|
-
|
|
13
|
-
const eqIndex = trimmed.indexOf('=');
|
|
14
|
-
if (eqIndex === -1) continue;
|
|
15
|
-
|
|
16
|
-
const key = trimmed.substring(0, eqIndex).trim();
|
|
17
|
-
let value = trimmed.substring(eqIndex + 1).trim();
|
|
18
|
-
|
|
19
|
-
// Remove surrounding quotes
|
|
20
|
-
if (
|
|
21
|
-
(value.startsWith('"') && value.endsWith('"')) ||
|
|
22
|
-
(value.startsWith("'") && value.endsWith("'"))
|
|
23
|
-
) {
|
|
24
|
-
value = value.slice(1, -1);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (key) {
|
|
28
|
-
vars[key] = value;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return vars;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export function toEnvFileString(vars: Record<string, string>): string {
|
|
36
|
-
const keys = Object.keys(vars).sort();
|
|
37
|
-
return keys.map((key) => `${key}=${vars[key]}`).join('\n') + '\n';
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const ENV_FILES = ['.env', '.env.local', '.env.development'];
|
|
41
|
-
|
|
42
|
-
export function readEnvFile(dir?: string): {
|
|
43
|
-
vars: Record<string, string>;
|
|
44
|
-
filename: string;
|
|
45
|
-
} | null {
|
|
46
|
-
const baseDir = dir || process.cwd();
|
|
47
|
-
|
|
48
|
-
for (const filename of ENV_FILES) {
|
|
49
|
-
const filePath = path.join(baseDir, filename);
|
|
50
|
-
if (fs.existsSync(filePath)) {
|
|
51
|
-
const content = fs.readFileSync(filePath, 'utf-8');
|
|
52
|
-
return { vars: parseEnvFile(content), filename };
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return null;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export function writeEnvFile(
|
|
60
|
-
vars: Record<string, string>,
|
|
61
|
-
dir?: string,
|
|
62
|
-
filename = '.env'
|
|
63
|
-
): void {
|
|
64
|
-
const baseDir = dir || process.cwd();
|
|
65
|
-
const filePath = path.join(baseDir, filename);
|
|
66
|
-
fs.writeFileSync(filePath, toEnvFileString(vars));
|
|
67
|
-
}
|
package/cli/src/lib/ui.ts
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import readline from 'readline';
|
|
2
|
-
import chalk from 'chalk';
|
|
3
|
-
import ora from 'ora';
|
|
4
|
-
import boxen from 'boxen';
|
|
5
|
-
|
|
6
|
-
export const spinner = (text: string) => ora({ text, color: 'green' });
|
|
7
|
-
|
|
8
|
-
export const success = (text: string) =>
|
|
9
|
-
console.log(chalk.green('✓'), text);
|
|
10
|
-
|
|
11
|
-
export const error = (text: string) =>
|
|
12
|
-
console.log(chalk.red('✗'), text);
|
|
13
|
-
|
|
14
|
-
export const warning = (text: string) =>
|
|
15
|
-
console.log(chalk.yellow('⚠'), text);
|
|
16
|
-
|
|
17
|
-
export const info = (text: string) =>
|
|
18
|
-
console.log(chalk.blue('ℹ'), text);
|
|
19
|
-
|
|
20
|
-
export function banner() {
|
|
21
|
-
console.log(
|
|
22
|
-
boxen(
|
|
23
|
-
chalk.green.bold('Keyra') +
|
|
24
|
-
chalk.dim(' v0.1.0') +
|
|
25
|
-
'\n' +
|
|
26
|
-
chalk.dim('Encrypted .env vault'),
|
|
27
|
-
{
|
|
28
|
-
padding: 1,
|
|
29
|
-
margin: 1,
|
|
30
|
-
borderStyle: 'round',
|
|
31
|
-
borderColor: 'green',
|
|
32
|
-
}
|
|
33
|
-
)
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export function printTable(
|
|
38
|
-
rows: { key: string; value: string; status?: string }[]
|
|
39
|
-
) {
|
|
40
|
-
const maxKeyLen = Math.max(...rows.map((r) => r.key.length), 3);
|
|
41
|
-
|
|
42
|
-
for (const row of rows) {
|
|
43
|
-
const dots = '.'.repeat(Math.max(1, maxKeyLen - row.key.length + 3));
|
|
44
|
-
const statusIcon =
|
|
45
|
-
row.status === 'present'
|
|
46
|
-
? chalk.green('✓')
|
|
47
|
-
: row.status === 'missing'
|
|
48
|
-
? chalk.red('✗')
|
|
49
|
-
: row.status === 'empty'
|
|
50
|
-
? chalk.red('✗')
|
|
51
|
-
: chalk.dim('·');
|
|
52
|
-
const statusText =
|
|
53
|
-
row.status === 'present'
|
|
54
|
-
? chalk.green(row.value)
|
|
55
|
-
: row.status === 'missing'
|
|
56
|
-
? chalk.red(row.value)
|
|
57
|
-
: row.status === 'empty'
|
|
58
|
-
? chalk.red(row.value)
|
|
59
|
-
: chalk.dim(row.value);
|
|
60
|
-
|
|
61
|
-
console.log(` ${statusIcon} ${chalk.bold(row.key)} ${chalk.dim(dots)} ${statusText}`);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export function printBox(content: string, color: 'green' | 'yellow' | 'red' = 'green') {
|
|
66
|
-
console.log(
|
|
67
|
-
boxen(content, {
|
|
68
|
-
padding: 1,
|
|
69
|
-
margin: { top: 1, bottom: 1, left: 0, right: 0 },
|
|
70
|
-
borderStyle: 'round',
|
|
71
|
-
borderColor: color,
|
|
72
|
-
})
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export function promptSecret(question: string): Promise<string> {
|
|
77
|
-
return new Promise((resolve) => {
|
|
78
|
-
const rl = readline.createInterface({
|
|
79
|
-
input: process.stdin,
|
|
80
|
-
output: process.stdout,
|
|
81
|
-
});
|
|
82
|
-
rl.question(question, (answer) => {
|
|
83
|
-
rl.close();
|
|
84
|
-
resolve(answer);
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
}
|
package/cli/src/types.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
export interface Config {
|
|
2
|
-
apiUrl: string;
|
|
3
|
-
accessToken: string;
|
|
4
|
-
passphrase: string;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export interface ProjectConfig {
|
|
8
|
-
projectId: string;
|
|
9
|
-
projectName: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface Project {
|
|
13
|
-
id: string;
|
|
14
|
-
user_id: string;
|
|
15
|
-
name: string;
|
|
16
|
-
description: string | null;
|
|
17
|
-
var_count: number;
|
|
18
|
-
last_synced_at: string | null;
|
|
19
|
-
created_at: string;
|
|
20
|
-
updated_at: string;
|
|
21
|
-
has_project_password: boolean;
|
|
22
|
-
project_password_salt: string | null;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface VaultEntry {
|
|
26
|
-
id: string;
|
|
27
|
-
user_id: string;
|
|
28
|
-
project_id: string;
|
|
29
|
-
key_name: string;
|
|
30
|
-
encrypted_value: string;
|
|
31
|
-
iv: string;
|
|
32
|
-
salt: string;
|
|
33
|
-
auth_tag: string;
|
|
34
|
-
category: string;
|
|
35
|
-
created_at: string;
|
|
36
|
-
updated_at: string;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface EncryptedEntry {
|
|
40
|
-
key_name: string;
|
|
41
|
-
encrypted_value: string;
|
|
42
|
-
iv: string;
|
|
43
|
-
salt: string;
|
|
44
|
-
auth_tag: string;
|
|
45
|
-
category: string;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export interface ShareData {
|
|
49
|
-
project_id: string;
|
|
50
|
-
encrypted_data: string;
|
|
51
|
-
iv: string;
|
|
52
|
-
salt: string;
|
|
53
|
-
auth_tag: string;
|
|
54
|
-
expires_at?: string;
|
|
55
|
-
max_views?: number;
|
|
56
|
-
}
|
package/cli/tsconfig.json
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"moduleResolution": "bundler",
|
|
6
|
-
"strict": true,
|
|
7
|
-
"esModuleInterop": true,
|
|
8
|
-
"outDir": "dist",
|
|
9
|
-
"rootDir": "src",
|
|
10
|
-
"declaration": true,
|
|
11
|
-
"skipLibCheck": true
|
|
12
|
-
},
|
|
13
|
-
"include": ["src/**/*"]
|
|
14
|
-
}
|