@trieb.work/payload-plugin-backup-mongodb 0.1.7 → 0.2.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 +130 -62
- package/dist/backup-dashboard.css +18 -1
- package/dist/collections/BackupTasks.js +8 -1
- package/dist/collections/BackupTasks.js.map +1 -1
- package/dist/components/BackupDashboard/BackupSettingsModal.client.js +203 -115
- package/dist/components/BackupDashboard/BackupSettingsModal.client.js.map +1 -1
- package/dist/components/BackupDashboard/RestoreBackupDialog.client.js +1 -1
- package/dist/components/BackupDashboard/RestoreBackupDialog.client.js.map +1 -1
- package/dist/components/BackupDashboard/TaskActionButton.client.d.ts +1 -1
- package/dist/components/BackupDashboard/TaskActionButton.client.js +59 -26
- package/dist/components/BackupDashboard/TaskActionButton.client.js.map +1 -1
- package/dist/components/BackupDashboard/backupDashboardInlineCss.js +1 -1
- package/dist/components/BackupDashboard/backupDashboardInlineCss.js.map +1 -1
- package/dist/components/BackupDashboard/index.js +27 -3
- package/dist/components/BackupDashboard/index.js.map +1 -1
- package/dist/core/backup.d.ts +4 -3
- package/dist/core/backup.js +50 -43
- package/dist/core/backup.js.map +1 -1
- package/dist/core/backupArchiveRead.d.ts +15 -0
- package/dist/core/backupArchiveRead.js +30 -0
- package/dist/core/backupArchiveRead.js.map +1 -0
- package/dist/core/backupSettings.js +5 -0
- package/dist/core/backupSettings.js.map +1 -1
- package/dist/core/restore.d.ts +5 -2
- package/dist/core/restore.js +133 -89
- package/dist/core/restore.js.map +1 -1
- package/dist/core/restorePreview.d.ts +12 -3
- package/dist/core/restorePreview.js +17 -13
- package/dist/core/restorePreview.js.map +1 -1
- package/dist/core/restoreResult.d.ts +34 -0
- package/dist/core/restoreResult.js +45 -0
- package/dist/core/restoreResult.js.map +1 -0
- package/dist/core/storage/config.d.ts +31 -0
- package/dist/core/storage/config.js +60 -0
- package/dist/core/storage/config.js.map +1 -0
- package/dist/core/storage/index.d.ts +23 -0
- package/dist/core/storage/index.js +25 -0
- package/dist/core/storage/index.js.map +1 -0
- package/dist/core/storage/s3.d.ts +35 -0
- package/dist/core/storage/s3.js +200 -0
- package/dist/core/storage/s3.js.map +1 -0
- package/dist/core/storage/types.d.ts +60 -0
- package/dist/core/storage/types.js +6 -0
- package/dist/core/storage/types.js.map +1 -0
- package/dist/core/storage/vercelBlob.d.ts +25 -0
- package/dist/core/storage/vercelBlob.js +53 -0
- package/dist/core/storage/vercelBlob.js.map +1 -0
- package/dist/core/taskProgress.d.ts +10 -4
- package/dist/core/taskProgress.js +11 -2
- package/dist/core/taskProgress.js.map +1 -1
- package/dist/endpoints/index.js +0 -5
- package/dist/endpoints/index.js.map +1 -1
- package/dist/endpoints/paths/admin-backup-download.js +8 -7
- package/dist/endpoints/paths/admin-backup-download.js.map +1 -1
- package/dist/endpoints/paths/admin-delete.js +11 -5
- package/dist/endpoints/paths/admin-delete.js.map +1 -1
- package/dist/endpoints/paths/admin-manual.js +2 -1
- package/dist/endpoints/paths/admin-manual.js.map +1 -1
- package/dist/endpoints/paths/admin-preview.js +9 -2
- package/dist/endpoints/paths/admin-preview.js.map +1 -1
- package/dist/endpoints/paths/admin-restore.js +7 -4
- package/dist/endpoints/paths/admin-restore.js.map +1 -1
- package/dist/endpoints/paths/admin-settings.js +35 -2
- package/dist/endpoints/paths/admin-settings.js.map +1 -1
- package/dist/endpoints/paths/cron-list.js +2 -1
- package/dist/endpoints/paths/cron-list.js.map +1 -1
- package/dist/endpoints/paths/cron-restore.js +14 -4
- package/dist/endpoints/paths/cron-restore.js.map +1 -1
- package/dist/endpoints/paths/cron-run.js +2 -1
- package/dist/endpoints/paths/cron-run.js.map +1 -1
- package/dist/endpoints/shared.d.ts +0 -1
- package/dist/endpoints/shared.js +0 -6
- package/dist/endpoints/shared.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/publicApiPaths.d.ts +0 -1
- package/dist/publicApiPaths.js +0 -1
- package/dist/publicApiPaths.js.map +1 -1
- package/dist/types.d.ts +0 -5
- package/dist/types.js.map +1 -1
- package/package.json +22 -4
- package/dist/endpoints/paths/admin-seed.d.ts +0 -3
- package/dist/endpoints/paths/admin-seed.js +0 -47
- package/dist/endpoints/paths/admin-seed.js.map +0 -1
package/README.md
CHANGED
|
@@ -9,9 +9,10 @@
|
|
|
9
9
|
|
|
10
10
|
A **Payload CMS v3** plugin for **MongoDB only** — not Postgres, SQLite, or
|
|
11
11
|
other database adapters. It handles Mongo + media backup, restore, and scheduled
|
|
12
|
-
retention with zero meta-database and a built-in admin UI. Backups live
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
retention with zero meta-database and a built-in admin UI. Backups live in
|
|
13
|
+
**Vercel Blob Storage** (default) or **AWS S3 / S3-compatible stores** (R2,
|
|
14
|
+
MinIO, etc.), so a fresh install can list and restore any prior backup without
|
|
15
|
+
bootstrapping a database first.
|
|
15
16
|
|
|
16
17
|

