@eutobias/serenojs 0.1.1 → 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/README.md +9 -5
- package/admin-dist/assets/{index-B3EgqtT6.js → index-Ddgw58Iy.js} +1 -1
- package/admin-dist/index.html +1 -1
- package/dist/config.d.ts +7 -0
- package/dist/config.js +1 -0
- package/dist/core/backup.server.d.ts +5 -2
- package/dist/core/backup.server.js +279 -12
- package/dist/core/schema-codegen.server.d.ts +17 -0
- package/dist/core/schema-codegen.server.js +155 -0
- package/dist/ui/admin/i18n.js +4 -4
- package/package.json +1 -1
- package/src/config.ts +4 -0
- package/src/core/backup.server.ts +358 -17
- package/src/core/schema-codegen.server.ts +187 -0
- package/src/ui/admin/i18n.tsx +4 -4
package/README.md
CHANGED
|
@@ -40,8 +40,8 @@ consumed by any frontend.
|
|
|
40
40
|
- **Authentication** — opaque cookie sessions (no JWT), rotating refresh tokens,
|
|
41
41
|
user management and CSRF protection for unsafe requests.
|
|
42
42
|
- **Media uploads** — type/size validation, safe file serving and media lists.
|
|
43
|
-
- **Backups** — consistent SQLite snapshot
|
|
44
|
-
restore and an optional periodic scheduler.
|
|
43
|
+
- **Backups** — collection schemas, a consistent SQLite snapshot and assets in
|
|
44
|
+
a single archive, with restore and an optional periodic scheduler.
|
|
45
45
|
|
|
46
46
|
## Stack / requirements
|
|
47
47
|
|
|
@@ -121,6 +121,7 @@ export default defineCmsConfig({
|
|
|
121
121
|
media: { path: "/media" },
|
|
122
122
|
files: { path: "/files" },
|
|
123
123
|
backup: { path: "/backup", enabled: true, intervalHours: 24, keep: 10 },
|
|
124
|
+
schemas: { path: "src/schemas" },
|
|
124
125
|
db: { path: ".data/admin.db" },
|
|
125
126
|
});
|
|
126
127
|
```
|
|
@@ -221,6 +222,7 @@ can render them directly. For localized content, parse the nested values:
|
|
|
221
222
|
| `backup.enabled` | `true` | Enable the periodic backup scheduler |
|
|
222
223
|
| `backup.intervalHours` | `24` | Scheduler interval |
|
|
223
224
|
| `backup.keep` | `10` | Number of stored backups to keep |
|
|
225
|
+
| `schemas.path` | `"src/schemas"` | Host directory where restore writes the schema modules |
|
|
224
226
|
| `db.path` | `".data/admin.db"` | SQLite file path |
|
|
225
227
|
|
|
226
228
|
The package also reads these environment variables:
|
|
@@ -485,10 +487,12 @@ extensions are always blocked. The default maximum size is 10 MB unless
|
|
|
485
487
|
| `PUT` | `/backup` | Restore a raw `.serenojs` archive body |
|
|
486
488
|
| `DELETE` | `/backup?name=<file>` | Delete a stored backup |
|
|
487
489
|
|
|
488
|
-
All backup endpoints require authentication. A backup contains
|
|
489
|
-
SQLite snapshot plus files under
|
|
490
|
+
All backup endpoints require authentication. A backup contains the collection
|
|
491
|
+
schemas (`src/schemas`), a consistent SQLite snapshot plus files under
|
|
492
|
+
`public/images` and `public/files`. Restoring rewrites the schema modules,
|
|
490
493
|
replaces the live tables in a transaction and rewrites assets; it may invalidate
|
|
491
|
-
the current session.
|
|
494
|
+
the current session. Backups created by older versions without embedded schemas
|
|
495
|
+
have their descriptors reconstructed from the database tables.
|
|
492
496
|
|
|
493
497
|
## API examples
|
|
494
498
|
|