@arch-cadre/backup-module 1.0.9 → 1.0.11
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/dist/actions.cjs +1 -1
- package/dist/actions.mjs +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/routes.cjs +1 -1
- package/dist/routes.mjs +1 -1
- package/dist/ui/components/backup-actions.cjs +1 -1
- package/dist/ui/components/backup-actions.mjs +1 -1
- package/dist/ui/components/backup-client.cjs +1 -1
- package/dist/ui/components/backup-client.mjs +1 -1
- package/dist/ui/pages/backup-list.cjs +2 -2
- package/dist/ui/pages/backup-list.mjs +2 -2
- package/package.json +7 -7
- package/src/actions.ts +1 -1
- package/src/index.ts +2 -2
- package/src/routes.ts +1 -1
- package/src/ui/components/backup-actions.ts +1 -1
- package/src/ui/components/backup-client.tsx +1 -1
- package/src/ui/pages/backup-list.tsx +4 -4
package/dist/actions.cjs
CHANGED
|
@@ -14,7 +14,7 @@ var _nodePath = _interopRequireDefault(require("node:path"));
|
|
|
14
14
|
var _nodeUtil = require("node:util");
|
|
15
15
|
var _server = require("@arch-cadre/core/server");
|
|
16
16
|
var _drizzleOrm = require("drizzle-orm");
|
|
17
|
-
var _schema = require("./schema.
|
|
17
|
+
var _schema = require("./schema.cjs");
|
|
18
18
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
19
|
const execAsync = (0, _nodeUtil.promisify)(_nodeChild_process.exec);
|
|
20
20
|
const BACKUP_DIR = _nodePath.default.join(process.cwd(), "backups");
|
package/dist/actions.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import path from "node:path";
|
|
|
5
5
|
import { promisify } from "node:util";
|
|
6
6
|
import { db, eventBus, getCurrentSession } from "@arch-cadre/core/server";
|
|
7
7
|
import { desc, eq } from "drizzle-orm";
|
|
8
|
-
import { backupTable } from "./schema.
|
|
8
|
+
import { backupTable } from "./schema.mjs";
|
|
9
9
|
const execAsync = promisify(exec);
|
|
10
10
|
const BACKUP_DIR = path.join(process.cwd(), "backups");
|
|
11
11
|
export async function getBackups() {
|
package/dist/index.cjs
CHANGED
|
@@ -7,8 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
var _server = require("@arch-cadre/core/server");
|
|
8
8
|
var _drizzleOrm = require("drizzle-orm");
|
|
9
9
|
var _manifest = _interopRequireDefault(require("../manifest.json"));
|
|
10
|
-
var _navigation = require("./navigation.
|
|
11
|
-
var _routes = require("./routes.
|
|
10
|
+
var _navigation = require("./navigation.cjs");
|
|
11
|
+
var _routes = require("./routes.cjs");
|
|
12
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
13
|
const BACKUP_PERMISSIONS = [{
|
|
14
14
|
name: "backup:create",
|
package/dist/index.mjs
CHANGED
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
} from "@arch-cadre/core/server";
|
|
8
8
|
import { inArray, sql } from "drizzle-orm";
|
|
9
9
|
import manifest from "../manifest.json";
|
|
10
|
-
import { navigation } from "./navigation.
|
|
11
|
-
import { privateRoutes } from "./routes.
|
|
10
|
+
import { navigation } from "./navigation.mjs";
|
|
11
|
+
import { privateRoutes } from "./routes.mjs";
|
|
12
12
|
const BACKUP_PERMISSIONS = [
|
|
13
13
|
{ name: "backup:create", description: "Allow creating system backups" },
|
|
14
14
|
{ name: "backup:restore", description: "Allow restoring system backups" },
|
package/dist/routes.cjs
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.publicRoutes = exports.privateRoutes = void 0;
|
|
7
|
-
var _backupList = _interopRequireDefault(require("./ui/pages/backup-list.
|
|
7
|
+
var _backupList = _interopRequireDefault(require("./ui/pages/backup-list.cjs"));
|
|
8
8
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
9
|
const publicRoutes = exports.publicRoutes = [];
|
|
10
10
|
const privateRoutes = exports.privateRoutes = [{
|
package/dist/routes.mjs
CHANGED
|
@@ -8,7 +8,7 @@ exports.createBackupAction = createBackupAction;
|
|
|
8
8
|
exports.deleteBackupAction = deleteBackupAction;
|
|
9
9
|
exports.restoreBackupAction = restoreBackupAction;
|
|
10
10
|
var _cache = require("next/cache");
|
|
11
|
-
var _actions = require("../../actions.
|
|
11
|
+
var _actions = require("../../actions.cjs");
|
|
12
12
|
async function createBackupAction() {
|
|
13
13
|
await (0, _actions.createBackup)();
|
|
14
14
|
(0, _cache.revalidatePath)("/module/backup");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use server";
|
|
2
2
|
import { revalidatePath } from "next/cache";
|
|
3
|
-
import { createBackup, deleteBackup, restoreBackup } from "../../actions.
|
|
3
|
+
import { createBackup, deleteBackup, restoreBackup } from "../../actions.mjs";
|
|
4
4
|
export async function createBackupAction() {
|
|
5
5
|
await createBackup();
|
|
6
6
|
revalidatePath("/module/backup");
|
|
@@ -10,7 +10,7 @@ exports.RestoreBackupButton = RestoreBackupButton;
|
|
|
10
10
|
var _ui = require("@arch-cadre/ui");
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
12
|
var React = _react;
|
|
13
|
-
var _backupActions = require("./backup-actions.
|
|
13
|
+
var _backupActions = require("./backup-actions.cjs");
|
|
14
14
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
15
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
16
|
function CreateBackupButton() {
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
createBackupAction,
|
|
7
7
|
deleteBackupAction,
|
|
8
8
|
restoreBackupAction
|
|
9
|
-
} from "./backup-actions.
|
|
9
|
+
} from "./backup-actions.mjs";
|
|
10
10
|
export function CreateBackupButton() {
|
|
11
11
|
const [pending, setPending] = useState(false);
|
|
12
12
|
const handleCreate = async () => {
|
|
@@ -9,8 +9,8 @@ var _table = require("@arch-cadre/ui/components/table");
|
|
|
9
9
|
var _dateFns = require("date-fns");
|
|
10
10
|
var _locale = require("date-fns/locale");
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
|
-
var _actions = require("../../actions.
|
|
13
|
-
var _backupClient = require("../components/backup-client.
|
|
12
|
+
var _actions = require("../../actions.cjs");
|
|
13
|
+
var _backupClient = require("../components/backup-client.cjs");
|
|
14
14
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
15
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
16
|
function formatBytes(bytes, decimals = 2) {
|
|
@@ -16,12 +16,12 @@ import {
|
|
|
16
16
|
import { formatDistanceToNow } from "date-fns";
|
|
17
17
|
import { pl } from "date-fns/locale";
|
|
18
18
|
import * as React from "react";
|
|
19
|
-
import { getBackups } from "../../actions.
|
|
19
|
+
import { getBackups } from "../../actions.mjs";
|
|
20
20
|
import {
|
|
21
21
|
CreateBackupButton,
|
|
22
22
|
DeleteBackupButton,
|
|
23
23
|
RestoreBackupButton
|
|
24
|
-
} from "../components/backup-client.
|
|
24
|
+
} from "../components/backup-client.mjs";
|
|
25
25
|
function formatBytes(bytes, decimals = 2) {
|
|
26
26
|
if (bytes === 0) return "0 Bytes";
|
|
27
27
|
const k = 1024;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arch-cadre/backup-module",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"description": "Backup module for Kryo framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"build": "unbuild"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@arch-cadre/modules": "^0.0.
|
|
30
|
-
"@arch-cadre/ui": "^0.0.
|
|
29
|
+
"@arch-cadre/modules": "^0.0.81",
|
|
30
|
+
"@arch-cadre/ui": "^0.0.55",
|
|
31
31
|
"@hookform/resolvers": "^3.10.0",
|
|
32
32
|
"date-fns": "^4.1.0",
|
|
33
33
|
"drizzle-orm": "1.0.0-beta.6-4414a19",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"zod": "^3.24.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@arch-cadre/core": "^0.0.
|
|
41
|
+
"@arch-cadre/core": "^0.0.55",
|
|
42
42
|
"@types/pg": "^8.16.0",
|
|
43
43
|
"@types/react": "^19",
|
|
44
44
|
"next": "16.1.1",
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
"unbuild": "^3.6.1"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@arch-cadre/core": "^0.0.
|
|
51
|
-
"@arch-cadre/intl": "^0.0.
|
|
52
|
-
"@arch-cadre/ui": "^0.0.
|
|
50
|
+
"@arch-cadre/core": "^0.0.55",
|
|
51
|
+
"@arch-cadre/intl": "^0.0.55",
|
|
52
|
+
"@arch-cadre/ui": "^0.0.55",
|
|
53
53
|
"next": ">=13.0.0",
|
|
54
54
|
"react": "^19.0.0"
|
|
55
55
|
},
|
package/src/actions.ts
CHANGED
|
@@ -6,7 +6,7 @@ import path from "node:path";
|
|
|
6
6
|
import { promisify } from "node:util";
|
|
7
7
|
import { db, eventBus, getCurrentSession } from "@arch-cadre/core/server";
|
|
8
8
|
import { desc, eq } from "drizzle-orm";
|
|
9
|
-
import { backupTable } from "./schema
|
|
9
|
+
import { backupTable } from "./schema";
|
|
10
10
|
|
|
11
11
|
const execAsync = promisify(exec);
|
|
12
12
|
const BACKUP_DIR = path.join(process.cwd(), "backups");
|
package/src/index.ts
CHANGED
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
import type { IModule } from "@arch-cadre/modules";
|
|
9
9
|
import { inArray, sql } from "drizzle-orm";
|
|
10
10
|
import manifest from "../manifest.json";
|
|
11
|
-
import { navigation } from "./navigation
|
|
12
|
-
import { privateRoutes } from "./routes
|
|
11
|
+
import { navigation } from "./navigation";
|
|
12
|
+
import { privateRoutes } from "./routes";
|
|
13
13
|
|
|
14
14
|
const BACKUP_PERMISSIONS = [
|
|
15
15
|
{ name: "backup:create", description: "Allow creating system backups" },
|
package/src/routes.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type {
|
|
|
2
2
|
PrivateRouteDefinition,
|
|
3
3
|
PublicRouteDefinition,
|
|
4
4
|
} from "@arch-cadre/modules";
|
|
5
|
-
import BackupListPage from "./ui/pages/backup-list
|
|
5
|
+
import BackupListPage from "./ui/pages/backup-list";
|
|
6
6
|
|
|
7
7
|
export const publicRoutes: PublicRouteDefinition[] = [];
|
|
8
8
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use server";
|
|
2
2
|
|
|
3
3
|
import { revalidatePath } from "next/cache";
|
|
4
|
-
import { createBackup, deleteBackup, restoreBackup } from "../../actions
|
|
4
|
+
import { createBackup, deleteBackup, restoreBackup } from "../../actions";
|
|
5
5
|
|
|
6
6
|
export async function createBackupAction() {
|
|
7
7
|
await createBackup();
|
|
@@ -16,12 +16,12 @@ import {
|
|
|
16
16
|
import { formatDistanceToNow } from "date-fns";
|
|
17
17
|
import { pl } from "date-fns/locale";
|
|
18
18
|
import * as React from "react";
|
|
19
|
-
import { getBackups } from "../../actions
|
|
19
|
+
import { getBackups } from "../../actions";
|
|
20
20
|
import {
|
|
21
21
|
CreateBackupButton,
|
|
22
22
|
DeleteBackupButton,
|
|
23
23
|
RestoreBackupButton,
|
|
24
|
-
} from "../components/backup-client
|
|
24
|
+
} from "../components/backup-client";
|
|
25
25
|
|
|
26
26
|
function formatBytes(bytes: number, decimals = 2) {
|
|
27
27
|
if (bytes === 0) return "0 Bytes";
|
|
@@ -94,8 +94,8 @@ export default async function BackupListPage() {
|
|
|
94
94
|
<TableCell>
|
|
95
95
|
<span
|
|
96
96
|
className={`px-2 py-1 rounded-full text-xs font-semibold ${backup.status === "success"
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
? "bg-green-100 text-green-700"
|
|
98
|
+
: "bg-red-100 text-red-700"
|
|
99
99
|
}`}
|
|
100
100
|
>
|
|
101
101
|
{backup.status}
|