@v1ct0rbr/minivault-web 0.1.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 +75 -0
- package/dist/api/MinivaultApi.d.ts +46 -0
- package/dist/components/BackupsTab.d.ts +1 -0
- package/dist/components/CreateBackupTab.d.ts +1 -0
- package/dist/components/CredentialsFields.d.ts +8 -0
- package/dist/components/ImportDumpTab.d.ts +1 -0
- package/dist/components/MinivaultApiProvider.d.ts +8 -0
- package/dist/components/MinivaultModule.d.ts +8 -0
- package/dist/components/RestoreModal.d.ts +7 -0
- package/dist/components/StatusBadge.d.ts +5 -0
- package/dist/components/StorageExplorerTab.d.ts +7 -0
- package/dist/hooks/useBackups.d.ts +31 -0
- package/dist/index.d.ts +15 -0
- package/dist/minivault-web.css +2 -0
- package/dist/minivault-web.js +1879 -0
- package/dist/types/minivault.d.ts +92 -0
- package/dist/utils/format.d.ts +6 -0
- package/package.json +73 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
export type BackupStatus = 'PENDING' | 'IN_PROGRESS' | 'COMPLETED' | 'FAILED' | 'RESTORING' | 'RESTORED' | 'RESTORE_FAILED';
|
|
2
|
+
export type DatabaseType = 'postgresql' | 'postgres' | 'mysql' | 'sqlserver' | 'mssql';
|
|
3
|
+
export type DumpFormat = 'custom' | 'plain' | 'tar';
|
|
4
|
+
export interface Backup {
|
|
5
|
+
id: number;
|
|
6
|
+
filename: string;
|
|
7
|
+
fileSize: number | null;
|
|
8
|
+
status: BackupStatus;
|
|
9
|
+
databaseType: string;
|
|
10
|
+
sha256: string | null;
|
|
11
|
+
retentionDays: number | null;
|
|
12
|
+
errorMessage: string | null;
|
|
13
|
+
createdAt: string | null;
|
|
14
|
+
completedAt: string | null;
|
|
15
|
+
}
|
|
16
|
+
export interface VerifyResult {
|
|
17
|
+
valid: boolean;
|
|
18
|
+
checksumOk: boolean;
|
|
19
|
+
dumpReadable: boolean;
|
|
20
|
+
message: string;
|
|
21
|
+
}
|
|
22
|
+
export interface PageResponse<T> {
|
|
23
|
+
content: T[];
|
|
24
|
+
page: number;
|
|
25
|
+
size: number;
|
|
26
|
+
totalElements: number;
|
|
27
|
+
totalPages: number;
|
|
28
|
+
first: boolean;
|
|
29
|
+
last: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface DatabaseCredentials {
|
|
32
|
+
host: string;
|
|
33
|
+
port: number;
|
|
34
|
+
databaseName: string;
|
|
35
|
+
username: string;
|
|
36
|
+
password: string;
|
|
37
|
+
databaseType: DatabaseType | string;
|
|
38
|
+
}
|
|
39
|
+
export interface OriginStorageConfig {
|
|
40
|
+
type?: 'S3' | 'LOCAL' | string;
|
|
41
|
+
endpoint?: string;
|
|
42
|
+
bucketName?: string;
|
|
43
|
+
accessKey?: string;
|
|
44
|
+
secretKey?: string;
|
|
45
|
+
region?: string;
|
|
46
|
+
localPath?: string;
|
|
47
|
+
pathStyleEnabled?: boolean;
|
|
48
|
+
}
|
|
49
|
+
export interface DumpOptions {
|
|
50
|
+
tables?: string[];
|
|
51
|
+
excludeColumnsPerTable?: Record<string, string[]>;
|
|
52
|
+
format?: DumpFormat;
|
|
53
|
+
includeData?: boolean;
|
|
54
|
+
includeDropTable?: boolean;
|
|
55
|
+
includeCreateTable?: boolean;
|
|
56
|
+
includeIndexes?: boolean;
|
|
57
|
+
includeConstraints?: boolean;
|
|
58
|
+
includeRelatedTables?: boolean;
|
|
59
|
+
}
|
|
60
|
+
export interface BackupRequest {
|
|
61
|
+
database: DatabaseCredentials;
|
|
62
|
+
originStorage?: OriginStorageConfig;
|
|
63
|
+
dumpOptions?: DumpOptions;
|
|
64
|
+
}
|
|
65
|
+
export interface RestoreRequest {
|
|
66
|
+
database: DatabaseCredentials;
|
|
67
|
+
originStorage?: OriginStorageConfig;
|
|
68
|
+
}
|
|
69
|
+
export interface ImportResult {
|
|
70
|
+
success: boolean;
|
|
71
|
+
message: string;
|
|
72
|
+
database: string;
|
|
73
|
+
log: string | null;
|
|
74
|
+
}
|
|
75
|
+
export interface ImportFromStorageRequest {
|
|
76
|
+
storageType: string;
|
|
77
|
+
storagePath: string;
|
|
78
|
+
database: DatabaseCredentials;
|
|
79
|
+
storageConfig?: OriginStorageConfig;
|
|
80
|
+
}
|
|
81
|
+
export interface StorageFileItem {
|
|
82
|
+
name: string;
|
|
83
|
+
path: string;
|
|
84
|
+
size: number;
|
|
85
|
+
lastModified: string | null;
|
|
86
|
+
directory: boolean;
|
|
87
|
+
}
|
|
88
|
+
export interface ApiErrorBody {
|
|
89
|
+
timestamp?: string;
|
|
90
|
+
status?: number;
|
|
91
|
+
error?: string;
|
|
92
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BackupStatus } from '../types/minivault';
|
|
2
|
+
export declare function formatFileSize(bytes: number | null | undefined): string;
|
|
3
|
+
export declare function formatDate(value: string | null | undefined): string;
|
|
4
|
+
export declare const STATUS_LABELS: Record<BackupStatus, string>;
|
|
5
|
+
export declare const STATUS_BADGE: Record<BackupStatus, string>;
|
|
6
|
+
export declare const DATABASE_TYPE_LABELS: Record<string, string>;
|
package/package.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@v1ct0rbr/minivault-web",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Módulo independente de gerenciamento de backups (minivault). Consumível como pacote npm em qualquer app React. Cliente do minivault REST API (acesso tipicamente via proxy autenticado).",
|
|
5
|
+
"author": "Victor Queiroga (https://www.linkedin.com/in/victor-queiroga)",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"publishConfig": {
|
|
9
|
+
"access": "public",
|
|
10
|
+
"registry": "https://registry.npmjs.org/"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"README.md"
|
|
15
|
+
],
|
|
16
|
+
"keywords": [
|
|
17
|
+
"backup",
|
|
18
|
+
"minivault",
|
|
19
|
+
"der",
|
|
20
|
+
"react",
|
|
21
|
+
"bootstrap",
|
|
22
|
+
"postgresql"
|
|
23
|
+
],
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "https://github.com/v1ct0rbr/minivault-web.git"
|
|
27
|
+
},
|
|
28
|
+
"main": "./dist/minivault-web.js",
|
|
29
|
+
"module": "./dist/minivault-web.js",
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"import": "./dist/minivault-web.js"
|
|
35
|
+
},
|
|
36
|
+
"./style.css": "./dist/minivault-web.css"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"dev": "vite --port 5176",
|
|
40
|
+
"build": "vite build && tsc --noEmit",
|
|
41
|
+
"build:lib": "vite build --config vite.lib.config.ts && tsc --noEmit",
|
|
42
|
+
"prepublishOnly": "npm run build:lib && npm test",
|
|
43
|
+
"prepack": "npm run build:lib",
|
|
44
|
+
"preview": "vite preview",
|
|
45
|
+
"test": "vitest run",
|
|
46
|
+
"test:watch": "vitest",
|
|
47
|
+
"typecheck": "tsc --noEmit",
|
|
48
|
+
"lint": "eslint ."
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"bootstrap": "^5.3.3",
|
|
52
|
+
"bootstrap-icons": "^1.11.3"
|
|
53
|
+
},
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"@tanstack/react-query": "^5.0.0",
|
|
56
|
+
"react": "^19.0.0",
|
|
57
|
+
"react-dom": "^19.0.0"
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@tanstack/react-query": "^5.66.5",
|
|
61
|
+
"@types/node": "^22.10.2",
|
|
62
|
+
"@types/react": "^19.2.0",
|
|
63
|
+
"@types/react-dom": "^19.2.0",
|
|
64
|
+
"@vitejs/plugin-react": "^5.0.4",
|
|
65
|
+
"postcss-prefix-selector": "^2.1.1",
|
|
66
|
+
"react": "^19.2.0",
|
|
67
|
+
"react-dom": "^19.2.0",
|
|
68
|
+
"typescript": "^5.7.2",
|
|
69
|
+
"vite": "^8.0.16",
|
|
70
|
+
"vite-plugin-dts": "^4.5.0",
|
|
71
|
+
"vitest": "^4.1.8"
|
|
72
|
+
}
|
|
73
|
+
}
|