|
|
17
18
|
|
|
@@ -51,15 +52,13 @@ originated at
|
|
|
51
52
|
you do not add `app/.../route.ts` files for this plugin.
|
|
52
53
|
- **Pluggable blob storage.** Uses `BLOB_READ_WRITE_TOKEN` by default (the same
|
|
53
54
|
store you often use with `@payloadcms/storage-vercel-blob`), or point backups
|
|
54
|
-
at a dedicated Vercel Blob store in the admin.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
across reloads.
|
|
61
|
-
- **Demo/seed support.** Optional `seedDemoDumpUrl` registers a one-click seed
|
|
62
|
-
endpoint for templates and starters.
|
|
55
|
+
at a dedicated Vercel Blob store in the admin. Alternatively set
|
|
56
|
+
`BACKUP_STORAGE=s3` and use AWS S3, Cloudflare R2, MinIO, etc. Both **public**
|
|
57
|
+
and **private** access stores are supported; a validation step detects which
|
|
58
|
+
modes the store accepts.
|
|
59
|
+
- **Resumable long-running tasks.** Manual backups and restores are tracked in a
|
|
60
|
+
hidden `backup-tasks` collection (TTL, 30 min). The UI polls progress with a
|
|
61
|
+
short-lived `pollSecret` so long jobs stay observable even across reloads.
|
|
63
62
|
- **Tested.** Vitest covers archive, backup, restore, task progress, blob I/O,
|
|
64
63
|
endpoint auth, cron parsing, and blob-name helpers.
|
|
65
64
|
|
|
@@ -67,30 +66,107 @@ originated at
|
|
|
67
66
|
|
|
68
67
|
## Requirements
|
|
69
68
|
|
|
69
|
+
- **Node.js 20.9+** (Node 18 is no longer supported).
|
|
70
70
|
- Payload **v3+** (same major as your other `@payloadcms/*` packages).
|
|
71
71
|
- MongoDB with Payload’s mongoose adapter (`@payloadcms/db-mongodb`).
|
|
72
72
|
- MongoDB server (any version supported by that adapter).
|
|
73
|
-
- A
|
|
74
|
-
**
|
|
73
|
+
- A backup target:
|
|
74
|
+
- **Vercel Blob:** `BLOB_READ_WRITE_TOKEN` (the default target). Vercel
|
|
75
|
+
hosting is **not** required — any Node runtime that can reach Vercel Blob
|
|
76
|
+
works.
|
|
77
|
+
- **S3:** `BACKUP_STORAGE=s3` plus `BACKUP_S3_BUCKET` (and optionally
|
|
78
|
+
credentials). Requires Node 20+ for the optional AWS SDK peer packages. See
|
|
79
|
+
[Choosing a backup target](#choosing-a-backup-target-vercel-blob-or-s3).
|
|
75
80
|
- Next.js **15+** and React **19+** (the usual Payload 3 + App Router stack).
|
|
76
81
|
|
|
77
82
|
### Environment variables
|
|
78
83
|
|
|
79
|
-
| Variable | Required
|
|
80
|
-
| ------------------------------ |
|
|
81
|
-
| `MONGODB_URI` | yes
|
|
82
|
-
| `
|
|
83
|
-
| `
|
|
84
|
-
| `
|
|
85
|
-
| `
|
|
86
|
-
| `
|
|
84
|
+
| Variable | Required | Purpose |
|
|
85
|
+
| ------------------------------ | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
86
|
+
| `MONGODB_URI` | yes | MongoDB connection string (used by Payload and to label backups with the DB name). |
|
|
87
|
+
| `BACKUP_STORAGE` | optional | Backup target: `vercel-blob` (default) or `s3`. See [Choosing a backup target](#choosing-a-backup-target-vercel-blob-or-s3). |
|
|
88
|
+
| `BLOB_READ_WRITE_TOKEN` | for Vercel Blob | Default Vercel Blob store for backups and media. Required when `BACKUP_STORAGE=vercel-blob` (the default). Can be overridden in admin settings. |
|
|
89
|
+
| `CRON_SECRET` | for cron | Bearer token for every `/api/backup-mongodb/cron/*` call. Vercel Cron can supply this. |
|
|
90
|
+
| `NEXT_PUBLIC_SERVER_URL` | optional | Used to label backups with the current host. Falls back to `VERCEL_URL` when set. |
|
|
91
|
+
| `BACKUPS_TO_KEEP` | optional | Default retention for cron backups if the settings document has not been edited. Default `10`. |
|
|
92
|
+
| `PAYLOAD_BACKUP_ALLOWED_ROLES` | optional | Comma-separated role slugs that may see the **Backups** dashboard (case-insensitive). Use `*` to allow any authenticated user. When unset, the plugin falls back to requiring a `role` with slug `admin`, or allows everyone when the users collection has no `roles` field. Overridden by the `access` plugin option. |
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Choosing a backup target (Vercel Blob or S3)
|
|
97
|
+
|
|
98
|
+
Backups can be stored in **Vercel Blob** (default) or **AWS S3**. The S3 target
|
|
99
|
+
also works with any S3-compatible store — **Cloudflare R2**, **MinIO**, etc. —
|
|
100
|
+
because they share the same API; only the configuration differs, never the
|
|
101
|
+
plugin code.
|
|
102
|
+
|
|
103
|
+
Select the target with `BACKUP_STORAGE`. When unset it stays `vercel-blob`, so
|
|
104
|
+
existing deployments are unaffected.
|
|
105
|
+
|
|
106
|
+
### Using S3
|
|
107
|
+
|
|
108
|
+
S3 is enabled when `BACKUP_STORAGE=s3`. Install the AWS SDK (declared as
|
|
109
|
+
optional peer dependencies, so Vercel-only installs don't pull it in):
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
pnpm add @aws-sdk/client-s3 @aws-sdk/lib-storage @aws-sdk/s3-request-presigner
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
| Variable | Required | Purpose |
|
|
116
|
+
| ----------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------- |
|
|
117
|
+
| `BACKUP_STORAGE` | yes | Set to `s3`. |
|
|
118
|
+
| `BACKUP_S3_BUCKET` | yes | Target bucket name. |
|
|
119
|
+
| `BACKUP_S3_REGION` | optional | Region. Falls back to `AWS_REGION`, then `us-east-1`. |
|
|
120
|
+
| `BACKUP_S3_ENDPOINT` | optional | Custom endpoint for S3-compatible stores (R2, MinIO). Omit for AWS S3. |
|
|
121
|
+
| `BACKUP_S3_FORCE_PATH_STYLE` | optional | Path-style addressing. Defaults to `true` when an endpoint is set (needed for MinIO and some R2 setups). |
|
|
122
|
+
| `BACKUP_S3_PREFIX` | optional | Key namespace prepended to every object (for sharing a bucket). Backups still list/restore by their `backups/…` name. |
|
|
123
|
+
| `BACKUP_S3_ACCESS_KEY_ID` | optional | Access key. Falls back to `AWS_ACCESS_KEY_ID`. Omit to use the AWS default credential chain (IAM roles, etc.). |
|
|
124
|
+
| `BACKUP_S3_SECRET_ACCESS_KEY` | optional | Secret key. Falls back to `AWS_SECRET_ACCESS_KEY`. |
|
|
125
|
+
| `BACKUP_S3_SESSION_TOKEN` | optional | Session token for temporary credentials. Falls back to `AWS_SESSION_TOKEN`. |
|
|
126
|
+
|
|
127
|
+
Credentials are optional: when omitted, the AWS SDK's default provider chain is
|
|
128
|
+
used (environment, shared config, or instance/role credentials — recommended on
|
|
129
|
+
AWS).
|
|
130
|
+
|
|
131
|
+
**AWS S3**
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
BACKUP_STORAGE=s3
|
|
135
|
+
BACKUP_S3_BUCKET=my-payload-backups
|
|
136
|
+
BACKUP_S3_REGION=eu-central-1
|
|
137
|
+
# Credentials via IAM role (recommended) or:
|
|
138
|
+
# BACKUP_S3_ACCESS_KEY_ID=...
|
|
139
|
+
# BACKUP_S3_SECRET_ACCESS_KEY=...
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**Cloudflare R2**
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
BACKUP_STORAGE=s3
|
|
146
|
+
BACKUP_S3_BUCKET=my-payload-backups
|
|
147
|
+
BACKUP_S3_REGION=auto
|
|
148
|
+
BACKUP_S3_ENDPOINT=https://<account-id>.r2.cloudflarestorage.com
|
|
149
|
+
BACKUP_S3_FORCE_PATH_STYLE=true
|
|
150
|
+
BACKUP_S3_ACCESS_KEY_ID=<r2-access-key-id>
|
|
151
|
+
BACKUP_S3_SECRET_ACCESS_KEY=<r2-secret-access-key>
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Backups are stored under the same `backups/…` keys (see
|
|
155
|
+
[Blob naming](#blob-naming)), so listing and restore work identically across
|
|
156
|
+
targets. Downloads stream through the plugin's authenticated endpoint, so the
|
|
157
|
+
bucket does **not** need to be public.
|
|
158
|
+
|
|
159
|
+
> **Note on media:** the "include media" option bundles files from your Payload
|
|
160
|
+
> **Vercel Blob upload store** (`BLOB_READ_WRITE_TOKEN`). The configurable
|
|
161
|
+
> target above governs where backup **archives** live only; media is always read
|
|
162
|
+
> from and restored to the upload store, even when `BACKUP_STORAGE=s3`.
|
|
87
163
|
|
|
88
164
|
---
|
|
89
165
|
|
|
90
166
|
## Installation and getting started
|
|
91
167
|
|
|
92
168
|
Use this flow when **adding the plugin to an existing Payload 3 + Next.js app**
|
|
93
|
-
that already has MongoDB and
|
|
169
|
+
that already has MongoDB and a blob/S3 store configured.
|
|
94
170
|
|
|
95
171
|
### 1. Add the package
|
|
96
172
|
|
|
@@ -219,8 +295,10 @@ Retention, storage token, and cron collection skip list live in one modal:
|
|
|
219
295
|
- **Retention:** how many **cron** archives to keep; manual backups are not
|
|
220
296
|
pruned by this.
|
|
221
297
|
- **Dedicated backup storage (optional):** a separate Vercel Blob read/write
|
|
222
|
-
token so backups can live in a different
|
|
223
|
-
the token and optionally copy existing
|
|
298
|
+
token (when `BACKUP_STORAGE=vercel-blob`) so backups can live in a different
|
|
299
|
+
store than media. The UI can validate the token and optionally copy existing
|
|
300
|
+
`backups/*` objects to the new store. For S3, configure the target bucket via
|
|
301
|
+
environment variables.
|
|
224
302
|
- **Collection selection for cron:** defaults to all collections, with
|
|
225
303
|
per-collection opt-out.
|
|
226
304
|
|
|
@@ -239,12 +317,6 @@ type BackupPluginOptions = {
|
|
|
239
317
|
/** Default cron retention when no value is stored in settings. Falls back to `BACKUPS_TO_KEEP` or `10`. */
|
|
240
318
|
backupsToKeep?: number
|
|
241
319
|
|
|
242
|
-
/**
|
|
243
|
-
* If set, registers `POST /api/backup-mongodb/admin/seed` (demo dump + public seed media where applicable).
|
|
244
|
-
* Omit in production unless you need it.
|
|
245
|
-
*/
|
|
246
|
-
seedDemoDumpUrl?: string
|
|
247
|
-
|
|
248
320
|
/**
|
|
249
321
|
* Custom access check for admin routes and the dashboard. Overrides the
|
|
250
322
|
* `PAYLOAD_BACKUP_ALLOWED_ROLES` env var when provided.
|
|
@@ -258,19 +330,6 @@ type BackupPluginOptions = {
|
|
|
258
330
|
}
|
|
259
331
|
```
|
|
260
332
|
|
|
261
|
-
Example with custom access and seed URL (typical for starters):
|
|
262
|
-
|
|
263
|
-
```ts
|
|
264
|
-
backupMongodbPlugin({
|
|
265
|
-
access: (user) =>
|
|
266
|
-
Array.isArray((user as { roles?: { slug?: string }[] })?.roles) &&
|
|
267
|
-
(user as { roles: { slug?: string }[] }).roles.some(
|
|
268
|
-
(r) => r?.slug === 'admin' || r?.slug === 'superadmin',
|
|
269
|
-
),
|
|
270
|
-
seedDemoDumpUrl: 'https://example.com/seed/demo-db.json',
|
|
271
|
-
})
|
|
272
|
-
```
|
|
273
|
-
|
|
274
333
|
---
|
|
275
334
|
|
|
276
335
|
## HTTP API (Payload REST)
|
|
@@ -291,18 +350,17 @@ Authorization: Bearer <CRON_SECRET>
|
|
|
291
350
|
|
|
292
351
|
### Admin (session cookie, or `pollSecret` for `/task/:id` where applicable)
|
|
293
352
|
|
|
294
|
-
| Method | Path
|
|
295
|
-
| -------------- |
|
|
296
|
-
| `POST` | `/api/backup-mongodb/admin/manual`
|
|
297
|
-
| `POST` | `/api/backup-mongodb/admin/restore`
|
|
298
|
-
| `POST` | `/api/backup-mongodb/admin/backup-preview`
|
|
299
|
-
| `POST` | `/api/backup-mongodb/admin/restore-preview`
|
|
300
|
-
| `POST` | `/api/backup-mongodb/admin/delete`
|
|
301
|
-
| `GET` | `/api/backup-mongodb/admin/backup-download`
|
|
302
|
-
| `GET` | `/api/backup-mongodb/admin/task/:id`
|
|
303
|
-
| `GET` / `POST` | `/api/backup-mongodb/admin/settings`
|
|
304
|
-
| `POST` | `/api/backup-mongodb/admin/validate-blob-token`
|
|
305
|
-
| `POST` | `/api/backup-mongodb/admin/seed` — if `seedDemoDumpUrl` is set |
|
|
353
|
+
| Method | Path |
|
|
354
|
+
| -------------- | ----------------------------------------------- |
|
|
355
|
+
| `POST` | `/api/backup-mongodb/admin/manual` |
|
|
356
|
+
| `POST` | `/api/backup-mongodb/admin/restore` |
|
|
357
|
+
| `POST` | `/api/backup-mongodb/admin/backup-preview` |
|
|
358
|
+
| `POST` | `/api/backup-mongodb/admin/restore-preview` |
|
|
359
|
+
| `POST` | `/api/backup-mongodb/admin/delete` |
|
|
360
|
+
| `GET` | `/api/backup-mongodb/admin/backup-download` |
|
|
361
|
+
| `GET` | `/api/backup-mongodb/admin/task/:id` |
|
|
362
|
+
| `GET` / `POST` | `/api/backup-mongodb/admin/settings` |
|
|
363
|
+
| `POST` | `/api/backup-mongodb/admin/validate-blob-token` |
|
|
306
364
|
|
|
307
365
|
---
|
|
308
366
|
|
|
@@ -353,10 +411,18 @@ flows handle both.
|
|
|
353
411
|
|
|
354
412
|
### Overriding the backup store
|
|
355
413
|
|
|
356
|
-
To keep backups in a **different** Vercel Blob project than media
|
|
357
|
-
settings** in the admin, paste a
|
|
358
|
-
and optionally migrate existing
|
|
359
|
-
switching.
|
|
414
|
+
To keep backups in a **different** Vercel Blob project than media (when
|
|
415
|
+
`BACKUP_STORAGE=vercel-blob`), open **Backup settings** in the admin, paste a
|
|
416
|
+
dedicated `BLOB_READ_WRITE_TOKEN`, validate, and optionally migrate existing
|
|
417
|
+
`backups/*` objects to the new store before switching. For S3, the target is
|
|
418
|
+
controlled entirely by environment variables.
|
|
419
|
+
|
|
420
|
+
### Removed demo seed API (intentional)
|
|
421
|
+
|
|
422
|
+
Earlier releases exposed an optional demo seed route (`seedDemoDumpUrl`,
|
|
423
|
+
`/backup-mongodb/admin/seed`, and the `restoreSeedMedia` export). That was
|
|
424
|
+
removed on purpose: a backup plugin should not ship a public “seed my database”
|
|
425
|
+
API. Use your own migration/seed tooling instead.
|
|
360
426
|
|
|
361
427
|
---
|
|
362
428
|
|
|
@@ -407,8 +473,10 @@ workflow opens a “version packages” PR or runs `pnpm run release` (`build` +
|
|
|
407
473
|
## Roadmap / ideas
|
|
408
474
|
|
|
409
475
|
- Multipart / very large backup uploads (Vercel Blob supports large objects; may
|
|
410
|
-
need to switch past single-part limits).
|
|
411
|
-
- Additional storage adapters (
|
|
476
|
+
need to switch past single-part limits). _(S3 uploads already use multipart.)_
|
|
477
|
+
- Additional storage adapters (filesystem, etc.). _(AWS S3 and S3-compatible
|
|
478
|
+
stores such as R2/MinIO are supported — see
|
|
479
|
+
[Choosing a backup target](#choosing-a-backup-target-vercel-blob-or-s3).)_
|
|
412
480
|
- Scheduler-agnostic display when not using Vercel (`vercel.json` is currently
|
|
413
481
|
used for the schedule summary where available).
|
|
414
482
|
- Streaming restore for very large databases.
|
|
@@ -595,14 +595,31 @@
|
|
|
595
595
|
.backup-task-status-slot {
|
|
596
596
|
display: flex;
|
|
597
597
|
flex-direction: row;
|
|
598
|
-
align-items:
|
|
598
|
+
align-items: flex-start;
|
|
599
599
|
gap: 6px;
|
|
600
600
|
}
|
|
601
|
+
.backup-task-status-slot .backup-task-status__details {
|
|
602
|
+
display: flex;
|
|
603
|
+
flex-direction: column;
|
|
604
|
+
gap: 3px;
|
|
605
|
+
min-width: 0;
|
|
606
|
+
}
|
|
601
607
|
.backup-task-status-slot .backup-task-status__message {
|
|
602
608
|
font-size: 12px;
|
|
603
609
|
line-height: 1.4;
|
|
604
610
|
color: var(--theme-elevation-700);
|
|
605
611
|
}
|
|
612
|
+
.backup-task-status-slot .backup-task-status__warnings {
|
|
613
|
+
font-size: 12px;
|
|
614
|
+
line-height: 1.4;
|
|
615
|
+
color: var(--theme-warning-600, #b7791f);
|
|
616
|
+
white-space: pre-wrap;
|
|
617
|
+
}
|
|
618
|
+
.backup-task-status-slot .backup-task-status__error {
|
|
619
|
+
font-size: 12px;
|
|
620
|
+
line-height: 1.4;
|
|
621
|
+
color: var(--theme-error-500, #c0392b);
|
|
622
|
+
}
|
|
606
623
|
|
|
607
624
|
.restore-preview__blob-token-row {
|
|
608
625
|
display: flex;
|
|
@@ -16,7 +16,6 @@ export const BackupTasksCollection = {
|
|
|
16
16
|
options: [
|
|
17
17
|
'backup',
|
|
18
18
|
'restore',
|
|
19
|
-
'seed',
|
|
20
19
|
'delete',
|
|
21
20
|
'blobTransfer'
|
|
22
21
|
],
|
|
@@ -29,6 +28,7 @@ export const BackupTasksCollection = {
|
|
|
29
28
|
'queued',
|
|
30
29
|
'running',
|
|
31
30
|
'completed',
|
|
31
|
+
'completed_with_warnings',
|
|
32
32
|
'failed'
|
|
33
33
|
],
|
|
34
34
|
required: true
|
|
@@ -42,6 +42,13 @@ export const BackupTasksCollection = {
|
|
|
42
42
|
name: 'error',
|
|
43
43
|
type: 'text'
|
|
44
44
|
},
|
|
45
|
+
{
|
|
46
|
+
name: 'warnings',
|
|
47
|
+
type: 'textarea',
|
|
48
|
+
admin: {
|
|
49
|
+
hidden: true
|
|
50
|
+
}
|
|
51
|
+
},
|
|
45
52
|
{
|
|
46
53
|
name: 'pollSecret',
|
|
47
54
|
type: 'text',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/collections/BackupTasks.ts"],"sourcesContent":["import type { CollectionConfig } from 'payload'\n\nexport const BackupTasksCollection: CollectionConfig = {\n slug: 'backup-tasks',\n access: {\n create: () => false,\n delete: () => false,\n read: () => false,\n update: () => false,\n },\n admin: {\n hidden: true,\n },\n fields: [\n {\n name: 'kind',\n type: 'select',\n options: ['backup', 'restore', '
|
|
1
|
+
{"version":3,"sources":["../../src/collections/BackupTasks.ts"],"sourcesContent":["import type { CollectionConfig } from 'payload'\n\nexport const BackupTasksCollection: CollectionConfig = {\n slug: 'backup-tasks',\n access: {\n create: () => false,\n delete: () => false,\n read: () => false,\n update: () => false,\n },\n admin: {\n hidden: true,\n },\n fields: [\n {\n name: 'kind',\n type: 'select',\n options: ['backup', 'restore', 'delete', 'blobTransfer'],\n required: true,\n },\n {\n name: 'status',\n type: 'select',\n options: ['queued', 'running', 'completed', 'completed_with_warnings', 'failed'],\n required: true,\n },\n {\n name: 'message',\n type: 'text',\n required: true,\n },\n {\n name: 'error',\n type: 'text',\n },\n {\n name: 'warnings',\n type: 'textarea',\n admin: {\n hidden: true,\n },\n },\n {\n name: 'pollSecret',\n type: 'text',\n admin: {\n hidden: true,\n },\n },\n ],\n timestamps: true,\n}\n"],"names":["BackupTasksCollection","slug","access","create","delete","read","update","admin","hidden","fields","name","type","options","required","timestamps"],"mappings":"AAEA,OAAO,MAAMA,wBAA0C;IACrDC,MAAM;IACNC,QAAQ;QACNC,QAAQ,IAAM;QACdC,QAAQ,IAAM;QACdC,MAAM,IAAM;QACZC,QAAQ,IAAM;IAChB;IACAC,OAAO;QACLC,QAAQ;IACV;IACAC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;YACNC,SAAS;gBAAC;gBAAU;gBAAW;gBAAU;aAAe;YACxDC,UAAU;QACZ;QACA;YACEH,MAAM;YACNC,MAAM;YACNC,SAAS;gBAAC;gBAAU;gBAAW;gBAAa;gBAA2B;aAAS;YAChFC,UAAU;QACZ;QACA;YACEH,MAAM;YACNC,MAAM;YACNE,UAAU;QACZ;QACA;YACEH,MAAM;YACNC,MAAM;QACR;QACA;YACED,MAAM;YACNC,MAAM;YACNJ,OAAO;gBACLC,QAAQ;YACV;QACF;QACA;YACEE,MAAM;YACNC,MAAM;YACNJ,OAAO;gBACLC,QAAQ;YACV;QACF;KACD;IACDM,YAAY;AACd,EAAC"}
|