nowbackup 1.0.3
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 +392 -0
- package/dist/bin.cjs +36571 -0
- package/dist/bin.js +53 -0
- package/dist/chunk-57ZU5VQ4.js +2994 -0
- package/dist/chunk-6QIWSQ6Y.js +574 -0
- package/dist/chunk-APZ4HNNC.js +1428 -0
- package/dist/chunk-BBB75FHV.js +11988 -0
- package/dist/chunk-FLLLYAHH.js +13 -0
- package/dist/chunk-KKIIHNPF.js +440 -0
- package/dist/chunk-LZQGIK32.js +1388 -0
- package/dist/chunk-SSPSJLWK.js +140 -0
- package/dist/chunk-T7W5F6M2.js +47 -0
- package/dist/chunk-V5IHRGZ2.js +12 -0
- package/dist/chunk-YMVDJI7O.js +3578 -0
- package/dist/chunk-ZHQB65KV.js +4726 -0
- package/dist/dist-es-3KJE4GI3.js +377 -0
- package/dist/dist-es-C4NCVBOK.js +21 -0
- package/dist/dist-es-FJYDFRNF.js +493 -0
- package/dist/dist-es-GOKCIKU2.js +319 -0
- package/dist/dist-es-GYBVDBEN.js +70 -0
- package/dist/dist-es-NQIG67M4.js +164 -0
- package/dist/dist-es-TJCQA2TA.js +89 -0
- package/dist/event-streams-CYRJEQX4.js +41 -0
- package/dist/index.cjs +36537 -0
- package/dist/index.js +15 -0
- package/dist/loadSso-S6XBGQED.js +548 -0
- package/dist/signin-YKKM2Q24.js +643 -0
- package/dist/sso-oidc-YLLTNKNX.js +783 -0
- package/dist/sts-WXTYIV32.js +1387 -0
- package/package.json +64 -0
package/dist/bin.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
NowBackup
|
|
4
|
+
} from "./chunk-BBB75FHV.js";
|
|
5
|
+
import "./chunk-ZHQB65KV.js";
|
|
6
|
+
import "./chunk-LZQGIK32.js";
|
|
7
|
+
import "./chunk-T7W5F6M2.js";
|
|
8
|
+
import "./chunk-FLLLYAHH.js";
|
|
9
|
+
import "./chunk-57ZU5VQ4.js";
|
|
10
|
+
import "./chunk-KKIIHNPF.js";
|
|
11
|
+
import "./chunk-V5IHRGZ2.js";
|
|
12
|
+
import "./chunk-YMVDJI7O.js";
|
|
13
|
+
import "./chunk-APZ4HNNC.js";
|
|
14
|
+
|
|
15
|
+
// src/bin.ts
|
|
16
|
+
import { Command } from "commander";
|
|
17
|
+
var program = new Command();
|
|
18
|
+
program.name("nowbackup").description("Universal Database Auto Backup CLI - Enterprise Grade").version("1.0.0");
|
|
19
|
+
program.command("run").description("Run a one-time backup").option("-d, --database <type>", "Database type (postgres, mysql, mongodb, redis, sqlite, mssql, cassandra, neo4j)", "auto").option("-u, --url <url>", "Database connection URL (or use DATABASE_URL env)").option("-s, --storage <provider>", "Storage provider (local, s3)", "local").option("-p, --path <path>", "Local storage path", "./backups").option("-b, --bucket <bucket>", "S3 bucket name").option("-c, --compress", "Enable compression", true).option("-e, --encrypt <key>", "Enable encryption with provided key").action(async (options) => {
|
|
20
|
+
console.log("[NowBackup CLI] Initializing backup...");
|
|
21
|
+
try {
|
|
22
|
+
const config = {
|
|
23
|
+
database: options.database,
|
|
24
|
+
databaseUrl: options.url,
|
|
25
|
+
compression: options.compress,
|
|
26
|
+
encryption: options.encrypt ? {
|
|
27
|
+
enabled: true,
|
|
28
|
+
algorithm: "aes-256-gcm",
|
|
29
|
+
key: options.encrypt
|
|
30
|
+
} : void 0,
|
|
31
|
+
storage: {
|
|
32
|
+
provider: options.storage,
|
|
33
|
+
options: {
|
|
34
|
+
path: options.path,
|
|
35
|
+
bucket: options.bucket
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const backup = await NowBackup.init(config);
|
|
40
|
+
if (Array.isArray(backup)) {
|
|
41
|
+
for (const b of backup) {
|
|
42
|
+
await b.run();
|
|
43
|
+
}
|
|
44
|
+
} else {
|
|
45
|
+
await backup.run();
|
|
46
|
+
}
|
|
47
|
+
process.exit(0);
|
|
48
|
+
} catch (error) {
|
|
49
|
+
console.error("[NowBackup CLI] Failed:", error.message || error);
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
program.parse(process.argv);
|