@wervt/cms 0.0.4 → 0.0.6
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 +177 -18
- package/dist/editor/assets/Button-DrsXdow7.js +6 -0
- package/dist/editor/assets/RichTextInput-BrNTSUXL.js +271 -0
- package/dist/editor/assets/Toast-DsP3Sdxg.js +13 -0
- package/dist/editor/assets/index-CWQLsBfF.js +16 -0
- package/dist/editor/assets/index-esGfkiTV.css +2 -0
- package/dist/editor/index.html +3 -3
- package/dist/editor-theme.d.ts +3 -0
- package/dist/editor-theme.js +18 -1
- package/dist/module.d.ts +18 -1
- package/dist/module.js +95 -7
- package/dist/routes.js +16 -0
- package/dist/runtime/app/edit-button.d.ts +7 -0
- package/dist/runtime/app/edit-button.js +56 -0
- package/dist/runtime/app/preview.client.js +12 -5
- package/dist/runtime/app/useCmsCollection.d.ts +24 -0
- package/dist/runtime/app/useCmsCollection.js +74 -0
- package/dist/runtime/app/useCmsSeo.d.ts +7 -0
- package/dist/runtime/app/useCmsSeo.js +31 -0
- package/dist/runtime/collections.d.ts +25 -0
- package/dist/runtime/collections.js +81 -0
- package/dist/runtime/editor-link.d.ts +19 -0
- package/dist/runtime/editor-link.js +31 -0
- package/dist/runtime/fields.d.ts +33 -1
- package/dist/runtime/fields.js +143 -7
- package/dist/runtime/pages.d.ts +11 -2
- package/dist/runtime/pages.js +37 -7
- package/dist/runtime/preview.d.ts +5 -2
- package/dist/runtime/preview.js +2 -2
- package/dist/runtime/schema.d.ts +187 -13
- package/dist/runtime/schema.js +115 -1
- package/dist/runtime/seo.d.ts +22 -0
- package/dist/runtime/seo.js +33 -0
- package/dist/runtime/server/access.get.d.ts +4 -0
- package/dist/runtime/server/access.get.js +8 -0
- package/dist/runtime/server/access.js +1 -1
- package/dist/runtime/server/collection.get.d.ts +12 -0
- package/dist/runtime/server/collection.get.js +28 -0
- package/dist/runtime/server/dev-images.d.ts +4 -1
- package/dist/runtime/server/dev-images.js +28 -2
- package/dist/runtime/server/entries.d.ts +53 -0
- package/dist/runtime/server/entries.js +83 -1
- package/dist/runtime/server/entry.delete.d.ts +4 -0
- package/dist/runtime/server/entry.delete.js +31 -0
- package/dist/runtime/server/entry.get.js +6 -6
- package/dist/runtime/server/entry.put.d.ts +1 -0
- package/dist/runtime/server/entry.put.js +20 -8
- package/dist/runtime/server/file-store.d.ts +14 -3
- package/dist/runtime/server/file-store.js +44 -9
- package/dist/runtime/server/image.delete.d.ts +4 -0
- package/dist/runtime/server/image.delete.js +24 -0
- package/dist/runtime/server/images.get.d.ts +5 -0
- package/dist/runtime/server/images.get.js +11 -0
- package/dist/runtime/server/library.d.ts +14 -0
- package/dist/runtime/server/library.js +72 -0
- package/dist/runtime/server/links.get.d.ts +7 -0
- package/dist/runtime/server/links.get.js +35 -0
- package/dist/runtime/server/media.d.ts +74 -0
- package/dist/runtime/server/media.js +88 -0
- package/dist/runtime/server/schema.get.d.ts +8 -0
- package/dist/runtime/server/schema.get.js +17 -7
- package/dist/runtime/server/store.d.ts +11 -2
- package/dist/runtime/server/store.js +110 -20
- package/dist/runtime/server/upload.post.js +3 -2
- package/dist/runtime/server/versions.get.d.ts +20 -0
- package/dist/runtime/server/versions.get.js +36 -0
- package/package.json +3 -2
- package/dist/editor/assets/Button-Dai6Ph2c.js +0 -6
- package/dist/editor/assets/RichTextInput-CdL9ZFoP.js +0 -271
- package/dist/editor/assets/Toast-BaUcosq6.js +0 -13
- package/dist/editor/assets/index-CP6dGIyl.css +0 -2
- package/dist/editor/assets/index-Du-lvx2V.js +0 -16
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const _default: import("nuxt/server").EventHandler<Promise<{
|
|
2
|
+
versions: {
|
|
3
|
+
updatedAt: string;
|
|
4
|
+
by: string | null;
|
|
5
|
+
changed: string[] | null;
|
|
6
|
+
}[];
|
|
7
|
+
key?: undefined;
|
|
8
|
+
value?: undefined;
|
|
9
|
+
updatedAt?: undefined;
|
|
10
|
+
by?: undefined;
|
|
11
|
+
} | {
|
|
12
|
+
versions?: undefined;
|
|
13
|
+
key: string;
|
|
14
|
+
value: {
|
|
15
|
+
[x: string]: unknown;
|
|
16
|
+
};
|
|
17
|
+
updatedAt: string;
|
|
18
|
+
by: string | null;
|
|
19
|
+
}>>;
|
|
20
|
+
export { _default as default };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { changedFields, isEntryKey, sameInstant } from "./entries.js";
|
|
2
|
+
import { resolveValue } from "../fields.js";
|
|
3
|
+
import { fieldsOf } from "../pages.js";
|
|
4
|
+
import { requireEditor } from "./access.js";
|
|
5
|
+
import { serverImages } from "./images.js";
|
|
6
|
+
import { readVersions } from "./store.js";
|
|
7
|
+
import { createError, defineEventHandler, getQuery, getRouterParam } from "nuxt/server";
|
|
8
|
+
// src/runtime/server/versions.get.ts
|
|
9
|
+
var versions_get_default = defineEventHandler(async (event) => {
|
|
10
|
+
requireEditor(event);
|
|
11
|
+
const key = getRouterParam(event, "key");
|
|
12
|
+
if (!isEntryKey(key)) throw createError({
|
|
13
|
+
status: 400,
|
|
14
|
+
message: "Invalid key"
|
|
15
|
+
});
|
|
16
|
+
const versions = await readVersions(key);
|
|
17
|
+
const at = getQuery(event).at;
|
|
18
|
+
if (typeof at !== "string") return { versions: versions.map(({ updatedAt, by, value }, i) => ({
|
|
19
|
+
updatedAt,
|
|
20
|
+
by,
|
|
21
|
+
changed: changedFields(value, versions[i + 1]?.value)
|
|
22
|
+
})) };
|
|
23
|
+
const version = versions.find((v) => sameInstant(v.updatedAt, at));
|
|
24
|
+
if (!version) throw createError({
|
|
25
|
+
status: 404,
|
|
26
|
+
message: "No such version"
|
|
27
|
+
});
|
|
28
|
+
const fields = fieldsOf(key);
|
|
29
|
+
return {
|
|
30
|
+
key,
|
|
31
|
+
value: fields ? resolveValue(fields, version.value, serverImages) : version.value,
|
|
32
|
+
updatedAt: version.updatedAt,
|
|
33
|
+
by: version.by
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
export { versions_get_default as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wervt/cms",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "Editable texts, images and lists for Nuxt sites on wervt: written to files in dev, to the app's database and bucket once deployed.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cms",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@comark/vue": "^0.8.1",
|
|
36
|
-
"@wervt/nuxt": "^0.3.
|
|
36
|
+
"@wervt/nuxt": "^0.3.26",
|
|
37
37
|
"ablage": "^0.1.1",
|
|
38
38
|
"comark": "^0.8.1"
|
|
39
39
|
},
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"@golar/vue": "^0.1.11",
|
|
43
43
|
"@iconify-json/lucide": "^1.2.157",
|
|
44
44
|
"@iconify/vue": "^5.0.3",
|
|
45
|
+
"@internationalized/date": "^3.12.4",
|
|
45
46
|
"@nuxt/ui": "^4.12.0",
|
|
46
47
|
"@tiptap/core": "3.31.4",
|
|
47
48
|
"@tiptap/extension-image": "3.31.4",
|